Changeset 183 for trunk/include


Ignore:
Timestamp:
Oct 26, 2008, 12:59:48 PM (16 years ago)
Author:
katerina
Message:

Support for logfile monitoring (ticket #122). Also improved some configure error messages.

Location:
trunk/include
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/sh_cat.h

    r170 r183  
    157157#ifdef SH_USE_USERFILES
    158158 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,
    159169#endif
    160170
  • trunk/include/sh_string.h

    r169 r183  
    1919/* concat string to sh_string
    2020 */
    21 sh_string * sh_string_cat_lchar(sh_string * s, char * str, size_t len);
     21sh_string * sh_string_cat_lchar(sh_string * s, const char * str, size_t len);
     22
     23/* add char array to end of string */
     24sh_string * sh_string_add_from_char(sh_string * s, const char * str);
    2225
    2326/* set sh_string from string
    2427 */
    25 sh_string * sh_string_set_from_char(sh_string * s, char * str);
     28sh_string * sh_string_set_from_char(sh_string * s, const char * str);
    2629
    2730/* create new sh_string from array of given length
    2831 */
    29 sh_string * sh_string_new_from_lchar(char * str, size_t len);
     32sh_string * sh_string_new_from_lchar(const char * str, size_t len);
    3033
    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)
    3236
    3337/* create new sh_string from three arrays of given length
    3438 */
    35 sh_string * sh_string_new_from_lchar3(char * str1, size_t len1,
    36                                       char * str2, size_t len2,
    37                                       char * str3, size_t len3);
     39sh_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);
    3842
    3943/* Truncate to desired length.
     
    4549sh_string * sh_string_grow(sh_string * s, size_t increase);
    4650
     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 */
     54size_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 */
     63char ** 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 */
     73char ** 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 */ 
     81sh_string * sh_string_replace(const sh_string * s,
     82                              const int * ovector, int ovecnum,
     83                              const char * replacement, size_t rlen);
     84
    4785#endif
  • trunk/include/sh_unix.h

    r174 r183  
    243243/* check a file
    244244 */
    245 int tf_trust_check (char * file, int mode);
     245int tf_trust_check (const char * file, int mode);
    246246
    247247/* initialize group vector
  • trunk/include/slib.h

    r174 r183  
    405405  /* Check whether file is trustworthy.
    406406   */
    407   int sl_trustfile(char * path, uid_t * ok, uid_t * bad);
     407  int sl_trustfile(const char * path, uid_t * ok, uid_t * bad);
    408408
    409409  /* Check whether file is trustworthy.
    410410   */
    411   int sl_trustfile_euid(char * filename, uid_t euid);
     411  int sl_trustfile_euid(const char * filename, uid_t euid);
    412412
    413413  /* purge list of trusted users
Note: See TracChangeset for help on using the changeset viewer.