kmp_str.c File Reference

#include "kmp_str.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include "kmp.h"
#include "kmp_i18n.h"

Go to the source code of this file.

Defines

#define _case(ch, exp)
#define args   _args
#define KMP_STR_BUF_INVARIANT(b)

Functions

void __kmp_str_buf_cat (kmp_str_buf_t *buffer, char const *str, int len)
void __kmp_str_buf_clear (kmp_str_buf_t *buffer)
void __kmp_str_buf_detach (kmp_str_buf_t *buffer)
void __kmp_str_buf_free (kmp_str_buf_t *buffer)
void __kmp_str_buf_print (kmp_str_buf_t *buffer, char const *format,...)
void __kmp_str_buf_print_size (kmp_str_buf_t *buf, size_t size)
void __kmp_str_buf_reserve (kmp_str_buf_t *buffer, int size)
void __kmp_str_buf_vprint (kmp_str_buf_t *buffer, char const *format, va_list args)
int __kmp_str_eqf (char const *lhs, char const *rhs)
void __kmp_str_fname_free (kmp_str_fname_t *fname)
void __kmp_str_fname_init (kmp_str_fname_t *fname, char const *path)
int __kmp_str_fname_match (kmp_str_fname_t const *fname, char const *pattern)
char * __kmp_str_format (char const *format,...)
void __kmp_str_free (char const **str)
void __kmp_str_loc_free (kmp_str_loc_t *loc)
kmp_str_loc_t __kmp_str_loc_init (char const *psource, int init_fname)
int __kmp_str_match (char const *target, int len, char const *data)
int __kmp_str_match_false (char const *data)
int __kmp_str_match_true (char const *data)
void __kmp_str_replace (char *str, char search_for, char replace_with)
void __kmp_str_split (char *str, char delim, char **head, char **tail)
int __kmp_str_to_int (char const *str, char sentinel)
void __kmp_str_to_size (char const *str, size_t *out, size_t dfactor, char const **error)
void __kmp_str_to_uint (char const *str, kmp_uint64 *out, char const **error)
char * __kmp_str_token (char *str, char const *delim, char **buf)

Define Documentation

#define _case ( ch,
exp   ) 
Value:
case ch :                                       \
        case ch - ( 'a' - 'A' ) : {                     \
            size_t shift = (exp) * 10;                  \
            ++ i;                                       \
            if ( shift < sizeof( size_t ) * 8 ) {       \
                factor = (size_t)( 1 ) << shift;        \
            } else {                                    \
                overflow = 1;                           \
            };                                          \
        } break;

Referenced by __kmp_str_to_size().

#define args   _args
#define KMP_STR_BUF_INVARIANT (  ) 
Value:
{                                                                                             \
        KMP_DEBUG_ASSERT( (b)->str != NULL );                                                     \
        KMP_DEBUG_ASSERT( (b)->size >= sizeof( (b)->bulk ) );                                     \
        KMP_DEBUG_ASSERT( (b)->size % sizeof( (b)->bulk ) == 0 );                                 \
        KMP_DEBUG_ASSERT( (b)->used < (b)->size );                                                \
        KMP_DEBUG_ASSERT( (b)->size == sizeof( (b)->bulk ) ? (b)->str == & (b)->bulk[ 0 ] : 1 );  \
        KMP_DEBUG_ASSERT( (b)->size > sizeof( (b)->bulk ) ? (b)->str != & (b)->bulk[ 0 ] : 1 );   \
    }

Definition at line 101 of file kmp_str.c.

Referenced by __kmp_str_buf_cat(), __kmp_str_buf_clear(), __kmp_str_buf_detach(), __kmp_str_buf_free(), __kmp_str_buf_reserve(), and __kmp_str_buf_vprint().


Function Documentation

void __kmp_str_buf_cat ( kmp_str_buf_t buffer,
char const *  str,
int  len 
)
void __kmp_str_buf_clear ( kmp_str_buf_t buffer  ) 

Definition at line 112 of file kmp_str.c.

References KMP_STR_BUF_INVARIANT, kmp_str_buf::str, and kmp_str_buf::used.

Referenced by __kmp_vprintf().

void __kmp_str_buf_detach ( kmp_str_buf_t buffer  ) 
void __kmp_str_buf_free ( kmp_str_buf_t buffer  ) 
void __kmp_str_buf_print ( kmp_str_buf_t buffer,
char const *  format,
  ... 
)
void __kmp_str_buf_print_size ( kmp_str_buf_t buf,
size_t  size 
)
void __kmp_str_buf_reserve ( kmp_str_buf_t buffer,
int  size 
)
void __kmp_str_buf_vprint ( kmp_str_buf_t buffer,
char const *  format,
va_list  args 
)
int __kmp_str_eqf ( char const *  lhs,
char const *  rhs 
)

Definition at line 471 of file kmp_str.c.

Referenced by __kmp_stg_parse_file(), and __kmp_str_fname_match().

void __kmp_str_fname_free ( kmp_str_fname_t fname  ) 
void __kmp_str_fname_init ( kmp_str_fname_t fname,
char const *  path 
)
int __kmp_str_fname_match ( kmp_str_fname_t const *  fname,
char const *  pattern 
)
char* __kmp_str_format ( char const *  format,
  ... 
)
void __kmp_str_free ( char const **  str  ) 
void __kmp_str_loc_free ( kmp_str_loc_t loc  ) 
kmp_str_loc_t __kmp_str_loc_init ( char const *  psource,
int  init_fname 
)
int __kmp_str_match ( char const *  target,
int  len,
char const *  data 
)
int __kmp_str_match_false ( char const *  data  ) 

Definition at line 601 of file kmp_str.c.

References __kmp_str_match().

Referenced by __kmp_ignore_mppbeg(), __kmp_ignore_mppend(), and __kmp_stg_parse_bool().

int __kmp_str_match_true ( char const *  data  ) 
void __kmp_str_replace ( char *  str,
char  search_for,
char  replace_with 
)

Definition at line 626 of file kmp_str.c.

Referenced by __kmp_str_fname_init().

void __kmp_str_split ( char *  str,
char  delim,
char **  head,
char **  tail 
)
int __kmp_str_to_int ( char const *  str,
char  sentinel 
)
void __kmp_str_to_size ( char const *  str,
size_t *  out,
size_t  dfactor,
char const **  error 
)

Definition at line 757 of file kmp_str.c.

References _case, i, KMP_DEBUG_ASSERT, KMP_I18N_STR, and KMP_SIZE_T_MAX.

Referenced by __kmp_stg_parse_size().

void __kmp_str_to_uint ( char const *  str,
kmp_uint64 *  out,
char const **  error 
)

Definition at line 862 of file kmp_str.c.

References i, KMP_DEBUG_ASSERT, KMP_I18N_STR, and KMP_SIZE_T_MAX.

Referenced by __kmp_stg_parse_int().

char* __kmp_str_token ( char *  str,
char const *  delim,
char **  buf 
)

Definition at line 671 of file kmp_str.c.

Referenced by ___kmp_env_blk_parse_string().


Generated on 25 Aug 2013 for libomp_oss by  doxygen 1.6.1