Revision: 48447
          http://brlcad.svn.sourceforge.net/brlcad/?rev=48447&view=rev
Author:   bob1961
Date:     2012-01-11 22:19:04 +0000 (Wed, 11 Jan 2012)
Log Message:
-----------
Added bu_str_isprint.

Modified Paths:
--------------
    brlcad/trunk/include/bu.h
    brlcad/trunk/src/libbu/CMakeLists.txt

Added Paths:
-----------
    brlcad/trunk/src/libbu/ctype.c

Modified: brlcad/trunk/include/bu.h
===================================================================
--- brlcad/trunk/include/bu.h   2012-01-11 22:08:10 UTC (rev 48446)
+++ brlcad/trunk/include/bu.h   2012-01-11 22:19:04 UTC (rev 48447)
@@ -6031,6 +6031,15 @@
 BU_EXPORT extern void *bu_pool_get(size_t elem_byte_size);
 BU_EXPORT extern void bu_pool_put(void *ptr, size_t elem_byte_size);
 
+/** @file libbu/ctype.c
+ *
+ * Routines for checking ctypes.
+ *
+ */
+BU_EXPORT extern int bu_str_isprint(const char *cp);
+
+
+
 __END_DECLS
 
 #endif  /* __BU_H__ */

Modified: brlcad/trunk/src/libbu/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libbu/CMakeLists.txt       2012-01-11 22:08:10 UTC (rev 
48446)
+++ brlcad/trunk/src/libbu/CMakeLists.txt       2012-01-11 22:19:04 UTC (rev 
48447)
@@ -25,6 +25,7 @@
     color.c
     convert.c
     crashreport.c
+    ctype.c
     dirent.c
     dirname.c
     dlfcn.c

Added: brlcad/trunk/src/libbu/ctype.c
===================================================================
--- brlcad/trunk/src/libbu/ctype.c                              (rev 0)
+++ brlcad/trunk/src/libbu/ctype.c      2012-01-11 22:19:04 UTC (rev 48447)
@@ -0,0 +1,52 @@
+/*                          C T Y P E . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2007-2011 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+#include "common.h"
+
+#include <string.h>
+#include <ctype.h>
+#include "bu.h"
+
+
+int
+bu_str_isprint(const char *cp)
+{
+    if (cp == NULL)
+       return 0;
+
+    while (*cp != '\0' && isprint(*cp))
+       ++cp;
+
+    if (*cp == '\0')
+       return 1;
+
+    return 0;
+}
+
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: brlcad/trunk/src/libbu/ctype.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to