44 char*
strdupl (
const char *src);
45 char*
strdupl (
const char *src1,
const char *src2);
46 char*
strdupl (
const char *src1,
const char *src2,
const char *src3);
50 void errorr_expected (
const char* file,
int line,
const char *msg,
const char *expctd,
const char *src);
51 void errorr_expected (
const char* file,
int line,
const char *msg,
int expctd,
const char *src);
52 void errorr_expected (
const char* file,
int line,
const char *msg,
long expctd,
const char *src);
53 void errorr_expected (
const char* file,
int line,
const char *msg,
double expctd,
const char *src);
94 bool FP_cmp_files (
const char *file1,
const char *file2);
136 void FP_scan_expected_word_FL (
const char* file,
int line, FILE *src,
const char *expctd,
const char *msg,
bool cs);
137 #define FP_scan_expected_word_exit(_1,_2,_3,_4) FP_scan_expected_word_FL (__FILE__, __LINE__, _1,_2,_3,_4) 138 void FP_scan_expected_line_FL (
const char* file,
int line, FILE *src,
const char *expctd,
const char *msg,
bool cs);
140 #define FP_scan_expected_line_exit(_1,_2,_3,_4) FP_scan_expected_line_FL (__FILE__, __LINE__, _1,_2,_3,_4) 147 template <
class ArgType>
153 #define FP_scan_expected_number_exit(_1,_2,_3) FP_scan_expected_number_FL (__FILE__, __LINE__, _1,_2,_3) 219 void SP_scan_expected_word_FL (
const char* file,
int line,
const char *&src,
const char *expctd,
const char *msg,
bool cs);
220 void SP_scan_expected_word_FL (
const char* file,
int line,
const char *&src,
const char *expctd1,
const char *expctd2,
const char *msg,
bool cs);
221 void SP_scan_expected_word_FL (
const char* file,
int line,
const char *&src,
const char *expctd1,
const char *expctd2,
const char *expctd3,
const char *msg,
bool cs);
223 #define SP_scan_expected_word_exit( _1,_2,_3,_4) SP_scan_expected_word_FL (__FILE__, __LINE__, _1,_2,_3,_4) 224 #define SP_scan_expected_word2_exit(_1,_2,_3,_4,_5) SP_scan_expected_word_FL (__FILE__, __LINE__, _1,_2,_3,_4,_5) 225 #define SP_scan_expected_word3_exit(_1,_2,_3,_4,_5,_6) SP_scan_expected_word_FL (__FILE__, __LINE__, _1,_2,_3,_4,_5,_6) 235 template <
class ArgType>
243 template <
class ArgType>
249 #define SP_scan_expected_number_exit(_1,_2,_3) SP_scan_expected_number_FL (__FILE__, __LINE__, _1,_2,_3) 256 template <
class ArgType>
274 template <
class ArgType>
279 dest->resize_ignore_vals(n);
313 int extract_long (
const char *s1,
const char *s2,
long &a);
319 void ad_line (FILE *stream,
char *s);
bool isLineChar(char C)
return true if character C is "normal" char or "space" char –> C != ' ' '\0' ''
bool SP_print_word(const char *&src, FILE *stream)
... word
void give_line(FILE *stream, char *&s)
bool FP_skip_expected_string(FILE *src, const char *expctd, bool cs)
... word and compare with expected one
bool SP_cutcomment(char *src)
cut of comment == end of line starting by '#'
void FP_skip_line_commented(FILE *stream)
move file descriptor to the start of the new noncommented line, without checking of EOF ...
void sprint_param(char *s, char *argv[], int n)
long giveLineLength(const char *src)
return length of line == sting compount of "line chars"
bool FP_skip_line(FILE *stream, int n)
move file descriptor to the start of the n-th new line //[former read_line]
int extract_long(const char *s1, const char *s2, long &a)
bool get_confirm(const char *s, bool expected)
bool isSpaceChar(char C)
return true if character C is "space" char –> C == ' ' ''
void FP_scan_expected_line_FL(const char *file, int line, FILE *src, const char *expctd, const char *msg, bool cs)
... line and compare with expected one, exit if false
char * strdupl(const char *src)
standard strdup - Memory for the new string is obtained with malloc(3), and can be freed with free(3)...
void copy_to_end_line(FILE *sour, FILE *dest)
int extract_double(const char *s1, const char *s2, double &a)
v retezci s1 se najde key retezec s2 a za nim se precte double
void SP_scan_expected_number_FL(const char *file, int line, const char *&src, ArgType expctd, const char *msg)
... number and compare with expected one, exit if false
long SP_scan_word(const char *&src, char *dest)
... word; return value is length of the word
bool SP_scan_array(const char *&src, int n, ArgType *a)
... array of numbers
void FP_copy_file(FILE *sour, FILE *dest)
[former copy_file]
void FP_scan_expected_number_FL(const char *file, int line, FILE *src, ArgType expctd, const char *msg)
... number and compare with expected one, exit if false
bool isWordChar(char C)
*** *** *** *** GENERAL FUNCTIONS *** *** *** *** return true if character C is "normal" char –> C...
void extract_double_array(const char *s1, const char *s2, long n, double *a)
bool SP_skip_space(const char *&src)
... space == ' ' and '' characters
void AP_fprint_arguments(FILE *stream, int argc, char *argv[])
print arguments to stream
bool FP_scan_array(FILE *stream, int n, int *dest)
scan/copy array of numbers from src to dest, src pointer is shifted over the field ...
void SP_scan_expected_word_FL(const char *file, int line, const char *&src, const char *expctd, const char *msg, bool cs)
... word and compare with expected one/two/three, exit if false
bool FP_skip_comment(FILE *stream)
*** *** *** *** FILE PROCESSING *** *** *** *** general rules for file processing: ...
long FP_number_of_words(FILE *stream)
count number of words (see isWordChar) in file
long FP_scan_line(FILE *stream, char *dest)
scan/copy line == string without ' ' from stream
void read_star(FILE *stream)
void read_star_end(FILE *stream, int n)
bool FP_skip_space(FILE *stream)
... space
long FP_scan_line_alloc(FILE *stream, char *&dest)
scan/copy line == string without ' ' from stream; dest is NULL and allocated here ...
bool SP_skip_int(const char *&src)
... word compound of digits and space before
bool SP_scan_number(const char *&src, int &dest)
... number of type int/long/double
void errorr_expected(const char *file, int line, const char *msg, const char *expctd, const char *src)
*** *** *** *** STRING PROCESSING *** *** *** *** src pointer is always shifted over the skipped/sc...
bool FP_scan_expected_word(FILE *src, const char *expctd, bool cs)
... word and compare with expected one
void FP_skip_line_fast_skip_commented(FILE *stream, int n)
move file descriptor to the start of the n-th new line, without checking of EOF
bool FP_skip_to_line_starting_With(FILE *stream, const char *string, bool cs)
move file descriptor to the line starting with string, exactly behind the string; NO white space can ...
void SP_unscan_word(const char *&src, const char *w)
*** *** *** SCANNING *** *** *** unscan word == shift pointer back over word
long SP_scan_line(const char *&src, char *dest)
... line; return value is length of the line
long find_double(long n, long *p)
*** *** *** *** OBSOLETE FUNCTIONS *** *** *** ***
bool SP_scan_Dvctr_exit(const char *&src, int n, Dvctr *v)
long SP_scan_line_alloc(const char *&src, char *&dest)
... line; return value is length of the line; dest is NULL and allocated here
bool SP_replace_char(char *str, char s, char d)
replace src char to dest char
bool SP_scan_Xvctr(const char *&src, ArgType *dest)
bool SP_scan_Dvctr (const char *&src, Dvctr *dest);
bool FP_cmp_files(const char *file1, const char *file2)
Return false if no differences.
bool FP_skip_behind_line_starting_with(FILE *stream, const char *string, bool cs)
move file descriptor to the start of the new line after the one starting with string ...
long AP_find_option(int argc, char *argv[], const char *s)
*** *** *** *** ARGUMENTS PROCESSING *** *** *** *** terminology: tar -cz -f archiv.tgz archiv/ /// fce name | arguments /// fce name | options | parameters /// fce name | opt | opt | opt argum.
bool SP_scan_array_L(const char *&src, int L, double *a)
bool SP_scan_character(const char *&src, char &dest)
scanning == scan ... to variable dest and shift src pointer at the end of ...
bool FP_skip_to_line_starting_with(FILE *stream, const char *string, bool cs)
move file descriptor to the line starting with string, exactly behind the string; white space can be ...
long FP_scan_line_skip_emptyORcommented(FILE *stream, char *dest)
*** *** *** SCANNING *** *** *** scanning == scan ...
bool SP_print_space(const char *&src, FILE *stream)
*** *** *** PRINTING *** *** *** printing == print ...
void copy_star_end(FILE *sour, FILE *dest, int n)
read line of file until , no save, dava bacha na EOF
long FP_number_of_lines(FILE *stream, bool rwd)
count number of lines in file
bool SP_scan_array_alloc(const char *&src, long &n, ArgType *&a)
bool FP_copy_behind_line(FILE *sour, FILE *dest, int n)
copy from file to file behind the line [former copy_line]
bool FP_copy_behind_line_starting_with(FILE *src, FILE *dest, const char *expctd, bool cs)
copy from file to file behind the line starting with string
bool FP_skip_nonword(FILE *stream)
*** *** *** SKIPING *** *** *** skiping == shift stream pointer at the first char which is not ...
bool SP_scan_expected_number(const char *&src, ArgType expctd)
... number and compare with expected one
bool FP_scan_expected_number(FILE *src, long expctd)
... number and compare with expected one
void FP_scan_expected_word_FL(const char *file, int line, FILE *src, const char *expctd, const char *msg, bool cs)
... word and compare with expected one, exit if false
int FP_scan_word(FILE *src, char *dest)
... word; return value is length of the word
void ad_line(FILE *stream, char *s)
bool SP_skip_word(const char *&src, int n)
... word and space before
void copy_star(FILE *sour, FILE *dest)
char * pathstrdupl(const char *src)
bool SP_scan_expected_word(const char *&src, const char *expctd, bool cs)
... word and compare with expected one