1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
/*
* Ostatnia aktualizacja:
*
* - $Id: str.h,v 1.4 2002/12/14 19:36:11 mati Exp $
*
*/
#include "pool.h"
char *j_strdup (const char *str); /* provides NULL safe strdup wrapper */
char *j_strcat (char *dest, char *txt); /* strcpy() clone */
int j_strcmp (const char *a, const char *b); /* provides NULL safe strcmp wrapper */
int j_strcasecmp (const char *a, const char *b); /* provides NULL safe strcasecmp wrapper */
int j_strncmp (const char *a, const char *b, int i); /* provides NULL safe strncmp wrapper */
int j_strncasecmp (const char *a, const char *b, int i); /* provides NULL safe strncasecmp wrapper */
int j_strlen (const char *a); /* provides NULL safe strlen wrapper */
int j_atoi (const char *a, int def); /* checks for NULL and uses default instead, convienence */
void str_b64decode (char *str); /* what it says */
char *strescape (pool p, const char *buf); /* Escape <>&'" chars */
char *strunescape (pool p, const char *buf);
struct spool_node
{
char *c;
struct spool_node *next;
};
typedef struct spool_struct
{
pool p;
int len;
struct spool_node *last;
struct spool_node *first;
}
*spool;
spool spool_new (pool p); /* create a string pool */
void spooler (spool s, ...); /* append all the char * args to the pool, terminate args with s again */
char *spool_print (spool s); /* return a big string */
void spool_add (spool s, const char *str); /* add a single char to the pool */
char *spools (pool p, ...); /* wrap all the spooler stuff in one function, the happy fun ball! */
|