leafnode  1.12.0
About: Leafnode is a store & forward NNTP proxy for small (dialup) sites.
  Fossies Dox: leafnode-1.12.0.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

mastring.h File Reference
#include "version.h"
#include <sys/types.h>
#include <stdio.h>
Include dependency graph for mastring.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  mastr
 

Macros

#define MASTR_OOM_ABORT   1
 
#define mastr_autosize(m)   do { (void)mastr_resizekeep(m, m->len); } while(0)
 
#define mastr_trim(m)   do { mastr_triml(m); mastr_trimr(m); } while(0)
 
#define mastr_str(m)   ((const char *)(m->PRIVATE__dat))
 
#define mastr_modifyable_str(m)   (m->PRIVATE__dat)
 

Typedefs

typedef struct mastr mastr
 

Functions

mastrmastr_new (size_t)
 
mastrmastr_newstr (const char *)
 
int mastr_cpy (mastr *, const char *)
 
int mastr_cat (mastr *, const char *const)
 
int mastr_vcat (mastr *,...)
 
int mastr_resizekeep (mastr *, size_t)
 
int mastr_resizekill (mastr *, size_t)
 
size_t mastr_size (mastr *)
 
void mastr_delete (mastr *)
 
void mastr_clear (mastr *)
 
void mastr_triml (mastr *m)
 
void mastr_trimr (mastr *m)
 
void mastr_chop (mastr *m)
 
size_t mastr_len (mastr *)
 

Macro Definition Documentation

◆ mastr_autosize

#define mastr_autosize (   m)    do { (void)mastr_resizekeep(m, m->len); } while(0)

Definition at line 49 of file mastring.h.

◆ mastr_modifyable_str

#define mastr_modifyable_str (   m)    (m->PRIVATE__dat)

Definition at line 58 of file mastring.h.

◆ MASTR_OOM_ABORT

#define MASTR_OOM_ABORT   1

Definition at line 36 of file mastring.h.

◆ mastr_str

#define mastr_str (   m)    ((const char *)(m->PRIVATE__dat))

Definition at line 57 of file mastring.h.

◆ mastr_trim

#define mastr_trim (   m)    do { mastr_triml(m); mastr_trimr(m); } while(0)

Definition at line 56 of file mastring.h.

Typedef Documentation

◆ mastr

typedef struct mastr mastr

Definition at line 34 of file mastring.h.

Function Documentation

◆ mastr_cat()

int mastr_cat ( mastr m,
const char * const  s 
)

Definition at line 120 of file mastring.c.

References mastr_oom(), and mastr_resizekeep().

◆ mastr_chop()

void mastr_chop ( mastr m)

chop off trailing LF or CRLF

Definition at line 311 of file mastring.c.

References choplast().

◆ mastr_clear()

void mastr_clear ( mastr m)

Definition at line 138 of file mastring.c.

Referenced by cleanmids(), and createmsgiddir().

◆ mastr_cpy()

int mastr_cpy ( mastr m,
const char *  s 
)

Definition at line 102 of file mastring.c.

References mastr_oom(), and mastr_resizekill().

Referenced by fopenpseudoart(), getgroup(), and myscandir().

◆ mastr_delete()

◆ mastr_len()

size_t mastr_len ( mastr m)

return length of buffer

Definition at line 328 of file mastring.c.

Referenced by chdirgroup().

◆ mastr_new()

◆ mastr_newstr()

mastr * mastr_newstr ( const char *  s)

Definition at line 86 of file mastring.c.

References mastr_new().

◆ mastr_resizekeep()

int mastr_resizekeep ( mastr m,
size_t  l 
)

Definition at line 202 of file mastring.c.

References len, and mastr_oom().

Referenced by mastr_cat(), and mastr_vcat().

◆ mastr_resizekill()

int mastr_resizekill ( mastr m,
size_t  l 
)

Definition at line 182 of file mastring.c.

References mastr_oom().

Referenced by checkpeerlocal(), and mastr_cpy().

◆ mastr_size()

size_t mastr_size ( mastr m)

return size of buffer

Definition at line 321 of file mastring.c.

Referenced by checkpeerlocal().

◆ mastr_triml()

void mastr_triml ( mastr m)

Definition at line 232 of file mastring.c.

◆ mastr_trimr()

void mastr_trimr ( mastr m)

Definition at line 249 of file mastring.c.

◆ mastr_vcat()

int mastr_vcat ( mastr m,
  ... 
)