MIDAS  0.75
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
Namespaces | Macros | Functions
librw.cpp File Reference
#include "librw.h"
#include "gelib.h"
#include "arrays.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

Go to the source code of this file.

Namespaces

 midaspace
 

Macros

#define CHECK_DEST   if (!dest) _errorr("destination is not allocated")
 

Functions

bool midaspace::isWordChar (char C)
 

*** *** *** *** GENERAL FUNCTIONS *** *** *** ***


return true if character C is "normal" char –> C != ' ' '' '
' '\0' '' More...

 
bool midaspace::isLineChar (char C)
 return true if character C is "normal" char or "space" char –> C != '
' '\0' '' More...
 
bool midaspace::isSpaceChar (char C)
 return true if character C is "space" char –> C == ' ' '' More...
 
bool midaspace::isDigitChar (char C)
 
long midaspace::giveLineLength (const char *src)
 return length of line == sting compount of "line chars" More...
 
char * midaspace::strdupl (const char *src)
 standard strdup - Memory for the new string is obtained with malloc(3), and can be freed with free(3). More...
 
char * midaspace::strdupl (const char *src1, const char *src2)
 
char * midaspace::strdupl (const char *src1, const char *src2, const char *src3)
 
char * midaspace::pathstrdupl (const char *src)
 
long midaspace::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. More...

 
void midaspace::AP_fprint_arguments (FILE *stream, int argc, char *argv[])
 print arguments to stream More...
 
bool midaspace::FP_skip_comment (FILE *stream)
 

*** *** *** *** FILE PROCESSING *** *** *** ***


general rules for file processing: More...

 
void midaspace::FP_skip_line_commented (FILE *stream)
 move file descriptor to the start of the new noncommented line, without checking of EOF More...
 
void midaspace::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 More...
 
bool midaspace::FP_skip_line (FILE *stream, int n)
 move file descriptor to the start of the n-th new line //[former read_line] More...
 
bool midaspace::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 More...
 
bool midaspace::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 More...
 
bool midaspace::FP_skip_to_line_starting_with (FILE *stream, char C)
 replacement of old function "read_contiguous_star" move file descriptor to the line starting with character, directly to this char More...
 
bool midaspace::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 More...
 
bool midaspace::FP_scan_array (FILE *stream, int n, long *dest)
 
bool midaspace::FP_scan_array (FILE *stream, int n, double *dest)
 
long midaspace::FP_number_of_words (FILE *stream)
 count number of words (see isWordChar) in file More...
 
long midaspace::FP_number_of_lines (FILE *stream, bool rwd)
 count number of lines in file More...
 
bool midaspace::FP_skip_nonword (FILE *stream)
 

*** *** *** SKIPING *** *** ***


skiping == shift stream pointer at the first char which is not ... More...

 
bool midaspace::FP_skip_space (FILE *stream)
 ... space More...
 
bool midaspace::FP_skip_word (FILE *stream)
 ... word More...
 
long midaspace::FP_scan_line_skip_emptyORcommented (FILE *stream, char *dest)
 

*** *** *** SCANNING *** *** ***


scanning == scan ... More...

 
long midaspace::FP_scan_line (FILE *stream, char *dest)
 scan/copy line == string without '
' from stream More...
 
long midaspace::FP_scan_line_alloc (FILE *stream, char *&dest)
 scan/copy line == string without '
' from stream; dest is NULL and allocated here More...
 
int midaspace::FP_scan_word (FILE *src, char *dest)
 ... word; return value is length of the word More...
 
bool midaspace::FP_skip_expected_string (FILE *src, const char *expctd, bool cs)
 ... word and compare with expected one More...
 
bool midaspace::FP_scan_expected_word (FILE *src, const char *expctd, bool cs)
 ... word and compare with expected one More...
 
void midaspace::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 More...
 
bool midaspace::FP_scan_expected_line (FILE *src, const char *expctd, bool cs)
 ... line and compare with expected one More...
 
