1 #include "Local.h" /* standard header file */
3 /********************************************************************/
6 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
7 /* Date: 05 Oct 1992 */
8 /* Programmer: ALLAN DARLING */
11 /* Abstract: The stspack3 package contains functions to */
12 /* perform the isalnum through isxdigit functions */
13 /* on strings. The functions come in four forms: */
14 /* those that test NULL delimited strings and are */
15 /* named in the form sxxxxxxx, those that test at */
16 /* most n characters and are named in the form */
17 /* nxxxxxxx, those that search forward in a string */
18 /* and are named in the form nxtyyyyy, and those */
19 /* that search backward in a string and are named */
20 /* in the form lstyyyyy. */
22 /* The xxxxxxx is the name of the test applied to */
23 /* each character in the string, such as isalpha, */
24 /* thus a function to test a NULL delimited string */
25 /* an return a nonzero value if all characters in */
26 /* the string are digits is named sisdigit. */
28 /* The yyyyy is the name of the test applied to */
29 /* characters in a string, minus the 'is' prefix. */
30 /* Thus a function to find the next digit in a NULL */
31 /* delimited string and return a pointer to it is */
34 /* The only exception to the naming rule is for the */
35 /* functions that test for hexadecimal digits. */
36 /* These are named sisxdigi, nisxdigi, nxtxdigi, */
37 /* and lstxdigi because of the eight character */
38 /* function name limitation. */
40 /* The nxxxxxxx class of functions will test up to */
41 /* n characters or the first NULL character */
42 /* encountered, whichever comes first. For all */
43 /* classes of functions, the string sentinal is */
44 /* not included in the test. */
46 /* External Functions Called: */
47 /* isalnum, isalpha, iscntrl, isdigit, isgraph, */
48 /* islower, isprint, ispunct, isspace, isupper, */
51 /* Input: For sxxxxxxx class functions, a pointer to a */
52 /* NULL delimited character string. */
54 /* For nxtyyyyy class functions, a pointer to a */
55 /* NULL delimited character string. */
57 /* for nxxxxxxx class functions, a pointer to a */
58 /* character array, and a positive, nonzero integer.*/
60 /* for lstyyyyy class functions, a pointer to a */
61 /* character array, and a positive, nonzero integer.*/
63 /* Output: A nonzero value if the test is true for all */
64 /* characters in the string, a zero value otherwise.*/
66 /* Modification History: */
69 /********************************************************************/
70 char *nxtalnum(char *s) {
72 for (; !isalnum(*s) && *s; s++) ;
82 char *nxtalpha(char *s) {
84 for (; !isalpha(*s) && *s; s++) ;
94 char *nxtcntrl(char *s) {
96 for (; !iscntrl(*s) && *s; s++) ;
106 char *nxtdigit(char *s) {
108 for (; !isdigit(*s) && *s; s++) ;
118 char *nxtgraph(char *s) {
120 for (; !isgraph(*s) && *s; s++) ;
130 char *nxtlower(char *s) {
132 for (; !islower(*s) && *s; s++) ;
142 char *nxtprint(char *s) {
144 for (; !isprint(*s) && *s; s++) ;
154 char *nxtpunct(char *s) {
156 for (; !ispunct(*s) && *s; s++) ;
166 char *nxtspace(char *s) {
168 for (; !isspace(*s) && *s; s++) ;
178 char *nxtupper(char *s) {
180 for (; !isupper(*s) && *s; s++) ;
190 char *nxtxdigi(char *s) {
192 for (; !isxdigit(*s) && *s; s++) ;