stringtools.h

00001 /*
00002 Copyright (C) 2003-2004 Douglas Thain and the University of Wisconsin
00003 Copyright (C) 2005- The University of Notre Dame
00004 This software is distributed under the GNU General Public License.
00005 See the file COPYING for details.
00006 */
00007 
00008 #ifndef STRINGTOOLS_H
00009 #define STRINGTOOLS_H
00010 
00011 #include "int_sizes.h"
00012 
00013 typedef char *(*string_subst_lookup_t) (const char *name, void *arg);
00014 
00015 void string_from_ip_address(const unsigned char *ip_addr_bytes, char *str);
00016 int string_to_ip_address(const char *str, unsigned char *ip_addr_bytes);
00017 int string_ip_subnet(const char *addr, char *subnet);
00018 void string_chomp(char *str);
00019 int whole_string_match_regex(const char *text, char *pattern);
00020 int string_match_regex(const char *text, char *pattern);
00021 int string_match(const char *pattern, const char *text);
00022 char *string_front(const char *str, int max);
00023 const char *string_back(const char *str, int max);
00024 const char *string_basename(const char *str);
00025 void string_dirname(const char *path, char *dir);
00026 char *string_metric(double invalue, int power_needed, char *buffer);
00027 INT64_T string_metric_parse(const char *str);
00028 int string_time_parse(const char *str);
00029 int string_split(char *str, int *argc, char ***argv);
00030 int string_split_quotes(char *str, int *argc, char ***argv);
00031 char *string_pad_right(char *str, int length);
00032 char *string_pad_left(char *str, int length);
00033 void string_cookie(char *str, int length);
00034 char *string_subst(char *value, string_subst_lookup_t lookup, void *arg);
00035 char *string_combine(char *first, char *second);
00036 char *string_combine_multi(char *first, ...);
00037 char *string_signal(int sig);
00038 void string_split_path(const char *str, char *first, char *rest);
00039 void string_split_multipath(const char *input, char *first, char *rest);
00040 void string_collapse_path(const char *longpath, char *shortpath, int remove_dotdot);
00041 void string_tolower(char *str);
00042 void string_toupper(char *str);
00043 int string_isspace(const char *str);
00044 int string_is_integer(const char *str);
00045 void string_replace_backslash_codes(const char *instr, char *outstr);
00046 
00047 int strpos(const char *str, char c);
00048 int strrpos(const char *str, char c);
00049 int getDateString(char *str);
00050 int string_null_or_empty(const char *str);
00051 
00052 #ifndef CCTOOLS_OPSYS_LINUX
00053 char *strsep(char **stringp, const char *delim);
00054 #endif
00055 
00056 #endif

Generated on Sun Aug 14 23:01:35 2011 for cctools by  doxygen 1.6.1