nfs-ganesha 1.4
|
00001 /* 00002 * vim:expandtab:shiftwidth=4:tabstop=8: 00003 */ 00004 00011 #ifndef _COMMON_UTILS_H 00012 #define _COMMON_UTILS_H 00013 00014 #include <sys/types.h> /* for caddr_t */ 00015 00024 int s_read_int(char *str); 00025 00034 int s_read_octal(char *str); 00035 00044 int s_read_int64(char *str, unsigned long long *out64); 00045 00046 int s_read_size(char *str, size_t * p_size); 00047 00052 int StrToBoolean(char *str); 00053 00070 int snprintmem(char *target, int tgt_size, caddr_t source, int mem_size); 00071 00087 int sscanmem(caddr_t target, int tgt_size, const char *str_source); 00088 00089 /* String parsing functions */ 00090 00091 int find_space(char c); 00092 int find_comma(char c); 00093 int find_colon(char c); 00094 int find_endLine(char c); 00095 int find_slash(char c); 00096 00097 #ifndef HAVE_STRLCAT 00098 extern size_t strlcat(char *dst, const char *src, size_t siz); 00099 #endif 00100 00101 #ifndef HAVE_STRLCPY 00102 extern size_t strlcpy(char *dst, const char *src, size_t siz); 00103 #endif 00104 00105 /* My habit with mutex */ 00106 #define P( _mutex_ ) pthread_mutex_lock( &_mutex_ ) 00107 #define V( _mutex_ ) pthread_mutex_unlock( &_mutex_ ) 00108 00109 #endif