void midaspace::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 More...
 
void midaspace::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/scanned/printed word/number/array word is string separated by ' ', '', '
' or '\0' More...

 
void midaspace::errorr_expected (const char *file, int line, const char *msg, int expctd, const char *src)
 
void midaspace::errorr_expected (const char *file, int line, const char *msg, long expctd, const char *src)
 
bool midaspace::SP_cutcomment (char *src)
 cut of comment == end of line starting by '#' More...
 
bool midaspace::SP_unskip_space (const char *&src)
 

*** *** *** SKIPING *** *** ***


(un)skiping == shift src pointer at the end(start) of ... More...

 
bool midaspace::SP_skip_space (const char *&src)
 ... space == ' ' and '' characters More...
 
bool midaspace::SP_skip_word (const char *&src, int n)
 ... word and space before More...
 
bool midaspace::SP_skip_int (const char *&src)
 ... word compound of digits and space before More...
 
void midaspace::SP_unscan_word (const char *&src, const char *w)
 

*** *** *** SCANNING *** *** ***


unscan word == shift pointer back over word More...

 
bool midaspace::SP_scan_character (const char *&src, char &dest)
 scanning == scan ... to variable dest and shift src pointer at the end of ... More...
 
long midaspace::SP_scan_word (const char *&src, char *dest)
 ... word; return value is length of the word More...
 
long midaspace::SP_scan_line (const char *&src, char *dest)
 ... line; return value is length of the line More...
 
long midaspace::SP_scan_line_alloc (const char *&src, char *&dest)
 ... line; return value is length of the line; dest is NULL and allocated here More...
 
bool midaspace::SP_scan_expected_word (const char *&src, const char *expctd, bool cs)
 ... word and compare with expected one More...
 
void midaspace::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 More...
 
void midaspace::SP_scan_expected_word_FL (const char *file, int line, const char *&src, const char *expctd1, const char *expctd2, const char *msg, bool cs)
 
void midaspace::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)
 
bool midaspace::SP_scan_number (const char *&src, int &dest)
 ... number of type int/long/double More...
 
bool midaspace::SP_scan_number (const char *&src, long &dest)
 
bool midaspace::SP_scan_number (const char *&src, double &dest)
 
bool midaspace::SP_scan_array_L (const char *&src, int L, double *a)
 
bool midaspace::SP_scan_Dvctr_exit (const char *&src, int n, Dvctr *v)
 
bool midaspace::SP_print_space (const char *&src, FILE *stream)
 

*** *** *** PRINTING *** *** ***


printing == print ... More...

 
bool midaspace::SP_print_word (const char *&src, FILE *stream)
 ... word More...
 
long midaspace::find_double (long n, long *p)
 

*** *** *** *** OBSOLETE FUNCTIONS *** *** *** ***


More...
 
void midaspace::sprint_param (char *s, char *argv[], int n)
 
void midaspace::read_star_end (FILE *stream, int n)
 
void midaspace::read_star (FILE *stream)
 
void midaspace::copy_star_end (FILE *sour, FILE *dest, int n=1)
 read line of file until
, no save, dava bacha na EOF More...
 
void midaspace::copy_star (FILE *sour, FILE *dest)
 
void midaspace::copy_line (FILE *sour, FILE *dest, int n)
 
void midaspace::copy_to_end_line (FILE *sour, FILE *dest)
 
void midaspace::copy_file (FILE *sour, FILE *dest)
 
int midaspace::extract_long (const char *s1, const char *s2, long &a)
 
int midaspace::extract_double (const char *s1, const char *s2, double &a)
 v retezci s1 se najde key retezec s2 a za nim se precte double More...
 
void midaspace::ad_line (FILE *stream, char *s)
 

Macro Definition Documentation

#define CHECK_DEST   if (!dest) _errorr("destination is not allocated")

Definition at line 14 of file librw.cpp.

Referenced by midaspace::SP_scan_line().