rllib  1
rlcutil.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlcutil.cpp - description
3  -------------------
4  begin : Wed Dec 11 2002
5  copyright : (C) 2002 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
19 #ifndef _RL_CUTIL_H_
20 #define _RL_CUTIL_H_
21 
22 #include <stdarg.h>
23 #include <ctype.h>
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 #include "rldefine.h"
27 
31 int rlSetDebugPrintf(int state);
32 int rlDebugPrintf(const char *format, ...);
33 
38 int rlInputAvailable();
39 
43 int rlLastLinePrintf(const char *format, ...);
44 
45 #ifdef RLUNIX
46 
49 #ifndef SWIG
50 int rlexec(const char *command);
51 #endif
52 #endif
53 
57 const char *rlpass(const char *p);
58 
62 char *rlstrncpy(char *dest, const char *source, int n);
63 
69 char *rlstrlinecpy(char *dest, const char *source, int n);
70 
74 #ifndef SWIG
75 int rlvsnprintf(char *text, int len, const char *format, va_list ap);
76 #endif
77 
81 int rlsnprintf(char *text, int len, const char *format, ...);
82 
86 void rlSetSigtermHandler(void (*handler)(void *arg), void *arg);
87 
91 const char *rlFindFile(const char *pattern, int *context);
92 
99 const char *rlGetInifile(const char *name);
100 
104 int rlSwapShort(int val);
105 
109 int rlEib1 (int command);
110 int rlEib2 (int command);
111 int rlLon1 (int command);
112 int rlLon2 (int command);
113 int rlProfibus1(int command);
114 int rlProfibus2(int command);
115 int rlCan1 (int command);
116 int rlCan2 (int command);
117 
121 int rlBrowser(const char *htmlfile);
122 
126 int rlsystem(const char *command);
127 
133 int rlSubmitPvserver(const char *env, const char *path, const char *pvs, const char *options=NULL);
134 
140 int rlOption(const char *string, const char *option);
141 
145 int rlIntOption(const char *string, const char *option, int _default);
146 
150 float rlFloatOption(const char *string, const char *option, float _default);
151 
155 const char *rlTextOption(const char *string, const char *option, const char *_default);
156 
160 int rlCopyTextfile(const char *source, const char *destination);
161 
165 int rlupper(char *str);
166 
170 int rllower(char *str);
171 
175 int rlStartsWith(const char *str, const char *startstr);
176 
180 int rlEndsWith(const char *str, const char *endstr);
181 
185 int rlStrMatch(const char *str, const char *wild);
186 
190 #ifndef SWIG
191 int rlStat(const char *filepath, struct stat *buf);
192 #endif
193 
198 int rlFRead(FILE *fin, void *data, int len);
199 
204 int rlFWrite(FILE *fout, void *data, int len);
205 
210 int rlWriteFile(const char *filename, void *data, int len);
211 
215 int rlMkdir(const char *dir, int mode=0744);
216 
221 int rlBitSet(int bitnumber, int *value);
222 
227 int rlBitClear(int bitnumber, int *value);
228 
233 int rlBitChange(int bitnumber, int *value);
234 
239 int rlBitTest(int bitnumber, int *value);
240 
245 void rlPushToDoubleBuffer(double val, double *buffer, int size);
246 
251 void rlPushToFloatBuffer(float val, float *buffer, int size);
252 
253 
254 #endif
char * rlstrlinecpy(char *dest, const char *source, int n)
Definition: rlcutil.cpp:182
int rlEib1(int command)
Definition: rlcutil.cpp:381
int rlLastLinePrintf(const char *format,...)
Definition: rlcutil.cpp:94
int rlLon1(int command)
Definition: rlcutil.cpp:397
void rlSetSigtermHandler(void(*handler)(void *arg), void *arg)
Definition: rlcutil.cpp:267
int rlLon2(int command)
Definition: rlcutil.cpp:405
int rlSetDebugPrintf(int state)
Definition: rlcutil.cpp:54
int rlSwapShort(int val)
Definition: rlcutil.cpp:375
float rlFloatOption(const char *string, const char *option, float _default)
Definition: rlcutil.cpp:655
char * rlstrncpy(char *dest, const char *source, int n)
Definition: rlcutil.cpp:169
int rlFWrite(FILE *fout, void *data, int len)
Definition: rlcutil.cpp:815
int rlvsnprintf(char *text, int len, const char *format, va_list ap)
Definition: rlcutil.cpp:197
int rlCan1(int command)
Definition: rlcutil.cpp:429
int rlInputAvailable()
Definition: rlcutil.cpp:75
int rlupper(char *str)
Definition: rlcutil.cpp:727
int rlBrowser(const char *htmlfile)
Definition: rlcutil.cpp:613
int rllower(char *str)
Definition: rlcutil.cpp:738
int rlDebugPrintf(const char *format,...)
Definition: rlcutil.cpp:61
int rlexec(const char *command)
Definition: rlcutil.cpp:113
int rlStrMatch(const char *str, const char *wild)
Definition: rlcutil.cpp:769
int rlIntOption(const char *string, const char *option, int _default)
Definition: rlcutil.cpp:640
void rlPushToDoubleBuffer(double val, double *buffer, int size)
Definition: rlcutil.cpp:875
int rlProfibus2(int command)
Definition: rlcutil.cpp:421
int rlOption(const char *string, const char *option)
Definition: rlcutil.cpp:631
int rlBitClear(int bitnumber, int *value)
Definition: rlcutil.cpp:853
int rlMkdir(const char *dir, int mode=0744)
Definition: rlcutil.cpp:834
int rlFRead(FILE *fin, void *data, int len)
Definition: rlcutil.cpp:809
int rlStat(const char *filepath, struct stat *buf)
Definition: rlcutil.cpp:804
int rlWriteFile(const char *filename, void *data, int len)
Definition: rlcutil.cpp:821
const char * rlFindFile(const char *pattern, int *context)
Definition: rlcutil.cpp:275
int rlBitChange(int bitnumber, int *value)
Definition: rlcutil.cpp:861
int rlStartsWith(const char *str, const char *startstr)
Definition: rlcutil.cpp:749
int rlsnprintf(char *text, int len, const char *format,...)
Definition: rlcutil.cpp:231
int rlBitSet(int bitnumber, int *value)
Definition: rlcutil.cpp:846
int rlsystem(const char *command)
Definition: rlcutil.cpp:558
const char * rlGetInifile(const char *name)
Definition: rlcutil.cpp:354
int rlCopyTextfile(const char *source, const char *destination)
Definition: rlcutil.cpp:696
const char * rlTextOption(const char *string, const char *option, const char *_default)
Definition: rlcutil.cpp:670
int rlSubmitPvserver(const char *env, const char *path, const char *pvs, const char *options=NULL)
Definition: rlcutil.cpp:567
int rlEndsWith(const char *str, const char *endstr)
Definition: rlcutil.cpp:758
const char * rlpass(const char *p)
Definition: rlcutil.cpp:151
int rlCan2(int command)
Definition: rlcutil.cpp:437
int rlEib2(int command)
Definition: rlcutil.cpp:389
void rlPushToFloatBuffer(float val, float *buffer, int size)
Definition: rlcutil.cpp:882
int rlProfibus1(int command)
Definition: rlcutil.cpp:413
int rlBitTest(int bitnumber, int *value)
Definition: rlcutil.cpp:868