Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
vstring.c File Reference
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "vstring.h"
#include "errors.h"
Include dependency graph for vstring.c:

Go to the source code of this file.

Defines

#define USE_STANDARD_TYPES
#define MAX(a, b)   ((a>=b)?a:b)
#define vstr_max(v)   ((v).max+0)
#define set_vstr_max(v, m)   (v).max = m
#define set_vstr_len(v, l)   (v).len = l
#define set_vstr_str(v, s)   (v).str = s

Functions

static void Realloc_Vstring (vstring *v, int newlen)
vstring vstr_begin (int len)
void vstr_end (vstring v)
vstring vstr_append (vstring v, const char c)
vstring vstr_concat (vstring v, const char *s)
int vstr_sprintf (vstring *v, int index, const char *format,...)

Variables

static vstring current_vstring = {0,0,NULL}

Define Documentation

#define MAX (   a,
 
)    ((a>=b)?a:b)

Definition at line 47 of file vstring.c.

Referenced by Realloc_Vstring().

#define set_vstr_len (   v,
 
)    (v).len = l

Definition at line 51 of file vstring.c.

Referenced by vstr_begin(), vstr_concat(), vstr_end(), and vstr_sprintf().

#define set_vstr_max (   v,
 
)    (v).max = m

Definition at line 50 of file vstring.c.

Referenced by Realloc_Vstring(), and vstr_begin().

#define set_vstr_str (   v,
  s 
)    (v).str = s

Definition at line 52 of file vstring.c.

Referenced by Realloc_Vstring(), and vstr_begin().

Definition at line 39 of file vstring.c.

#define vstr_max (   v)    ((v).max+0)

Definition at line 49 of file vstring.c.

Referenced by Realloc_Vstring(), vstr_append(), vstr_begin(), vstr_concat(), and vstr_sprintf().


Function Documentation

static void Realloc_Vstring ( vstring v,
int  newlen 
) [static]

Definition at line 57 of file vstring.c.

References MAX, set_vstr_max, set_vstr_str, vstr_max, and vstr_str.

Referenced by vstr_append(), vstr_begin(), vstr_concat(), and vstr_sprintf().

vstring vstr_append ( vstring  v,
const char  c 
)

Definition at line 102 of file vstring.c.

References c, vstring::len, Realloc_Vstring(), vstring::str, vstr_len, and vstr_max.

Here is the call graph for this function:

vstring vstr_begin ( int  len)

Definition at line 75 of file vstring.c.

References current_vstring, DevWarn(), Realloc_Vstring(), set_vstr_len, set_vstr_max, set_vstr_str, vstr_len, and vstr_max.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

Here is the call graph for this function:

vstring vstr_concat ( vstring  v,
const char *  s 
)

Definition at line 114 of file vstring.c.

References Realloc_Vstring(), set_vstr_len, strcpy, vstr_len, vstr_max, and vstr_str.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

Here is the call graph for this function:

void vstr_end ( vstring  v)

Definition at line 93 of file vstring.c.

References set_vstr_len, and vstring::str.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

int vstr_sprintf ( vstring v,
int  index,
const char *  format,
  ... 
)

Definition at line 132 of file vstring.c.

References Fatal_Error(), len, Realloc_Vstring(), set_vstr_len, vstring::str, vstr_len, and vstr_max.

Referenced by ErrMsg_Report_Nonuser(), and ErrMsg_Report_User().

Here is the call graph for this function:


Variable Documentation

vstring current_vstring = {0,0,NULL} [static]

Definition at line 54 of file vstring.c.

Referenced by vstr_begin().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines