Back to index

cell-binutils  2.17cvs20070401
Classes | Defines | Typedefs | Functions
sb.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sb
struct  le

Defines

#define sb_max_power_two

Typedefs

typedef struct sb sb
typedef struct le sb_element

Functions

void sb_new (sb *)
void sb_kill (sb *)
void sb_add_sb (sb *, sb *)
void sb_scrub_and_add_sb (sb *, sb *)
void sb_reset (sb *)
void sb_add_char (sb *, int)
void sb_add_string (sb *, const char *)
void sb_add_buffer (sb *, const char *, int)
char * sb_terminate (sb *)
int sb_skip_white (int, sb *)
int sb_skip_comma (int, sb *)
void input_scrub_include_sb (sb *, char *, int)

Class Documentation

struct sb

Definition at line 50 of file sb.h.

Collaboration diagram for sb:
Class Members
struct le * item
int len
int pot
char * ptr
struct le

Definition at line 61 of file sb.h.

Collaboration diagram for le:
Class Members
char data
struct le * next
int size

Define Documentation

Value:
30     /* Don't allow strings more than
                                2^sb_max_power_two long.  */

Definition at line 48 of file sb.h.


Typedef Documentation

typedef struct sb sb
typedef struct le sb_element

Function Documentation

void input_scrub_include_sb ( sb ,
char *  ,
int   
)

Definition at line 263 of file input-scrub.c.

{
  if (macro_nest > max_macro_nest)
    as_fatal (_("macros nested too deeply"));
  ++macro_nest;

#ifdef md_macro_start
  if (is_expansion)
    {
      md_macro_start ();
    }
#endif

  next_saved_file = input_scrub_push (position);

  sb_new (&from_sb);
  from_sb_is_expansion = is_expansion;
  if (from->len >= 1 && from->ptr[0] != '\n')
    {
      /* Add the sentinel required by read.c.  */
      sb_add_char (&from_sb, '\n');
    }
  sb_scrub_and_add_sb (&from_sb, from);
  sb_index = 1;

  /* These variables are reset by input_scrub_push.  Restore them
     since we are, after all, still at the same point in the file.  */
  logical_input_line = next_saved_file->logical_input_line;
  logical_input_file = next_saved_file->logical_input_file;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_add_buffer ( sb ,
const char *  ,
int   
)

Definition at line 193 of file sb.c.

{
  sb_check (ptr, len);
  memcpy (ptr->ptr + ptr->len, s, len);
  ptr->len += len;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_add_char ( sb ,
int   
)

Definition at line 173 of file sb.c.

{
  sb_check (ptr, 1);
  ptr->ptr[ptr->len++] = c;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_add_sb ( sb ,
sb  
)

Definition at line 103 of file sb.c.

{
  sb_check (ptr, s->len);
  memcpy (ptr->ptr + ptr->len, s->ptr, s->len);
  ptr->len += s->len;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_add_string ( sb ,
const char *   
)

Definition at line 182 of file sb.c.

{
  int len = strlen (s);
  sb_check (ptr, len);
  memcpy (ptr->ptr + ptr->len, s, len);
  ptr->len += len;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_kill ( sb )

Definition at line 93 of file sb.c.

{
  /* Return item to free list.  */
  ptr->item->next = free_list.size[ptr->pot];
  free_list.size[ptr->pot] = ptr->item;
}

Here is the caller graph for this function:

void sb_new ( sb )

Definition at line 85 of file sb.c.

{
  sb_build (ptr, dsize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void sb_reset ( sb )

Definition at line 165 of file sb.c.

{
  ptr->len = 0;
}

Here is the caller graph for this function:

void sb_scrub_and_add_sb ( sb ,
sb  
)

Definition at line 130 of file sb.c.

{
  sb_to_scrub = s;
  scrub_position = s->ptr;
  
  sb_check (ptr, s->len);
  ptr->len += do_scrub_chars (scrub_from_sb, ptr->ptr + ptr->len, s->len);

  sb_to_scrub = 0;
  scrub_position = 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int sb_skip_comma ( int  ,
sb  
)

Definition at line 228 of file sb.c.

{
  while (idx < ptr->len
        && (ptr->ptr[idx] == ' '
            || ptr->ptr[idx] == '\t'))
    idx++;

  if (idx < ptr->len
      && ptr->ptr[idx] == ',')
    idx++;

  while (idx < ptr->len
        && (ptr->ptr[idx] == ' '
            || ptr->ptr[idx] == '\t'))
    idx++;

  return idx;
}

Here is the caller graph for this function:

int sb_skip_white ( int  ,
sb  
)

Definition at line 214 of file sb.c.

{
  while (idx < ptr->len
        && (ptr->ptr[idx] == ' '
            || ptr->ptr[idx] == '\t'))
    idx++;
  return idx;
}

Here is the caller graph for this function:

char* sb_terminate ( sb )

Definition at line 203 of file sb.c.

{
  sb_add_char (in, 0);
  --in->len;
  return in->ptr;
}

Here is the call graph for this function:

Here is the caller graph for this function: