gCAD3D 2.35
ut_os.h File Reference

Go to the source code of this file.

Macros

#define TimeStamp   float
 

Functions

int OS_Init_ (char *cmd)
 
char * OS_os_c ()
 
void OS_date (long *i1, long *i2, long *i3)
 
char * OS_date1 ()
 
void OS_time (long *i1, long *i2, long *i3)
 
double OS_rTime ()
 
double OS_prc_time_diff (double timStart)
 
double OS_prc_time_start ()
 
int OS_system (char *buf)
 
int OS_browse_ (char *filnam)
 
void OS_Wait (int millisecs)
 
void OS_beep ()
 
char * OS_prc__ ()
 
int OS_check_isDir (char *dirnam)
 
int OS_checkFilExist (char *filnam, int mode)
 
int OS_checkDirExist (char *dirnam)
 
long OS_FilSiz (char *filnam)
 
int OS_dir_root (char *cbuf, int csiz)
 
int OS_dir_ck1 (char *p1)
 
int OS_dir_ck2 (char *p1)
 
int OS_dir_scan_ (char *cbuf, int *iNr)
 
void OS_get_curDir (char *sd, int sSiz)
 
char * OS_get_bas_dir ()
 
char * OS_get_tmp_dir ()
 
char * OS_get_loc_dir ()
 
char * OS_get_cfg_dir ()
 
char * OS_get_ico_dir ()
 
char * OS_get_bin_dir ()
 
char * OS_get_doc_dir ()
 
char * OS_get_edi ()
 
char * OS_get_lang ()
 
char * OS_get_browser ()
 
char * OS_get_printer ()
 
char * OS_get_imgConv1 ()
 ================================================================ More...
 
char * OS_get_vwr_ps ()
 
char * OS_os_s ()
 
char * OS_get_dir_pwd ()
 
int OS_file_copy (char *fnOld, char *fnNew)
 
int OS_file_rename (char *fnOld, char *fnNew)
 
int OS_file_delete (char *fNam)
 
int OS_file_readm1 (char *cbuf, int cSiz, char *fnam)
 
int OS_file_waitExist (char *fn, int maxTim)
 
int OS_dll__ (void **dll, int mode, void *fDat)
 
int OS_dll_global (char *dllNam)
 
int OS_debug_dll_ (char *dllNam)
 
int OS_ck_libcVersion (int vMaj, int vMin)
 
int OS_file_sig_cre (int mode, void *data)
 
int OS_file_sig_wait (int mode, void *data)
 
int OS_stdout__ (int mode, char *fn)
 

Macro Definition Documentation

#define TimeStamp   float

Function Documentation

int OS_Init_ ( char *  cmd)
char* OS_os_c ( )
void OS_date ( long *  i1,
long *  i2,
long *  i3 
)

OS_date returns (year, mon, day)

char* OS_date1 ( )
Format: 2002/09/04-13:30:33
printf ("# %s\n", OS_date1());
Format: 2002/09/04-13:30:33
printf ("# %s\n", OS_date1());
void OS_time ( long *  i1,
long *  i2,
long *  i3 
)

OS_time returns (hour, min, sec)

double OS_rTime ( )
OS_rTime returns time in sec's, (res = mycrosec's)
Example:
d1 = OS_rTime (); ... d2 = OS_rTime ();
printf(" time used (secs) %lf \n",d2 - d1);

OS_rTime returns time in sec's, (res = mycrosec's)

double OS_prc_time_diff ( double  timStart)
OS_prc_time_diff returns processor-time
processor-time does not include usleep ..
Example:
d1 = OS_prc_start_time();
..
printf(" processor-time used (secs) %lf \n", OS_prc_diff_time(d1));
OS_prc_time_diff returns processor-time
processor-time does not include usleep ..
Example:
d1 = OS_prc_start_time();
..
printf(" processor-time used (secs) %lf \n", OS_prc_diff_time(d1));
double OS_prc_time_start ( )
OS_prc_time_start returns processor-time
OS_prc_time_start returns processor-time
int OS_system ( char *  buf)

OS_system Perform OS-Command; wait for completion (system)

int OS_browse_ ( char *  filnam)
html-browse <filnam>
do not wait for end of process.
void OS_Wait ( int  millisecs)

wait - milli-seconds (<millisecs> * 0.001 seconds)

void OS_beep ( )
char* OS_prc__ ( )

OS_prc__ get full filename of active process

OS_prc__ get full filename of active process

int OS_check_isDir ( char *  dirnam)
returns if {dirnam} is directory or file
rc = 1 = OFF = NO; dirnam is NOT directory
rc = 0 = ON = OK; dirnam is directory.
rc = -1 = Error - dirnam does not exist
int OS_checkFilExist ( char *  filnam,
int  mode 
)
OS_checkFilExist check if File or Directory exists
mode = 0: display message sofort;
mode = 1: just fix returncode, no message
mode = 2: make Errormessage (TX_Error) if File does not exist
rc = 0 = Fehler; datei existiert NICHT.
rc = 1 = OK, Datei existiert.
int OS_checkDirExist ( char *  dirnam)
if dir dirnam does not exist, try to create it.
Nur testen ob directory existiert: use OS_checkFilExist.
rc = 0 = Fehler; Dir existiert NICHT.
rc = 1 = Dir sucessfully created.
rc = 2 = Dir did already exist.
long OS_FilSiz ( char *  filnam)

OS_FilSiz returns filesize in bytes

OS_FilSiz returns filesize in bytes

int OS_dir_root ( char *  cbuf,
int  csiz 
)

OS_dir_root returns a list of root-directories

