Sync usage with man page.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / allascii.c
blob3fc16c841eaf18cb00a14193386bc424a44d1b08
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* allascii 3
6 /* SUMMARY
7 /* predicate if string is all ASCII
8 /* SYNOPSIS
9 /* #include <stringops.h>
11 /* int allascii(buffer)
12 /* const char *buffer;
13 /* DESCRIPTION
14 /* allascii() determines if its argument is an all-ASCII string.
16 /* Arguments:
17 /* .IP buffer
18 /* The null-terminated input string.
19 /* LICENSE
20 /* .ad
21 /* .fi
22 /* The Secure Mailer license must be distributed with this software.
23 /* AUTHOR(S)
24 /* Wietse Venema
25 /* IBM T.J. Watson Research
26 /* P.O. Box 704
27 /* Yorktown Heights, NY 10598, USA
28 /*--*/
30 /* System library. */
32 #include <sys_defs.h>
33 #include <ctype.h>
35 /* Utility library. */
37 #include "stringops.h"
39 /* allascii - return true if string is all ASCII */
41 int allascii(const char *string)
43 const char *cp;
44 int ch;
46 if (*string == 0)
47 return (0);
48 for (cp = string; (ch = *(unsigned char *) cp) != 0; cp++)
49 if (!ISASCII(ch))
50 return (0);
51 return (1);