Back to index

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

Go to the source code of this file.

Classes

struct  CORD_pe
struct  CORD_Pos

Defines

#define MAX_DEPTH   48
#define CORD_POS_INVALID   (0x55555555)
#define FUNCTION_BUF_SZ   8
#define CORD_pos_fetch(p)
#define CORD_next(p)
#define CORD_prev(p)
#define CORD_pos_to_index(p)   ((p)[0].cur_pos)
#define CORD_pos_to_cord(p)   ((p)[0].path[0].pe_cord)
#define CORD_pos_valid(p)   ((p)[0].path_len != CORD_POS_INVALID)
#define CORD_pos_chars_left(p)   ((long)((p)[0].cur_end) - (long)((p)[0].cur_pos))
#define CORD_pos_advance(p, n)   ((p)[0].cur_pos += (n) - 1, CORD_next(p))
#define CORD_pos_cur_char_addr(p)   (p)[0].cur_leaf + ((p)[0].cur_pos - (p)[0].cur_start)

Typedefs

typedef struct CORD_Pos CORD_pos [1]

Functions

CORD CORD_pos_to_cord (CORD_pos p)
size_t CORD_pos_to_index (CORD_pos p)
char CORD_pos_fetch (CORD_pos p)
void CORD_set_pos (CORD_pos p, CORD x, size_t i)
void CORD_next (CORD_pos p)
void CORD_prev (CORD_pos p)
int CORD_pos_valid (CORD_pos p)
char CORD__pos_fetch (CORD_pos)
void CORD__next (CORD_pos)
void CORD__prev (CORD_pos)

Class Documentation

struct CORD_pe

Definition at line 25 of file cord_pos.h.

Class Members
CORD pe_cord
size_t pe_start_pos
struct CORD_Pos

Definition at line 32 of file cord_pos.h.

Collaboration diagram for CORD_Pos:
Class Members
size_t cur_end
const char * cur_leaf
size_t cur_pos
size_t cur_start
char function_buf
int path_len

Define Documentation

#define CORD_next (   p)
Value:
(((p)[0].cur_pos + 1 < (p)[0].cur_end)? \
       (p)[0].cur_pos++ \
       : (CORD__next(p), 0))

Definition at line 90 of file cord_pos.h.

#define CORD_pos_advance (   p,
  n 
)    ((p)[0].cur_pos += (n) - 1, CORD_next(p))

Definition at line 110 of file cord_pos.h.

#define CORD_pos_chars_left (   p)    ((long)((p)[0].cur_end) - (long)((p)[0].cur_pos))

Definition at line 107 of file cord_pos.h.

#define CORD_pos_cur_char_addr (   p)    (p)[0].cur_leaf + ((p)[0].cur_pos - (p)[0].cur_start)

Definition at line 114 of file cord_pos.h.

Value:
(((p)[0].cur_end != 0)? \
       (p)[0].cur_leaf[(p)[0].cur_pos - (p)[0].cur_start] \
       : CORD__pos_fetch(p))

Definition at line 85 of file cord_pos.h.

#define CORD_POS_INVALID   (0x55555555)

Definition at line 35 of file cord_pos.h.

#define CORD_pos_to_cord (   p)    ((p)[0].path[0].pe_cord)

Definition at line 102 of file cord_pos.h.

#define CORD_pos_to_index (   p)    ((p)[0].cur_pos)

Definition at line 100 of file cord_pos.h.

#define CORD_pos_valid (   p)    ((p)[0].path_len != CORD_POS_INVALID)

Definition at line 104 of file cord_pos.h.

#define CORD_prev (   p)
Value:
(((p)[0].cur_end != 0 && (p)[0].cur_pos > (p)[0].cur_start)? \
       (p)[0].cur_pos-- \
       : (CORD__prev(p), 0))

Definition at line 95 of file cord_pos.h.

Definition at line 50 of file cord_pos.h.

#define MAX_DEPTH   48

Definition at line 21 of file cord_pos.h.


Typedef Documentation

typedef struct CORD_Pos CORD_pos[1]

Function Documentation

Definition at line 871 of file cordbscs.c.

{
    if (p[0].cur_pos < p[0].cur_end - 1) {
       p[0].cur_pos++;
    } else {
       CORD__next(p);
    }
}

Here is the call graph for this function:

char CORD_pos_fetch ( CORD_pos  p)

Definition at line 894 of file cordbscs.c.

{
    return(p[0].path[0].pe_cord);
}
size_t CORD_pos_to_index ( CORD_pos  p)

Definition at line 889 of file cordbscs.c.

{
    return(p[0].cur_pos);
}

Definition at line 899 of file cordbscs.c.

{
    return(p[0].path_len != CORD_POS_INVALID);
}

Definition at line 880 of file cordbscs.c.

{
    if (p[0].cur_end != 0 && p[0].cur_pos > p[0].cur_start) {
       p[0].cur_pos--;
    } else {
       CORD__prev(p);
    }
}

Here is the call graph for this function:

void CORD_set_pos ( CORD_pos  p,
CORD  x,
size_t  i 
)

Definition at line 904 of file cordbscs.c.

{
    if (x == CORD_EMPTY) {
       p[0].path_len = CORD_POS_INVALID;
       return;
    }
    p[0].path[0].pe_cord = x;
    p[0].path[0].pe_start_pos = 0;
    p[0].path_len = 0;
    p[0].cur_pos = i;
    CORD__extend_path(p);
}

Here is the call graph for this function:

Here is the caller graph for this function: