BRL-CAD
ctype.c
Go to the documentation of this file.
1 /* C T Y P E . C
2  * BRL-CAD
3  *
4  * Copyright (c) 2007-2014 United States Government as represented by
5  * the U.S. Army Research Laboratory.
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public License
9  * version 2.1 as published by the Free Software Foundation.
10  *
11  * This library is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this file; see the file named COPYING for more
18  * information.
19  */
20 
21 #include "common.h"
22 
23 #include <string.h>
24 #include <ctype.h>
25 #include "bu/str.h"
26 
27 int
28 bu_str_isprint(const char *cp)
29 {
30  if (cp == NULL || *cp == '\0')
31  return 0;
32 
33  while (*cp != '\0' && isprint((int)(*cp)))
34  ++cp;
35 
36  if (*cp == '\0')
37  return 1;
38 
39  return 0;
40 }
41 
42 
43 /*
44  * Local Variables:
45  * mode: C
46  * tab-width: 8
47  * indent-tabs-mode: t
48  * c-file-style: "stroustrup"
49  * End:
50  * ex: shiftwidth=4 tabstop=8
51  */
Header file for the BRL-CAD common definitions.
int bu_str_isprint(const char *cp)
Definition: ctype.c:28