ARB
Enumerations | Functions
util.cxx File Reference
#include <BufferedFileReader.h>
#include "fun.h"
#include "defs.h"
#include "global.h"
#include "reader.h"
#include <cstdarg>
#include <cerrno>
Include dependency graph for util.cxx:

Go to the source code of this file.

Enumerations

enum  FindMode { FIND_START, FIND_SKIP_OVER }
 

Functions

bool scan_token (char *to, const char *from)
 
void scan_token_or_die (char *to, const char *from)
 
void scan_token_or_die (char *to, Reader &reader, int offset)
 
void throw_error (int error_num, const char *error_message)
 
charstrf (const char *format,...)
 
void throw_errorf (int error_num, const char *error_messagef,...)
 
void warning (int warning_num, const char *warning_message)
 
void warningf (int warning_num, const char *warning_messagef,...)
 
int Skip_white_space (const char *line, int index)
 
void Getstr (char *line, int linenum)
 
void append_known_len (char *&string1, int len1, const char *string2, int len2)
 
void terminate_with (char *&str, char ch)
 
void skip_eolnl_and_append (char *&string1, const char *string2)
 
void skip_eolnl_and_append_spaced (char *&string1, const char *string2)
 
void Append (char *&string1, const char *string2)
 
void Append (char *&string1, char ch)
 
void upcase (char *str)
 
int fputs_len (const char *str, int len, Writer &write)
 
static int findPattern (const char *text, const char *pattern, FindMode mode)
 
static int findMultipattern (const char *str, const char **const &pattern, char expect_behind, FindMode mode)
 
static int findSubspecies (const char *str, char expect_behind, FindMode mode)
 
static int findStrain (const char *str, char expect_behind, FindMode mode)
 
int find_pattern (const char *text, const char *pattern)
 
int skip_pattern (const char *text, const char *pattern)
 
int find_subspecies (const char *str, char expect_behind)
 
int skip_subspecies (const char *str, char expect_behind)
 
int find_strain (const char *str, char expect_behind)
 
int skip_strain (const char *str, char expect_behind)
 
const charstristr (const char *str, const char *substring)
 
int ___lookup_keyword (const char *keyword, const char *const *lookup_table, int lookup_table_size)
 
int parse_key_word (const char *line, char *key, const char *separator)
 

Enumeration Type Documentation

enum FindMode
Enumerator
FIND_START 
FIND_SKIP_OVER 

Definition at line 168 of file util.cxx.

Function Documentation

bool scan_token ( char to,
const char from 
)

Definition at line 10 of file util.cxx.

Referenced by gtoe_journal(), and scan_token_or_die().

void scan_token_or_die ( char to,
const char from 
)
void scan_token_or_die ( char to,
Reader reader,
int  offset 
)

Definition at line 19 of file util.cxx.

References Reader::line(), offset, and scan_token_or_die().

void throw_error ( int  error_num,
const char error_message 
)
char* strf ( const char format,
  ... 
)
void throw_errorf ( int  error_num,
const char error_messagef,
  ... 
)
void warning ( int  warning_num,
const char warning_message 
)
void warningf ( int  warning_num,
const char warning_messagef,
  ... 
)
int Skip_white_space ( const char line,
int  index 
)
void Getstr ( char line,
int  linenum 
)

Definition at line 92 of file util.cxx.

Referenced by ask_for_conversion_params().

void append_known_len ( char *&  string1,
int  len1,
const char string2,
int  len2 
)
inline

Definition at line 102 of file util.cxx.

References ARB_realloc(), and ca_assert.

Referenced by Append(), skip_eolnl_and_append(), skip_eolnl_and_append_spaced(), and terminate_with().

void terminate_with ( char *&  str,
char  ch 
)
void skip_eolnl_and_append ( char *&  string1,
const char string2 
)

Definition at line 127 of file util.cxx.

References append_known_len(), and str0len().

Referenced by genbank_verify_accession(), mtog_genbank_def_and_source(), and partial_mtoe().

void skip_eolnl_and_append_spaced ( char *&  string1,
const char string2 
)
void Append ( char *&  string1,
const char string2 
)
void Append ( char *&  string1,
char  ch 
)

Definition at line 145 of file util.cxx.

References append_known_len(), and str0len().

void upcase ( char str)

Definition at line 149 of file util.cxx.

Referenced by gtoe().

int fputs_len ( const char str,
int  len,
Writer write 
)

Definition at line 155 of file util.cxx.

References Writer::out().

static int findPattern ( const char text,
const char pattern,
FindMode  mode 
)
static

Definition at line 170 of file util.cxx.

References ca_assert, FIND_SKIP_OVER, and FIND_START.

Referenced by find_pattern(), findMultipattern(), and skip_pattern().

static int findMultipattern ( const char str,
const char **const &  pattern,
char  expect_behind,
FindMode  mode 
)
static

Definition at line 195 of file util.cxx.

References ca_assert, FIND_SKIP_OVER, FIND_START, findPattern(), offset, and str0len().

Referenced by findStrain(), and findSubspecies().

static int findSubspecies ( const char str,
char  expect_behind,
FindMode  mode 
)
static

Definition at line 231 of file util.cxx.

References findMultipattern(), and NULp.

Referenced by find_subspecies(), and skip_subspecies().

static int findStrain ( const char str,
char  expect_behind,
FindMode  mode 
)
static

Definition at line 236 of file util.cxx.

References findMultipattern(), and NULp.

Referenced by find_strain(), and skip_strain().

int find_pattern ( const char text,
const char pattern 
)
int skip_pattern ( const char text,
const char pattern 
)

Definition at line 242 of file util.cxx.

References FIND_SKIP_OVER, and findPattern().

Referenced by genbank_get_strain(), genbank_get_subspecies(), and partial_mtoe().

int find_subspecies ( const char str,
char  expect_behind 
)

Definition at line 244 of file util.cxx.

References FIND_START, and findSubspecies().

Referenced by partial_mtoe().

int skip_subspecies ( const char str,
char  expect_behind 
)

Definition at line 245 of file util.cxx.

References FIND_SKIP_OVER, and findSubspecies().

Referenced by genbank_get_subspecies().

int find_strain ( const char str,
char  expect_behind 
)

Definition at line 247 of file util.cxx.

References FIND_START, and findStrain().

Referenced by correct_subspecies().

int skip_strain ( const char str,
char  expect_behind 
)

Definition at line 248 of file util.cxx.

References FIND_SKIP_OVER, and findStrain().

Referenced by check_strain_from().

const char* stristr ( const char str,
const char substring 
)

Definition at line 250 of file util.cxx.

References find_pattern(), NULp, and offset.

Referenced by partial_mtoe().

int ___lookup_keyword ( const char keyword,
const char *const *  lookup_table,
int  lookup_table_size 
)

Definition at line 255 of file util.cxx.

References str_equal().

int parse_key_word ( const char line,
char key,
const char separator 
)

Definition at line 265 of file util.cxx.

References occurs_in(), and TOKENSIZE.

Referenced by comment_subkey(), embl_key_word(), genbank_key_word(), macke_abbrev(), and macke_key_word().