Changeset 76 for trunk/include


Ignore:
Timestamp:
Dec 19, 2006, 10:01:59 PM (18 years ago)
Author:
rainer
Message:

Fix for ticket #38 (csv escaping) and #39 (building on cygwin). Also optimize a bit.

Location:
trunk/include
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/samhain.h

    r68 r76  
    301301 **************************************************/
    302302
     303#if defined(__GNUC__) && (__GNUC__ >= 4)
     304#define SH_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
     305#else
     306#define SH_GNUC_NULL_TERMINATED
     307#endif
     308
     309/* The semantics of the built-in are that it is expected that expr == const
     310 * for __builtin_expect ((expr), const)
     311 */
     312#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
     313#define SH_LIKELY(expr)   (__builtin_expect((expr), 1))
     314#define SH_UNLIKELY(expr) (__builtin_expect((expr), 0))
     315#else
     316#define SH_LIKELY(expr) (expr)
     317#define SH_UNLIKELY(expr) (expr)
     318#endif
     319
    303320/* signal-safe log function
    304321 */
  • trunk/include/sh_utils.h

    r68 r76  
    6161
    6262char * sh_util_strdup (const char * str);
     63char * sh_util_strdup_l (const char * str, size_t len);
    6364char * sh_util_strsep (char **str, const char *delim);
    6465
     
    143144 * Arhument list must be NULL terminated.
    144145 */
    145 char * sh_util_strconcat (const char * arg1, ...);
     146char * sh_util_strconcat (const char * arg1, ...) SH_GNUC_NULL_TERMINATED;
    146147
    147148/* check if string is numeric only
  • trunk/include/slib.h

    r34 r76  
    293293   * ---------------------------------------------------------------- */
    294294
    295   SL_TICKET sl_make_ticket (int fd, char * path);
     295  SL_TICKET sl_make_ticket (int fd, const char * path);
    296296
    297297  /* Open for writing.
     
    365365   */
    366366  int sl_write_line (SL_TICKET ticket, void * msg, long nbytes);
     367
     368  /* As above, but only for non-constant strings.
     369   */
     370  int sl_write_line_fast (SL_TICKET ticket, void * msg, long nbytes);
    367371
    368372  /* Drop all metadata for file descriptors >= fd.
     
    414418#define SL_NOPRIV  0x34
    415419
    416 #define MAXFILENAME     2048
     420/* Suitable for Linux
     421 */
     422#define MAXFILENAME     4096
    417423
    418424
Note: See TracChangeset for help on using the changeset viewer.