Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions
ec.h File Reference
#include "cord.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CORD_ec_struct

Defines

#define CORD_BUFSZ   128
#define CORD_ec_to_cord(x)   (CORD_ec_flush_buf(x), (x)[0].ec_cord)
#define CORD_ec_init(x)   ((x)[0].ec_cord = 0, (x)[0].ec_bufptr = (x)[0].ec_buf)
#define CORD_ec_append(x, c)

Typedefs

typedef struct CORD_ec_struct CORD_ec [1]

Functions

void CORD_ec_flush_buf (CORD_ec x)
void CORD_ec_append_cord (CORD_ec x, CORD s)

Class Documentation

struct CORD_ec_struct

Definition at line 37 of file ec.h.

Class Members
char ec_buf
char * ec_bufptr
CORD ec_cord

Define Documentation

#define CORD_BUFSZ   128

Definition at line 34 of file ec.h.

#define CORD_ec_append (   x,
  c 
)
Value:
{  \
       if ((x)[0].ec_bufptr == (x)[0].ec_buf + CORD_BUFSZ) { \
              CORD_ec_flush_buf(x); \
       } \
       *((x)[0].ec_bufptr)++ = (c); \
    }

Definition at line 58 of file ec.h.

#define CORD_ec_init (   x)    ((x)[0].ec_cord = 0, (x)[0].ec_bufptr = (x)[0].ec_buf)

Definition at line 55 of file ec.h.

#define CORD_ec_to_cord (   x)    (CORD_ec_flush_buf(x), (x)[0].ec_cord)

Definition at line 52 of file ec.h.


Typedef Documentation

typedef struct CORD_ec_struct CORD_ec[1]

Function Documentation

Definition at line 423 of file cordxtra.c.

{
    CORD_ec_flush_buf(x);
    x[0].ec_cord = CORD_cat(x[0].ec_cord, s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 410 of file cordxtra.c.

{
    register size_t len = x[0].ec_bufptr - x[0].ec_buf;
    char * s;

    if (len == 0) return;
    s = GC_MALLOC_ATOMIC(len+1);
    memcpy(s, x[0].ec_buf, len);
    s[len] = '\0';
    x[0].ec_cord = CORD_cat_char_star(x[0].ec_cord, s, len);
    x[0].ec_bufptr = x[0].ec_buf;
}

Here is the call graph for this function:

Here is the caller graph for this function: