jabberd2  2.2.16
Functions
util/str.c File Reference
#include "pool.h"
#include "util.h"

Go to the source code of this file.

Functions

char * j_strdup (const char *str)
char * j_strcat (char *dest, char *txt)
int j_strcmp (const char *a, const char *b)
int j_strcasecmp (const char *a, const char *b)
int j_strncmp (const char *a, const char *b, int i)
int j_strncasecmp (const char *a, const char *b, int i)
int j_strlen (const char *a)
int j_atoi (const char *a, int def)
char * j_attr (const char **atts, const char *attr)
char * j_strnchr (const char *s, int c, int n)
 like strchr, but only searches n chars
spool spool_new (pool_t p)
static void _spool_add (spool s, char *goodstr)
void spool_add (spool s, char *str)
void spool_escape (spool s, char *raw, int len)
void spooler (spool s,...)
char * spool_print (spool s)
char * spools (pool_t p,...)
 convenience :)
char * strunescape (pool_t p, char *buf)
char * strescape (pool_t p, char *buf, int len)
void shahash_r (const char *str, char hashbuf[41])
 convenience (originally by Thomas Muldowney)
void shahash_raw (const char *str, unsigned char hashval[20])

Function Documentation

char* j_strdup ( const char *  str)

---------------------------------------------------------

Definition at line 24 of file str.c.

char* j_strcat ( char *  dest,
char *  txt 
)

Definition at line 32 of file str.c.

Referenced by spool_print().

int j_strcmp ( const char *  a,
const char *  b 
)

Definition at line 43 of file str.c.

Referenced by j_attr().

int j_strcasecmp ( const char *  a,
const char *  b 
)

Definition at line 55 of file str.c.

int j_strncmp ( const char *  a,
const char *  b,
int  i 
)

Definition at line 63 of file str.c.

int j_strncasecmp ( const char *  a,
const char *  b,
int  i 
)

Definition at line 71 of file str.c.

int j_strlen ( const char *  a)

Definition at line 79 of file str.c.

int j_atoi ( const char *  a,
int  def 
)
char* j_attr ( const char **  atts,
const char *  attr 
)
char* j_strnchr ( const char *  s,
int  c,
int  n 
)

like strchr, but only searches n chars

Definition at line 109 of file str.c.

spool spool_new ( pool_t  p)

Definition at line 119 of file str.c.

References pmalloc(), spool_struct::p, spool_struct::len, spool_struct::last, and spool_struct::first.

Referenced by spools().

static void _spool_add ( spool  s,
char *  goodstr 
) [static]
void spool_add ( spool  s,
char *  str 
)

Definition at line 147 of file str.c.

References _spool_add(), pstrdup(), and spool_struct::p.

Referenced by spooler(), and spools().

void spool_escape ( spool  s,
char *  raw,
int  len 
)

Definition at line 155 of file str.c.

References _spool_add(), strescape(), and spool_struct::p.

void spooler ( spool  s,
  ... 
)

Definition at line 163 of file str.c.

References spool_add().

char* spool_print ( spool  s)
char* spools ( pool_t  p,
  ... 
)

convenience :)

Definition at line 209 of file str.c.

References spool_new(), spool_add(), and spool_print().

char* strunescape ( pool_t  p,
char *  buf 
)

Definition at line 238 of file str.c.

References pmalloc().

char* strescape ( pool_t  p,
char *  buf,
int  len 
)

Definition at line 285 of file str.c.

References pmalloc().

Referenced by spool_escape().

void shahash_r ( const char *  str,
char  hashbuf[41] 
)

convenience (originally by Thomas Muldowney)

old convenience function, now in str.c

Definition at line 358 of file str.c.

References shahash_raw(), and hex_from_raw().

Referenced by _authreg_auth_set(), _pbx_process_command(), _sm_generate_id(), _router_process_handshake(), s2s_db_key(), and jid_random_part().

void shahash_raw ( const char *  str,
unsigned char  hashval[20] 
)

Definition at line 364 of file str.c.

References sha1_hash().

Referenced by _router_process_route(), and shahash_r().