gCAD3D 2.40
ut_txt.h
Go to the documentation of this file.
1 /* ut_txt.h
2 
3 
4 2002-02-25 term_buf u term_anz von ut_txfil.h hierher. RF.
5 
6 */
7 
8 
9 
10 #define TXT_Typ_EOF 0
11 #define TXT_Typ_spec 1
12 #define TXT_Typ_text 2 /* nicht in " eingeschlossenen Texte */
13 #define TXT_Typ_num 3
14 #define TXT_Typ_string 4 /* in " eingeschlossenen Texte */
15 
16 
17 
18 
19 
20 
22 #define term_anz 1
23 #define term_buf "\n"
24 
25 // #define term_anz 2
26 // #define term_buf "\r\n"
27 
28 
30 #ifdef _MSC_VER
31 #define fnam_del '\\'
32 #define fnam_del_s "\\"
33 #else
34 #define fnam_del '/'
35 #define fnam_del_s "/"
36 #endif
37 
38 
39 
40 
41 // ------------- inline functions ------------------------------------
42 #define UTX_Clear(str) str[0] = '\0'
43 
45 
47 #define UTX_Siz(sSiz,sStart0,sStart1) sStart0 + sSiz - sStart1
48 
55 
57 #define UTX_skip_1bl(tp) {++(*(tp)); while(**(tp) == ' ') ++(*(tp));}
58 
59 
61 #define UTX_pos_skipLeadBlk(p1) while(*p1 == ' ') ++p1
62 
63 
65 #define UTX_pos_EOS(p1) strchr(p1, '\0')
66 
67 
70 #define UTX_wTab_tmpSpc(wa,wSiz)\
71  (wa)=(char**)MEM_alloc_tmp((int)(wSiz*sizeof(void*)))
72 
73 
77 int UTX_find_chr(char*,char);
78 #define UTX_find_chr(s1,c1) ((strchr(s1,c1) == NULL) ? 0 : 1)
79 
80 
81 // UTX_CP__ copy n chars - terminate with '\0'
82 #define UTX_CP__(pTo,pFrom,cNr){\
83  strncpy (pTo,pFrom,cNr); pTo[cNr]='\0';}
84 
85 
86 
87 // -------------------------------------------------------------------
88 extern const char TX_NUL;
89 
90 
91 
92 
93 
94 /*****************************************************************************/
95 /* PROTOTYPES */
96 /*****************************************************************************/
97 
98  void UTX_cp_word_2_upper (char* txtout, char* txtin);
99  char* UTX_cp_word_term (char* txtOut, char* txtIn, char term);
100  char UTX_cp_word_t (char *txtOut, char **cBuf);
101  char* UTX_cp_word__ (char *txtOut, char *txtIn);
102  int UTX_cp_right (char *sOut, char *sIn, int cNr);
103  char* UTX_cp_expr (char *cbo, char *cbi);
104 
105  int UTX_ftyp_s (char *ftyp, char *cbuf, int mode);
106  int UTX_fnam_s (char *fnam, char *cbuf);
107  int UTX_fdir_s (char *fdir, char *cbuf);
108 
109  char UTX_pos_del (char**, char**);
110  long UTX_pos_del_next (char *cBuf, long cPos);
111  long UTX_pos_del_prev (char *cBuf, long cPos);
112  char* UTX_pos_eos (char*);
113  char* UTX_pos_1n (char*);
114 //void UTX_pos_skipLeadBlk (char *buf);
115  char* UTX_pos_skipBrack (char *cbuf);
116  char* UTX_pos_skipBrack1 (char *cbuf);
117  int UTX_pos_skipTermWord (char **wNxt, char *cbuf);
118  char* UTX_pos_skipWord (char *cbuf);
119  char* UTX_pos_skipWords (int wNr, char *p1);
120  char* UTX_pos_skipStr (char *cbuf);
121  char* UTX_pos_skipDeli1 (char *p1);
122  int UTX_pos_skip_int (char **ps);
123 
124  int UTX_ckc_Del1 (char c1);
125  int UTX_ckc_Del2 (char c1);
126  int UTX_ck_num_i (char *s1);
127  int UTX_ck_num_f (char **pOut, char *cbuf);
128  int UTX_ck_num_digNr (char **cpo, char *cpi);
129  int UTX_cmp_word_wordtab (char *wdtab[], char *wd1);
130 
131  char* UTX_2db_tx (double *d1, double *d2, char *cbuf);
132  double UTX_db_tx (char **po, char *pi);
133 
134  char* UTX_db10__ (char s1[], double d1);
135  char* UTX_db15__ (char s1[], double d1);
136 
137  int UTX_add_i_u (char[], int);
138  int UTX_add_db (char outBuf[], double *db1);
139  int UTX_add_pt (char outBuf[], void *pt1);
140  int UTX_add_fl_u (char[], double);
141  int UTX_add_fl_u2 (char[], double, double);
142  int UTX_add_fl_u3 (char[], double, double, double, char chDel);
143  int UTX_add_fl_ua (char[], double *da, int dNr, char chDel);
144  int UTX_add_fl_f (char[], double, int);
145  char* UTX_add_fl_1uf (char *outBuf, double d1);
146  int UTX_add_fl_10 (char[], double);
147  int UTX_add_fl_15 (char[], double);
148 
149  int UTX_del_chr (char *cbuf, char cx);
150  int UTX_del_foll0 (char strBuf[]);
151  int UTX_del_follBl (char *cbuf);
152  int UTX_del_FilTx (char *dtxt, char *filNam);
153 
154  char* UTX_fgets (char* line, int len, FILE* fp);
155  int UTX_fgetLine (char *cbuf, int sizBuf, char *filNam, int lNr);
156  int UTX_fsavLine (char *cbuf, char *filNam, int lnMaxSiz, int lNr);
157  int UTX_fRevL (char *fno, char *fni);
158 
159  void UTX_ins_s2 (char*, char*, int);
160 
161  char* UTX_CleanCR (char* string);
162  void UTX_CleanSC (char*);
163  void UTX_CleanAN (char*);
164  int UTX_CleanCommC (char *cBuf);
165  int UTX_Clean_db (char*);
166  int UTX_chg_chr1 (char newChr, char oldChr, char *cBuf);
167  int UTX_chg_str1 (long *datSiz,
168  void *datStart, void *insDat, void *delPos, long delSiz);
169  int UTX_chg_str2 (int sSiz, char *sDat, char *sOld, char *sNew);
170  int UTX_chg_nr (char *txtOut, int iNr);
171  int UTX_chg_wordn (char *sOut, char *wNew, int wNr, long lenMax);
172  char* UTX_CleanBracks (char* txtbuf, char ch1, char chr2);
173  int UTX_endDelChar (char* txtbuf, char chr);
174 
175  int UTX_get_word (char** txtIn,char** w_next,char* txtOut,double* val,
176  char* deli);
177  char* UTX_find_word1 (char *was, char *wo);
178  char* UTX_find_Del1 (char *p1);
179  char* UTX_find_strrstr (char *cbuf, char *str);
180  char* UTX_find_strrchrn (char *cbuf, char *str);
181  int UTX_strcmp_right (char *string, char *text);
182 
183  int UTX_ck_casenChr(char *s1, char *s2, int cNr);
184 
185  char *UTX_memFind (char *buf, char *str);
186  char *UTX_memFind1 (char *buf, long bufSiz, char *str, long strSiz);
187  char *UTX_memstr (char* von, char* bis, char* sstr);
188  int UTX_insert1 (char *cbuf, long *bufSiz, char *auxBuf, long cPos);
189  int UTX_cut1 (char *cbuf, long *bufSiz, long cPos, long txLen);
190 
191  int UTX_wTab_ck (char *wTab[], char *w1);
192  char** UTX_wTab_file (char *memspc, int memSiz, char *fnam);
193 
194  int UTX_wordnr (char *cbuf);
195  int UTX_setup_set (char *fn, char *par, char *val);
196  int UTX_setup_get (char *cval, char *ctyp, char *fnam, int mode);
197  int UTX_setup_modw (char *fn, char *par, char *wNew, int wNr);
198  int UTX_setup_decs (char *s1, char **pv);
199 
200  int UTX_cat_file (FILE *fpo, char *fnam);
201  int UTX_dir_listf (char *outFilNam, char *fPath, char *fNam, char *fTyp);
202  int UTX_cnr_chr (char *txt, char c1);
203 
204  int UTX_str_file (char* txbuf, long *fSiz, char *fnam);
205 
206 /* ------------ eof ---------------- */
int UTX_add_fl_u(char strBuf[], double zahl)
Definition: ut_txt.c:3293
char * UTX_pos_skipWord(char *cbuf)
Definition: ut_txt.c:5176
int UTX_wTab_ck(char *wTab[], char *w1)
Definition: ut_txt.c:673
int UTX_fdir_s(char *fdir, char *cbuf)
Definition: ut_txt.c:1237
char * UTX_find_word1(char *was, char *wo)
Definition: ut_txt.c:1624
int UTX_ck_num_digNr(char **cpo, char *cpi)
Definition: ut_txt.c:2000
int UTX_ck_num_i(char *s1)
Definition: ut_txt.c:1910
int UTX_cut1(char *cbuf, long *bufSiz, long cPos, long txLen)
Definition: ut_txt.c:5687
int UTX_fRevL(char *fno, char *fni)
Definition: ut_txt.c:4031
int UTX_pos_skip_int(char **ps)
Definition: ut_txt.c:5109
char mode
Definition: xa_tra.c:152
int UTX_chg_nr(char *txtOut, int iNr)
Definition: ut_txt.c:2681
int UTX_get_word(char **txtIn, char **w_next, char *txtOut, double *val, char *deli)
Definition: ut_txt.c:5391
int UTX_chg_str2(int sSiz, char *sDat, char *sOld, char *sNew)
Definition: ut_txt.c:2614
char * UTX_pos_skipBrack1(char *cbuf)
Definition: ut_txt.c:4707
int UTX_chg_wordn(char *sOut, char *wNew, int wNr, long lenMax)
Definition: ut_txt.c:2158
void UTX_ins_s2(char *s1, char *s2, int maxlen)
Definition: ut_txt.c:3821
void UTX_cp_word_2_upper(char *txtout, char *txtin)
Definition: ut_txt.c:2211
int UTX_fsavLine(char *cbuf, char *filNam, int lnMaxSiz, int lNr)
Definition: ut_txt.c:3928
int UTX_endDelChar(char *txtbuf, char chr)
Definition: ut_txt.c:2729
int UTX_CleanCommC(char *cBuf)
Definition: ut_txt.c:4518
int UTX_chg_chr1(char newChr, char oldChr, char *cBuf)
Definition: ut_txt.c:2552
char * UTX_cp_word_term(char *txtOut, char *txtIn, char term)
Definition: ut_txt.c:2393
char * UTX_memFind(char *buf, char *str)
Definition: ut_txt.c:4168
int UTX_del_FilTx(char *dtxt, char *filNam)
Definition: ut_txt.c:3231
static Point pt1
Definition: DemoPlugin_Dialog.c:85
int UTX_setup_set(char *fn, char *par, char *val)
Definition: ut_txt.c:6223
int UTX_add_fl_15(char strBuf[], double d1)
Definition: ut_txt.c:3708
char * UTX_2db_tx(double *d1, double *d2, char *cbuf)
Definition: ut_txt.c:4981
int UTX_pos_skipTermWord(char **wNxt, char *cbuf)
Definition: ut_txt.c:5140
int UTX_cat_file(FILE *fpo, char *fnam)
Definition: ut_txt.c:1307
char * UTX_db10__(char s1[], double d1)
Definition: ut_txt.c:3466
int UTX_add_fl_f(char strBuf[], double zahl, int nkAnz)
Definition: ut_txt.c:3430
const char TX_NUL
Definition: ut_txt.c:253
static char txbuf[256]
Definition: ut_os_aix.c:203
char * UTX_find_strrchrn(char *cbuf, char *str)
Definition: ut_txt.c:1833
char * UTX_cp_word__(char *txtOut, char *txtIn)
Definition: ut_txt.c:2282
int UTX_wordnr(char *cbuf)
Definition: ut_txt.c:5261
int UTX_fgetLine(char *cbuf, int sizBuf, char *filNam, int lNr)
Definition: ut_txt.c:4128
int UTX_del_foll0(char strBuf[])
Definition: ut_txt.c:3191
int UTX_strcmp_right(char *string, char *text)
Definition: doxy_help1.c:469
int UTX_add_fl_u2(char outBuf[], double z1, double z2)
Definition: ut_txt.c:3322
char ** UTX_wTab_file(char *memspc, int memSiz, char *fnam)
Definition: ut_txt.c:389
char * UTX_pos_skipDeli1(char *p1)
Definition: ut_txt.c:4962
char * UTX_find_strrstr(char *cbuf, char *str)
Definition: ut_txt.c:1768
char outBuf[256]
Definition: prc_cut1__.c:137
int UTX_Clean_db(char *cbuf)
Definition: ut_txt.c:4535
char UTX_pos_del(char **txtIn, char **w_next)
Definition: ut_txt.c:2824
char * UTX_cp_expr(char *cbo, char *cbi)
Definition: ut_txt.c:2482
int UTX_del_follBl(char *cbuf)
Definition: ut_txt.c:3159
char * UTX_fgets(char *line, int len, FILE *fp)
Definition: ut_txt.c:4317
int UTX_add_fl_ua(char outBuf[], double *da, int dNr, char chDel)
Definition: ut_txt.c:3371
char * UTX_pos_skipWords(int wNr, char *p1)
Definition: ut_txt.c:5242
char * UTX_find_Del1(char *p1)
Definition: ut_txt.c:4933
int UTX_ckc_Del1(char c1)
Definition: ut_txt.c:4847
char * UTX_db15__(char s1[], double d1)
Definition: ut_txt.c:3541
int UTX_setup_modw(char *fn, char *par, char *wNew, int wNr)
Definition: ut_txt.c:6505
int UTX_fnam_s(char *fnam, char *cbuf)
Definition: ut_txt.c:1190
char * UTX_pos_skipStr(char *cbuf)
Definition: ut_txt.c:4565
int UTX_ftyp_s(char *ftyp, char *cbuf, int mode)
Definition: ut_txt.c:1143
int UTX_add_pt(char outBuf[], void *pt1)
Definition: ut_txt.c:3110
int dNr
Definition: doxy_help1.c:38
char * UTX_pos_eos(char *)
char * UTX_add_fl_1uf(char *outBuf, double d1)
Definition: ut_txt.c:3397
int UTX_chg_str1(long *datSiz, void *datStart, void *insDat, void *delPos, long delSiz)
Definition: ut_txt.c:2578
void UTX_CleanAN(char *s1)
Definition: ut_txt.c:4348
void UTX_CleanCR(char *string)
===========================================================
Definition: doxy_help1.c:523
char UTX_cp_word_t(char *txtOut, char **cBuf)
Definition: ut_txt.c:2325
char * UTX_CleanBracks(char *txtbuf, char ch1, char ch2)
Definition: ut_txt.c:2526
int UTX_setup_get(char *cval, char *ctyp, char *fnam, int mode)
Definition: ut_txt.c:6406
char * UTX_pos_1n(char string[])
Definition: ut_txt.c:2802
long lNr
Definition: xa_tra.c:150
int UTX_add_fl_10(char strBuf[], double d1)
Definition: ut_txt.c:3603
int UTX_ckc_Del2(char c1)
Definition: ut_txt.c:4877
int UTX_cmp_word_wordtab(char *wdtab[], char *wd1)
Definition: ut_txt.c:1870
int UTX_cp_right(char *sOut, char *sIn, int cNr)
Definition: ut_txt.c:6099
long UTX_pos_del_prev(char *cBuf, long cPos)
Definition: ut_txt.c:2940
int UTX_setup_decs(char *s1, char **pv)
Definition: ut_txt.c:6602
int UTX_cnr_chr(char *txt, char c1)
Definition: ut_txt.c:5302
static char cBuf[512]
Definition: DemoPlugin_Create.c:86
int UTX_insert1(char *cbuf, long *bufSiz, char *auxBuf, long cPos)
Definition: ut_txt.c:5764
int UTX_ck_num_f(char **pOut, char *cbuf)
Definition: ut_txt.c:1941
double UTX_db_tx(char **po, char *pi)
Definition: ut_txt.c:5000
static int s1
Definition: ckint_fac.c:58
int UTX_add_i_u(char strBuf[], int zahl)
Definition: ut_txt.c:3081
int UTX_dir_listf(char *outFilNam, char *fPath, char *fNam, char *fTyp)
Definition: ut_txt.c:1422
void UTX_CleanSC(char *string)
Definition: ut_txt.c:4387
int UTX_del_chr(char *cbuf, char cx)
Definition: ut_txt.c:3129
char * UTX_memstr(char *von, char *bis, char *sstr)
Definition: ut_txt.c:4263
int UTX_ck_casenChr(char *s1, char *s2, int cNr)
Definition: ut_txt.c:4792
long UTX_pos_del_next(char *cBuf, long cPos)
Definition: ut_txt.c:3005
int UTX_add_fl_u3(char outBuf[], double z1, double z2, double z3, char chDel)
Definition: ut_txt.c:3340
int UTX_add_db(char outBuf[], double *db1)
Definition: ut_txt.c:3095
int UTX_str_file(char *txbuf, long *fSiz, char *fnam)
Definition: doxy_help1.c:605
static int s2
Definition: ckint_fac.c:58
#define UTX_find_chr(s1, c1)
Definition: ut_txt.h:78
char * UTX_pos_skipBrack(char *cbuf)
Definition: ut_txt.c:4657
char * UTX_memFind1(char *buf, long bufSiz, char *str, long strSiz)
Definition: ut_txt.c:4179