Sync usage with man page.
[netbsd-mini2440.git] / external / ibm-public / postfix / dist / src / util / allprint.c
blobf00050e4a01a972573c86a3c7d5c118da4ac8776
1 /* $NetBSD$ */
3 /*++
4 /* NAME
5 /* allprint 3
6 /* SUMMARY
7 /* predicate if string is all printable
8 /* SYNOPSIS
9 /* #include <stringops.h>
11 /* int allprint(buffer)
12 /* const char *buffer;
13 /* DESCRIPTION
14 /* allprint() determines if its argument is an all-printable 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 /* allprint - return true if string is all printable */
41 int allprint(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) || !ISPRINT(ch))
50 return (0);
51 return (1);