Back to index

tetex-bin  3.0
Functions
str-list.c File Reference
#include <kpathsea/config.h>
#include <kpathsea/str-list.h>

Go to the source code of this file.

Functions

str_list_type str_list_init P1H (void)
void str_list_add P2C (str_list_type *, l, string, s)
void str_list_concat P2C (str_list_type *, target, str_list_type, more)
void str_list_free P1C (str_list_type *, l)

Function Documentation

void str_list_free P1C ( str_list_type ,
 
)

Definition at line 110 of file str-list.c.

{
  if (STR_LIST (*l))
    {
      free (STR_LIST (*l));
      STR_LIST (*l) = NULL;
    }
}

Here is the call graph for this function:

str_list_type str_list_init P1H ( void  ) [read]

Definition at line 28 of file str-list.c.

{
  str_list_type ret;
  
  STR_LIST_LENGTH (ret) = 0;
  STR_LIST (ret) = NULL;
  
  return ret;
}
void str_list_add P2C ( str_list_type ,
,
string  ,
s   
)

Definition at line 40 of file str-list.c.

{
  STR_LIST_LENGTH (*l)++;
  XRETALLOC (STR_LIST (*l), STR_LIST_LENGTH (*l), string);
  STR_LIST_LAST_ELT (*l) = s;
}
void str_list_concat_elements P2C ( str_list_type ,
target  ,
str_list_type  ,
more   
)

Definition at line 52 of file str-list.c.

{
  unsigned e;
  unsigned prev_len = STR_LIST_LENGTH (*target);

  STR_LIST_LENGTH (*target) += STR_LIST_LENGTH (more);
  XRETALLOC (STR_LIST (*target), STR_LIST_LENGTH (*target), string);
  
  for (e = 0; e < STR_LIST_LENGTH (more); e++)
    STR_LIST_ELT (*target, prev_len + e) = STR_LIST_ELT (more, e);
}