Postfix3.3.1
allprint.c
[詳解]
1 /*++
2 /* NAME
3 /* allprint 3
4 /* SUMMARY
5 /* predicate if string is all printable
6 /* SYNOPSIS
7 /* #include <stringops.h>
8 /*
9 /* int allprint(buffer)
10 /* const char *buffer;
11 /* DESCRIPTION
12 /* allprint() determines if its argument is an all-printable string.
13 /*
14 /* Arguments:
15 /* .IP buffer
16 /* The null-terminated input string.
17 /* LICENSE
18 /* .ad
19 /* .fi
20 /* The Secure Mailer license must be distributed with this software.
21 /* AUTHOR(S)
22 /* Wietse Venema
23 /* IBM T.J. Watson Research
24 /* P.O. Box 704
25 /* Yorktown Heights, NY 10598, USA
26 /*--*/
27 
28 /* System library. */
29 
30 #include <sys_defs.h>
31 #include <ctype.h>
32 
33 /* Utility library. */
34 
35 #include "stringops.h"
36 
37 /* allprint - return true if string is all printable */
38 
39 int allprint(const char *string)
40 {
41  const char *cp;
42  int ch;
43 
44  if (*string == 0)
45  return (0);
46  for (cp = string; (ch = *(unsigned char *) cp) != 0; cp++)
47  if (!ISASCII(ch) || !ISPRINT(ch))
48  return (0);
49  return (1);
50 }
#define ISASCII(c)
Definition: sys_defs.h:1743
#define ISPRINT(c)
Definition: sys_defs.h:1751
int allprint(const char *string)
Definition: allprint.c:39