]>
git.ipfire.org Git - thirdparty/bird.git/blob - lib/string.h
2 * BIRD Library -- String Functions
4 * (c) 1998 Martin Mares <mj@ucw.cz>
6 * Can be freely distributed and used under the terms of the GNU GPL.
9 #ifndef _BIRD_STRING_H_
10 #define _BIRD_STRING_H_
16 int bsprintf(char *str
, const char *fmt
, ...);
17 int bvsprintf(char *str
, const char *fmt
, va_list args
);
18 int bsnprintf(char *str
, int size
, const char *fmt
, ...);
19 int bvsnprintf(char *str
, int size
, const char *fmt
, va_list args
);
21 int buffer_vprint(buffer
*buf
, const char *fmt
, va_list args
);
22 int buffer_print(buffer
*buf
, const char *fmt
, ...);
23 void buffer_puts(buffer
*buf
, const char *str
);
25 int patmatch(const byte
*pat
, const byte
*str
);
27 static inline char *xbasename(const char *str
)
29 char *s
= strrchr(str
, '/');
30 return s
? s
+1 : (char *) str
;
34 xstrdup(const char *c
)
36 size_t l
= strlen(c
) + 1;
43 memset32(void *D
, u32 val
, uint n
)
48 for (i
= 0; i
< n
; i
++)
52 #define ROUTER_ID_64_LENGTH 23