int OS_dir_ck1 ( char *  p1)
check rootDir
irc=0 CD-Rom,
1 Diskette,
2 normal
int OS_dir_ck2 ( char *  p1)
check if directory is writable
irc=0=no, not writable,
1=jes, directory is writable
int OS_dir_scan_ ( char *  cbuf,
int *  iNr 
)
scan directory
iNr = 0: init suche; zu scannender Pfad ist cbuf.
iNr > 0: cbuf ist next found file; do not change iNr! (Filename ohne Path !)
iNr < 0; kein weiteres File found; directory closed.
scan directory
iNr = 0: init suche; zu scannender Pfad ist cbuf.
iNr > 0: cbuf ist next found file; do not change iNr! (Filename ohne Path !)
iNr < 0; kein weiteres File found; directory closed.
void OS_get_curDir ( char *  sd,
int  sSiz 
)

OS_get_curDir get current directory

OS_get_curDir get current directory

char* OS_get_bas_dir ( )

OS_get_bas_dir returns path of ?

char* OS_get_tmp_dir ( )

returns tempDir (with closing '/') <gcad_dir_local>tmp/

char* OS_get_loc_dir ( )

returns confDir (with closing '/') <gcad_dir_local>xa/

char* OS_get_cfg_dir ( )

returns confDir (with closing '/') <gcad_dir_local>xa/

char* OS_get_ico_dir ( )

returns directory for icons (with closing '/') <gcad_dir_bin>icons/

char* OS_get_bin_dir ( )

OS_get_bin_dir returns path of executables, $gcad_dir_bin

char* OS_get_doc_dir ( )

OS_get_doc_dir returns path of docu

char* OS_get_edi ( )

returns fileEditorProgram; eg "gedit " or "kedit "

char* OS_get_lang ( )

returns language; eg "de" or "en"

char* OS_get_browser ( )

returns html-browser; eg "mozilla"

char* OS_get_printer ( )

get 1. word of /etc/printcap

char* OS_get_imgConv1 ( )

================================================================

returns jpg2bmp-converter-program; eg /usr/bin/djpeg

================================================================ returns jpg2bmp-converter-program.

char* OS_get_vwr_ps ( )

returns ps-viewer (gv|evince)

returns ps-viewer (gv|evince)

char* OS_os_s ( )
char* OS_get_dir_pwd ( )

OS_get_dir_pwd get current process-working-directory "PWD"

int OS_file_copy ( char *  fnOld,
char *  fnNew 
)

OS_file_copy copy file

int OS_file_rename ( char *  fnOld,
char *  fnNew 
)

rename File; NO Wildcards !

int OS_file_delete ( char *  fNam)

delete File; NO Wildcards !

int OS_file_readm1 ( char *  cbuf,
int  cSiz,
char *  fnam 
)
read complete file into memory
Datei fnam in den Buff cbuf einlesen.
cSiz = size of cbuf
Retcode:
-1 Error
>0 size of file
int OS_file_waitExist ( char *  fn,
int  maxTim 
)
int OS_dll__ ( void **  dll,
int  mode,
void *  fDat 
)
load dll | start dll-function | unload dll
Input:
mode
FUNC_LOAD_only = load DLL. fDat: dll-name without directory, fTyp.
FUNC_LOAD_all = load DLL. fDat: dll-name without directory, fTyp.
FUNC_CONNECT = connect (connect Func fDat)
FUNC_EXEC = work (call active Func with parameter fDat)
FUNC_UNLOAD = unload active lib; fDat unused
FUNC_RECOMPILE = recompile DLL; fDat ?
Output:
dll (address of) loaded DLL
retCod 0=OK; else error
load dll | start dll-function | unload dll
Input:
mode FUNC_LOAD = load DLL. fDat: dll-name without directory, fTyp.
FUNC_CONNECT = connect (connect Func fDat)
FUNC_EXEC = work (call active Func with parameter fDat)
FUNC_UNLOAD = unload active lib
FUNC_RECOMPILE = recompile DLL
Output:
dll (address of) loaded DLL
retCod 0=OK; else error
int OS_dll_global ( char *  dllNam)
int OS_debug_dll_ ( char *  dllNam)
wenn im Debug-Modus wird hier gestoppt;
In .gdbinit muss stehen:
wenn Debugger steht, eingeben "watch varnam" und "c"
Zweck: Debugger kann DLL nur ansprechen wenn geladen.
int OS_ck_libcVersion ( int  vMaj,
int  vMin 
)
test if new software with Lib-version <versionLinked> can be used.
<versionLinked> must be equal or less then the active Lib-version.
View the active GNU-Lib-version in a shell with "/lib/libc.so.6"
Mandriva 2009 reports "glibc 2.8"
Input:
versionLinked of the software at the time of binding
RetCod: 0 OK; active-libc-version is >= <versionLinked>
-1 Error; active-libc-version is < <versionLinked>
int OS_file_sig_cre ( int  mode,
void *  data 
)
OS_file_sig_cre create signal-file
Input:
mode 0 clear file; data = signalfilename; must be done first
1 write data = string (null terminated) -> signalfile
2 write data = int (4 bytes) -> signalfile
99 cancelled by user (following read gives retCod -1)
-1 read data = string (null terminated) -> data (size of data !)
-2 read data = int (4 bytes) -> data
Output:
data text or int (mode);
RetCod: 0 OK, data valid
-1 cancelled by user
int OS_file_sig_wait ( int  mode,
void *  data 
)

RetCod: 0 OK, data valid -1 cancelled by user

int OS_stdout__ ( int  mode,
char *  fn 
)

OS_stdout__ direct console-output into file mode 0 open file for console-output 1 reconnect stdout

OS_stdout__ direct console-output into file mode 0 open file for console-output 1 reconnect stdout DOES NOT WORK !