operatingSystem Microsoft OS_ More...
#include "../xa/MS_Def1.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <io.h>#include <direct.h>#include <time.h>#include <sys/stat.h>#include "../ut/ut_txt.h"#include "../ut/ut_os.h"Defines | |
| #define | YES 0 |
| #define | NO 1 |
| #define | PTRSIZ sizeof(void*) |
Functions | |
| int | OS_config () |
| int | OS_ck_libcVersion (int vMaj, int vMin) |
| BOOL CALLBACK | OS_hide_winCB (HWND hw1, LPARAM lParam) |
| char * | OS_os_s () |
| int | OS_os_bits () |
| int | OS_hide_win () |
| int | OS_TimeStamp (TimeStamp *ts1) |
| double | OS_rTime () |
| int | OS_edit_ (char *filnam) |
| char * | OS_get_lang () |
| char * | OS_get_term () |
| char * | OS_get_vwr_ps () |
| char * | OS_get_user () |
| int | OS_browse_ (char *filnam) |
| char * | OS_get_browser () |
| void | OS_time (long *i1, long *i2, long *i3) |
| void | OS_date (long *i1, long *i2, long *i3) |
| char * | OS_date1 () |
| int | OS_Init_ (char *cmd) |
| int | OS_system (char *buf) |
| int | OS_exec (char *txt) |
| ================================================================ | |
| int | OS_get_dialog () |
| char * | OS_get_edi () |
| char * | OS_get_printer () |
| 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_bas_dir () |
| int | OS_spawn_wait (char *cmd, int iwait) |
| void | OS_Wait (int millisecs) |
| void | OS_beep () |
| int | OS_checkFilExist (char *filnam, int mode) |
| int | OS_checkDirExist (char *dirnam) |
| long | OS_FilSiz (char *filnam) |
| int | OS_check_isDir (char *dirnam) |
| 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) |
| int | OS_filterff (char *fnamO, char *fnamI, char *ftext) |
| int | OS_file_delGrp (char *fNam) |
| int | OS_file_copy (char *oldNam, char *newNam) |
| 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_dll__ (int mode, void *fDat) |
| int | OS_debug_dll_ (char *dllNam) |
| int | OS_dll_do (char *dllNam, char *fncnam, void *fncdat) |
| int | OS_dll_run (char *dllNam, char *fncNam, char *fncDat) |
| int | OS_ck_DirAbs (char *fNam) |
| int | OS_dirAbs_fNam (char *dirOut, char *fNam) |
| int | OS_file_zip (int mode, char *fnFrom, char *fnTo) |
| int | OS_file_concat (char *fno, char *fn1, char *fn2) |
| char * | OS_get_imgConv1 () |
| ================================================================ | |
| int | OS_CkPrcIsActive (char *prcNam) |
| int | OS_ckFileWritable (char *fnam) |
| ================================================================ | |
| int | OS_dev_ck () |
| int | OS_file_sig_get (char *fnam) |
| int | OS_file_sig_cre (char *fnam, int iSig) |
| int | OS_err1 (char *fNam) |
Variables | |
| static char | os_bin_dir [256] |
| static char | os_bas_dir [256] = "" |
| static char | os_doc_dir [256] |
| static char | os_loc_dir [256] = "" |
| static char | os_tmp_dir [256] = "" |
| static char | os_ico_dir [256] |
| static char | txbuf [256] |
operatingSystem Microsoft OS_
===================================================== Liste_Funktionen_Beginn: OS_hide_win nur MS-Windows see ../ut/ut_os_aix.c Liste_Funktionen_Ende: ===================================================== // Mircosoft-Test: MS-CompilerVersion; 2010=1600 #ifdef _MSC_VER printf(" %d\n",_MSC_VER); // Mircosoft-Windows-test 32-or-64-Bit: #ifdef _WIN64 printf("This is a MS64-OS ! \n"); printf(" _WIN64 %d\n",_WIN64); #else printf("This is a MS32-OS ! \n"); #endif #else // Linux #ifdef _LP64 // Linux64 #else // Linux32 #endif
| #define YES 0 |
| #define NO 1 |
| #define PTRSIZ sizeof(void*) |
| int OS_config | ( | ) |
| 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>
| BOOL CALLBACK OS_hide_winCB | ( | HWND | hw1, | |
| LPARAM | lParam | |||
| ) |
| char* OS_os_s | ( | ) |
| int OS_os_bits | ( | ) |
| int OS_hide_win | ( | ) |
| int OS_TimeStamp | ( | TimeStamp * | ts1 | ) |
OS_TimeStamp get TimeStamp (sec; res = 0.01; ~1 year)
static TimeStamp TimeStamp = 0; OS_TimeStamp (&Memspc.ts); // in UME_create if(Memspc.ts != TimeStamp) {update; TimeStamp = Memspc.ts; }
| double OS_rTime | ( | ) |
OS_rTime returns time in sec's, (res = mycrosec's)
| int OS_edit_ | ( | char * | filnam | ) |
| char* OS_get_lang | ( | ) |
returns language; eg "de" or "en"
| char* OS_get_term | ( | ) |
| char* OS_get_vwr_ps | ( | ) |
returns ps-viewer (gv|evince)
| char* OS_get_user | ( | ) |
returns console-program; eg "xterm -e "
| int OS_browse_ | ( | char * | filnam | ) |
html-browse <filnam>
do not wait for end of process.
| char* OS_get_browser | ( | ) |
returns html-browser; eg "mozilla"
| void OS_time | ( | long * | i1, | |
| long * | i2, | |||
| long * | i3 | |||
| ) |
OS_time returns (hour, min, sec)
| 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());
| int OS_Init_ | ( | char * | cmd | ) |
| int OS_system | ( | char * | buf | ) |
OS_system Perform OS-Command; wait for completion (system)
| int OS_exec | ( | char * | txt | ) |
================================================================
================================================================ OS_exec Perform OS-Command; do not wait for completion.
| int OS_get_dialog | ( | ) |
check if zenity is installed
| char* OS_get_edi | ( | ) |
returns fileEditorProgram; eg "gedit " or "kedit "
| char* OS_get_printer | ( | ) |
get 1. word of /etc/printcap
| 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 "binLinux32"
| char* OS_get_doc_dir | ( | ) |
OS_get_doc_dir returns path of docu
| char* OS_get_bas_dir | ( | ) |
returns base-directory (= home of main-executable, $gcad_dir_bas) usage: strcat (cmdBuf, OS_get_bas_dir ()); liefert "/mnt/F/dev/" - wo das exe herstammt !
| int OS_spawn_wait | ( | char * | cmd, | |
| int | iwait | |||
| ) |
| void OS_Wait | ( | int | millisecs | ) |
wait - milli-seconds (<millisecs> * 0.001 seconds)
| void OS_beep | ( | ) |
| 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
| int OS_check_isDir | ( | char * | dirnam | ) |
| 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.
| int OS_filterff | ( | char * | fnamO, | |
| char * | fnamI, | |||
| char * | ftext | |||
| ) |
| int OS_file_delGrp | ( | char * | fNam | ) |
| int OS_file_copy | ( | char * | oldNam, | |
| char * | newNam | |||
| ) |
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_dll__ | ( | int | mode, | |
| void * | fDat | |||
| ) |
| int OS_debug_dll_ | ( | char * | dllNam | ) |
wenn im Debug-Modus wird hier gestoppt;
In .gdbinit muss stehen:
break OS_debug_dll_
wenn Debugger steht, eingeben "watch varnam" und "c"
Zweck: Debugger kann DLL nur ansprechen wenn geladen.
| int OS_dll_do | ( | char * | dllNam, | |
| char * | fncnam, | |||
| void * | fncdat | |||
| ) |
load dll; start function fncNam (fncDat); unload dll.
| int OS_dll_run | ( | char * | dllNam, | |
| char * | fncNam, | |||
| char * | fncDat | |||
| ) |
| int OS_ck_DirAbs | ( | char * | fNam | ) |
| int OS_dirAbs_fNam | ( | char * | dirOut, | |
| char * | fNam | |||
| ) |
| int OS_file_zip | ( | int | mode, | |
| char * | fnFrom, | |||
| char * | fnTo | |||
| ) |
| int OS_file_concat | ( | char * | fno, | |
| char * | fn1, | |||
| char * | fn2 | |||
| ) |
| char* OS_get_imgConv1 | ( | ) |
================================================================
================================================================ returns jpg2bmp-converter-program.
| int OS_CkPrcIsActive | ( | char * | prcNam | ) |
| int OS_ckFileWritable | ( | char * | fnam | ) |
================================================================
================================================================ OS_checkFileWritable check if file is writeable; 0=no, 1=yes.
| int OS_dev_ck | ( | ) |
| int OS_file_sig_get | ( | char * | fnam | ) |
OS_file_sig_get returns content of file as integer RetCod: -1 = Error, else c9ontent of first line of file
| int OS_file_sig_cre | ( | char * | fnam, | |
| int | iSig | |||
| ) |
OS_file_sig_cre create signal-file Input: fnam if(fnam) then clear (delete) this file; keep fnam static. else write <iSig> into this file
char os_bin_dir[256] [static] |
char os_bas_dir[256] = "" [static] |
char os_doc_dir[256] [static] |
char os_loc_dir[256] = "" [static] |
char os_tmp_dir[256] = "" [static] |
char os_ico_dir[256] [static] |
char txbuf[256] [static] |
1.6.3