Changeset 183 for trunk/include
- Timestamp:
- Oct 26, 2008, 12:59:48 PM (16 years ago)
- Location:
- trunk/include
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/sh_cat.h
r170 r183 157 157 #ifdef SH_USE_USERFILES 158 158 MSG_USERFILES_SUMMARY, 159 #endif 160 161 #ifdef USE_LOGFILE_MONITOR 162 MSG_LOGMON_CHKS, 163 MSG_LOGMON_CHKE, 164 MSG_LOGMON_MISS, 165 MSG_LOGMON_EOPEN, 166 MSG_LOGMON_EREAD, 167 MSG_LOGMON_REP, 168 MSG_LOGMON_SUM, 159 169 #endif 160 170 -
trunk/include/sh_string.h
r169 r183 19 19 /* concat string to sh_string 20 20 */ 21 sh_string * sh_string_cat_lchar(sh_string * s, char * str, size_t len); 21 sh_string * sh_string_cat_lchar(sh_string * s, const char * str, size_t len); 22 23 /* add char array to end of string */ 24 sh_string * sh_string_add_from_char(sh_string * s, const char * str); 22 25 23 26 /* set sh_string from string 24 27 */ 25 sh_string * sh_string_set_from_char(sh_string * s, c har * str);28 sh_string * sh_string_set_from_char(sh_string * s, const char * str); 26 29 27 30 /* create new sh_string from array of given length 28 31 */ 29 sh_string * sh_string_new_from_lchar(c har * str, size_t len);32 sh_string * sh_string_new_from_lchar(const char * str, size_t len); 30 33 31 #define sh_string_copy(a) ((a) ? sh_string_new_from_lchar(((a)->str), ((a)->len)) : NULL) 34 #define sh_string_copy(a) ((a) ? sh_string_new_from_lchar(((a)->str), ((a)->len)) : NULL) 35 #define sh_string_add(a,b) ((a && b) ? sh_string_add_from_lchar((a), ((b)->str), ((b)->len)) : NULL) 32 36 33 37 /* create new sh_string from three arrays of given length 34 38 */ 35 sh_string * sh_string_new_from_lchar3(c har * str1, size_t len1,36 c har * str2, size_t len2,37 c har * str3, size_t len3);39 sh_string * sh_string_new_from_lchar3(const char * str1, size_t len1, 40 const char * str2, size_t len2, 41 const char * str3, size_t len3); 38 42 39 43 /* Truncate to desired length. … … 45 49 sh_string * sh_string_grow(sh_string * s, size_t increase); 46 50 51 /* Read a string from a file, with maxlen. Return 0 on EOF, 52 * -1 on error, and -2 if a line exceeds maxlen. 53 */ 54 size_t sh_string_read(sh_string * s, FILE * fp, size_t maxlen); 55 56 /* Split array at delim in at most nfields fields. 57 * Empty fields are returned as empty (zero-length) strings. 58 * Leading and trailing WS are removed from token. 59 * The number of fields is returned in 'nfields', their 60 * lengths in 'lengths'. 61 * A single delimiter will return two empty fields. 62 */ 63 char ** split_array(char *line, unsigned int * nfields, 64 char delim, size_t * lengths); 65 66 /* Split array at whitespace in at most nfields fields. 67 * Multiple whitespaces are collapsed. 68 * Empty fields are returned as empty (zero-length) strings. 69 * The number of fields is returned in nfields. 70 * An empty string will return zero fields. 71 * If nfields < actual fields, last string will be remainder. 72 */ 73 char ** split_array_ws(char *line, unsigned int * nfields, size_t * lengths); 74 75 /* Replaces fields in s with 'replacement'. Fields are given 76 * in the ordered array ovector, comprising ovecnum pairs 77 * ovector[i], ovector[i+1] which list offset of first char 78 * of field, offset of first char after field (this is how 79 * the pcre library does it). 80 */ 81 sh_string * sh_string_replace(const sh_string * s, 82 const int * ovector, int ovecnum, 83 const char * replacement, size_t rlen); 84 47 85 #endif -
trunk/include/sh_unix.h
r174 r183 243 243 /* check a file 244 244 */ 245 int tf_trust_check (c har * file, int mode);245 int tf_trust_check (const char * file, int mode); 246 246 247 247 /* initialize group vector -
trunk/include/slib.h
r174 r183 405 405 /* Check whether file is trustworthy. 406 406 */ 407 int sl_trustfile(c har * path, uid_t * ok, uid_t * bad);407 int sl_trustfile(const char * path, uid_t * ok, uid_t * bad); 408 408 409 409 /* Check whether file is trustworthy. 410 410 */ 411 int sl_trustfile_euid(c har * filename, uid_t euid);411 int sl_trustfile_euid(const char * filename, uid_t euid); 412 412 413 413 /* purge list of trusted users
Note:
See TracChangeset
for help on using the changeset viewer.