C-KIT-GUI-GTK 0.62
ckit_ut.c File Reference

utility-functions More...

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include <sys/stat.h>
#include "../ut/ckit_ut.h"
#include "../ut/ut_cast.h"
#include "../ut/ut_umem.h"

Macros

#define ON   0
 
#define OFF   1
 

Functions

void UTX_str_file (char *txbuf, long *fSiz, char *fnam)
 
int UTX_ck_num_i (char *s1)
 
int CSV_read__ (CSV_struct *fTyp, char *sb, int sSiz, FILE *fpi)
 
int UTX_wrf_str (char *fnam, char *txt)
 
int MSG_Tip (char *key)
 
int UTI_round_i2b (int i1)
 
int UTI_round_b2i (int i1)
 
int UTX_cnr_chr (char *txt, char c1)
 
char * UTX_CleanCR (char *string)
 
int UTX_endDelChar (char *txtbuf, char chr)
 
int MSG_get_1 (char *msg, int msgSiz, char *key, char *fmt,...)
 
int MSG_err_1 (char *key, char *fmt,...)
 
int MSG_pri_1 (char *key, char *fmt,...)
 
char * MSG_get_str (char *key)
 
int gCad_fini ()
 
void TX_Print (char *txt,...)
 ========================================================== More...
 
void TX_Error (char *txt,...)
 ========================================================== More...
 
void TX_Write (char *txt)
 ========================================================== More...
 
int UTX_fgetLine (char *cbuf, int sizBuf, char *filNam, int lNr)
 
int UTX_tmp_file (char *fBuf, long *fSiz, char *fNam)
 

Variables

int TX_mode = ON
 

Detailed Description

utility-functions

utility-functions for Gui-Toolbox only

=====================================================
List_functions_start:
UTX_fgetLine read line nr. <lNr> out of file <filNam>
UTX_wrf_str write string -> file
UTX_tmp_file get file into temp. memspc
UTX_str_file read file -> string
UTX_ck_num_i test if word is numeric (int)
UTI_round_i2b round integer to byte (back: UTI_round_b2i)
UTI_round_b2i make integer from byte (back from UTI_round_i2b)
CSV_read__ read/decode next line in csv-file
MSG_get_1 DUMMY
MSG_err_1 DUMMY
MSG_pri_1 DUMMY
gCad_fini DUMMY
List_functions_end:
=====================================================
cc -c gui_gtk_ut.c

Macro Definition Documentation

#define ON   0
#define OFF   1

Function Documentation

void UTX_str_file ( char *  txbuf,
long *  fSiz,
char *  fnam 
)

UTX_str_file read file -> string Used by UTX_tmp_file() fSiz must have filesize; see OS_FilSiz.

int UTX_ck_num_i ( char *  s1)
UTX_ck_num_i test if word is numeric (int)
RetCod: -1 s1 does NOT start with an integer
else nr of characters (including sign)
int CSV_read__ ( CSV_struct fTyp,
char *  sb,
int  sSiz,
FILE *  fpi 
)
int UTX_wrf_str ( char *  fnam,
char *  txt 
)
UTX_wrf_str write string -> file
see UTF_wrf_line
int MSG_Tip ( char *  key)
dummyfunction for MSG_Tip
MSG_Tip add tooltip to last created GUI-widget
msg out of files msg_de.txt msg_en.txt ..
int UTI_round_i2b ( int  i1)
UTI_round_i2b round integer to byte (back: UTI_round_b2i)
Purpose: save Integers in a single byte.
UTI_round_i2b(10000) -> 14
UTI_round_b2i(14) -> 16384
int UTI_round_b2i ( int  i1)

UTI_round_b2i make integer from byte (back from UTI_round_i2b)

int UTX_cnr_chr ( char *  txt,
char  c1 
)

returns nr of char c1 in string txt

char* UTX_CleanCR ( char *  string)
UTX_CleanCR Delete Blanks, CR's and LF's at end of string
returns positon of stringterminator \0
int UTX_endDelChar ( char *  txtbuf,
char  chr 
)

UTX_endDelChar if last char of string == chr: remove it.

int MSG_get_1 ( char *  msg,
int  msgSiz,
char *  key,
char *  fmt,
  ... 
)
int MSG_err_1 ( char *  key,
char *  fmt,
  ... 
)
int MSG_pri_1 ( char *  key,
char *  fmt,
  ... 
)
char* MSG_get_str ( char *  key)
int gCad_fini ( )
void TX_Print ( char *  txt,
  ... 
)

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

========================================================== formatiertes Rausschreiben; wie bei printf; mehr als 4 Parm's Problem?

void TX_Error ( char *  txt,
  ... 
)

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

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

void TX_Write ( char *  txt)

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

========================================================== direkt rausschreiben.

int UTX_fgetLine ( char *  cbuf,
int  sizBuf,
char *  filNam,
int  lNr 
)
UTX_fgetLine read line nr. <lNr> out of file <filNam>
first line has lineNr 1
sizBuf size of cbuf
rc -1 File does not exist
rc -2 Line does not exist
rc 0 OK
int UTX_tmp_file ( char *  fBuf,
long *  fSiz,
char *  fNam 
)

Variable Documentation

int TX_mode = ON