FLCBYT-API FLUC Byte Interface

FLCBYT.h
Go to the documentation of this file.
1
382#ifdef __cplusplus
383 extern "C" {
384#endif
385
386#ifndef INC_FLCBYT_H
387#define INC_FLCBYT_H
390/**********************************************************************/
391
392#include <stddef.h>
393#include <stdint.h>
394#include "FLMRTC.h"
395#include "FLMDEF.h"
396
397/**********************************************************************/
400#define FCB_READ_FILE FLC_READ_FILE
401#define FCB_READ_FORMAT FLC_READ_FORMAT
402#define FCB_WRITE_FILE FLC_WRITE_FILE
403#define FCB_WRITE_FORMAT FLC_WRITE_FORMAT
404#define FCB_CONV_READ FLC_CONV_READ
405#define FCB_CONV_WRITE FLC_CONV_WRITE
406#define FCB_CONV_FROM_TO FLC_CONV_FROM_TO
407#define FCB_INPUT_FILE FLC_INPUT_FILE
408#define FCB_OUTPUT_FILE FLC_OUTPUT_FILE
409#define FCB_INFO FLC_INFO
410#define FCB_STATE FLC_STATE
411
412 extern int* piFcbErrno(void);
414/**********************************************************************/
432#define fcberrno (*piFcbErrno())
433
435/**********************************************************************/
451 extern const char* fcbvsn(void);
452
463 extern const char* fcbabo(void);
464
474 extern const char* fcblic(void);
475
493 extern int fcbenv(const int sys, const int std, const char* env);
494
506 extern char* fcbsym(const char* name,size_t size,char* string);
507
508
556 extern int fcbinfo(const char* infstr, const int format, size_t* bufsiz, char** buffer);
557
558
574 extern int fcbopnlog(const char* logstr);
575
588 extern int fcbgetlog(const char** buffer);
589
597 extern int fcbclrlog(void);
598
607 extern int fcbclslog(void);
608
684 extern void* fcbopen(const char* filstr, const char* fmtstr);
685
750 extern void* fcbopen2(const char* filstr, const char* fmtstr, char** state);
751
764 extern int fcbclose(void* hdl);
765
800 extern int fcbclose2(void* hdl, const int success, const int stafmt, size_t* stasiz, char** stabuf);
801
813 extern const char* fcbgtn(void* hdl);
814
829 extern const char* fcbgfn(void* hdl, const int ind);
830
850 extern const char* fcbstn(void* hdl, const char* name);
851
862 extern int fcbflush(void* hdl);
863
881 extern void* fcbnewmbr(void* hdl, const char* fmtstr,const char* state);
882
899 extern void* fcbnewmbr2(void* hdl, const char* fmtstr,const char* state, const int stafmt, size_t* stasiz, char** stabuf);
900
972 extern void* fcbopenv(void* hdl, const char* cnvstr);
973
985 extern int fcbclosev(void* cnv);
986
1113 extern size_t fcbread(void* ptr, size_t size, size_t count, void* hdl);
1114
1158 extern size_t fcbreadv(void* ptr, size_t size, size_t count, void* hdl, void* cnv, const int skip);
1159
1215 extern size_t fcbwrite(const void *ptr, size_t size, size_t count, void* hdl);
1216
1234 extern size_t fcbwritev(const void *ptr, size_t size, size_t count, void* hdl, void* cnv);
1235
1256 extern int fcbprev(void* hdl);
1257
1258
1271 extern int fcbgetc(void *hdl);
1272
1290 extern int fcbungetc(int chr, void *hdl);
1291
1308 extern int fcbputc(int chr, void *hdl);
1309
1340 extern char *fcbgets(char *str, int n, void *hdl);
1341
1359 extern int fcbputs(const char *str, void *hdl);
1360
1438 extern int fcbconv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1439
1455 extern int fcbconp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1456
1486 extern int fcbrunv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1487
1503 extern int fcbrunp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1504
1526 extern int fcbfinv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1527
1543 extern int fcbfinp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1544
1556 extern int fcbeof(void* hdl);
1557
1569 extern int fcbeot(void* hdl);
1570
1583 extern int fcberror(void* hdl);
1584
1596 extern const char* fcberrms(int code);
1597
1611 extern const char* fcberrtr(void);
1612
1621 extern void fcbclearerr(void* hdl);
1622
1639 extern const char* fcbhelp(const int what, const int depth, const char* path);
1640
1656 extern const char* fcbsyntax(const int what, const int depth, const char* path);
1657
1669 extern const char* fcbcheck(const int what, const char* string);
1670
1694 extern long long int fcbcount(void* hdl, const int direction, const int what, const int kind);
1695
1719 extern void* fcbbini(
1720 const unsigned int mode,
1721 const unsigned int base,
1722 const unsigned int chrs);
1723
1741 extern int fcbbrun(
1742 void* hdl,
1743 const int inlen,
1744 const unsigned char* in,
1745 unsigned char* out);
1746
1764 extern int fcbbfin(
1765 void* hdl,
1766 const int inlen,
1767 const unsigned char* in,
1768 unsigned char* out);
1769
1784 extern int fcbbase(
1785 const unsigned int mode,
1786 const unsigned int base,
1787 const unsigned int chrs,
1788 const int inlen,
1789 const unsigned char* in,
1790 unsigned char* out);
1791
1818 extern void* fcbhini(
1819 const unsigned int hmtd,
1820 const unsigned int kmtd,
1821 const unsigned int keylen,
1822 const unsigned char* key,
1823 const unsigned int icvlen,
1824 const unsigned char* icv);
1825
1837 extern int fcbhadd(
1838 void* hdl,
1839 const unsigned int datlen,
1840 const unsigned char* dat);
1841
1858 extern int fcbhfin(
1859 void* hdl,
1860 unsigned int* hshlen,
1861 unsigned char* hsh);
1862
1882 extern int fcbhash(
1883 const unsigned int hmtd,
1884 const unsigned int kmtd,
1885 const unsigned int keylen,
1886 const unsigned char* key,
1887 const unsigned int icvlen,
1888 const unsigned char* icv,
1889 const unsigned int datlen,
1890 const unsigned char* dat,
1891 unsigned int* hshlen,
1892 unsigned char* hsh);
1893
1894
1896/**********************************************************************/
1898#define FCB_KIND_NONE 0x00000000u
1899#define FCB_KIND_BLOCK 0x00000001u
1900#define FCB_KIND_RECORD 0x00000002u
1901#define FCB_KIND_ELEMENT 0x00000004u
1902#define FCB_KIND_ALL 0xFFFFFFFFu
1903 extern int flopen9(char* pcErr, void** ppGbl,const int sys, const int std, const char* env, const char* param);
1904 extern int flclose9(char* pcErr, void* pvGbl);
1905 extern int fcbvsn9(const int l, const int s, char* b);
1906 extern int fcbabo9(const int l, const int s, char* b);
1907 extern int fcblic9(const int s, char* b);
1908 extern int fcbinfo9(void* pvGbl, char* pcErr, const char* infstr, const int format, size_t* bufsiz, char** buffer, unsigned int* piLen);
1909 extern int fcbopen9(void* pvGbl, char* pcErr, void** ppHdl, const char* filstr, const char* fmtstr, char** state, unsigned int kind, const int64_t offset, const int number, const int isContinue);
1910 extern int fcbnewmbr9(char* pcErr, void* hdl,const char* fmtstr,const char* state, const int stafmt, size_t* stasiz, char** stabuf);
1911 extern int fcbgtn9(char* pcErr, void* hdl, const char** name);
1912 extern int fcbstn9(char* pcErr, void* hdl, const char* name);
1913 extern int fcbgfn9(char* pcErr, void* pvHdl, const int uiIndex, const char** ppName);
1914 extern int fcbflush9(char* pcErr, void* hdl, const int final, const int force);
1915 extern int fcbclose9(char* pcErr, void* hdl, const int success, const int stafmt, size_t* stasiz, char** stabuf, int* ivrSize, char** ivrBuf, int* ivrFmtSize, char** ivrFmtBuf, const int isContinue);
1916 extern int fcbopenv9(void* pvGbl, char* pcErr, void* hdl, void**ppHdl, const char* cnvstr);
1917 extern int fcbclosev9(char* pcErr, void* cnv);
1918 extern int fcbreadv9(char* pcErr, size_t* piRet, void* ptr, size_t size, size_t count, void* hdl, void* cnv, const int skip, size_t* len);
1919 extern int fcbunreadv9(char* pcErr, const void* ptr, size_t size, size_t count, void* hdl, void* cnv);
1920 extern int fcbwritev9(char* pcErr, size_t* piRet, const void *ptr, size_t size, size_t count, void* hdl, void* cnv);
1921 extern int fcbconv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1922 extern int fcbrunv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1923 extern int fcbfinv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1924 extern int fcbconp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1925 extern int fcbrunp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1926 extern int fcbfinp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1927 extern int fcbpos9(char* pcErr, void* hdl, const int64_t offset);
1928 extern int fcbrewind9(char* pcErr, void* pvHdl);
1929 extern int fcbcount9(char* pcErr, void* hdl, const int direction, const int what, const int kind, long long int* piCount);
1930
1931 extern int fcbopnlog9(void* pvGbl, char* pcErr, void** loghdl, const char* logstr);
1932 extern int fcbgetlog9(void* loghdl,const char** buffer);
1933 extern int fcbclrlog9(void* loghdl);
1934 extern int fcbclslog9(void* loghdl);
1935
1936 extern void* fcbpopen(char* errtrc, const char* filstr, const char* fmtstr, char** state, const int64_t offset);
1937 extern int64_t fcbpread(char* errtrc, void* hdl, void* ptr, size_t count, int64_t offset);
1938 extern int64_t fcbpwrite(char* errtrc, void* hdl, const void* ptr, size_t count, int64_t offset);
1939 extern int fcbpclose(char* errtrc, void* hdl, const int success, const int stafmt, size_t* stasiz, char** stabuf, int* ivrSize, char** ivrBuf, int* ivrFmtSize, char** ivrFmtBuf);
1940 extern int fcbpflush(char* errtrc, void* hdl, const int final, const int force);
1941 extern int fcbpfiopar(void* hdl, void** ppFioPar);
1942 extern uint64_t fcbpsize(char* errtrc, const char* filstr, const char* fmtstr);
1943
1944 extern void* fcbopen3(const char* filstr, const char* fmtstr, char** state, const int number); /* only for internal tests*/
1945 extern size_t fcbreadr(void* ptr, size_t size, size_t count, void* hdl, void* cnv, const int skip); /* only for record interface*/
1946 extern int fcbisenvar(const int set);
1947
1949/**********************************************************************/
1950
1952#endif /* INC_FLCBYT_H */
1953
1954#ifdef __cplusplus
1955 }
1956#endif
1959/**********************************************************************/
FLMDEF.h
FLMDEF - External FLAM definitions.
FLMRTC.h
FLMRTC - FLAM-Return-Codes.
fcbenv
int fcbenv(const int sys, const int std, const char *env)
Load the FLAM environment.
fcbsyntax
const char * fcbsyntax(const int what, const int depth, const char *path)
Returns syntax information about the file and format strings.
fcbconp
int fcbconp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Converts independent data blocks (with locate)
fcberrms
const char * fcberrms(int code)
Get error message.
fcbputs
int fcbputs(const char *str, void *hdl)
Writes a null-terminated string.
fcbhash
int fcbhash(const unsigned int hmtd, const unsigned int kmtd, const unsigned int keylen, const unsigned char *key, const unsigned int icvlen, const unsigned char *icv, const unsigned int datlen, const unsigned char *dat, unsigned int *hshlen, unsigned char *hsh)
Calculate hash for a single buffer.
fcbrunp
int fcbrunp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Converts dependent data blocks (with locate)
fcbclslog
int fcbclslog(void)
Close the logging facility.
fcbcount
long long int fcbcount(void *hdl, const int direction, const int what, const int kind)
Determine current amount of processed data.
fcbgetlog
int fcbgetlog(const char **buffer)
Get log information.
fcberror
int fcberror(void *hdl)
Get error code.
fcbgfn
const char * fcbgfn(void *hdl, const int ind)
Returns the current file name.
fcbsym
char * fcbsym(const char *name, size_t size, char *string)
Determines a symbol from environment.
fcbopenv
void * fcbopenv(void *hdl, const char *cnvstr)
Open converter.
fcbbrun
int fcbbrun(void *hdl, const int inlen, const unsigned char *in, unsigned char *out)
En- or Decodes a data buffer.
fcbwrite
size_t fcbwrite(const void *ptr, size_t size, size_t count, void *hdl)
Write data to file.
fcbfinp
int fcbfinp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Finish conversion of dependent data blocks (with locate)
fcbfinv
int fcbfinv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Finish conversion of dependent data blocks (with copy)
fcbeof
int fcbeof(void *hdl)
Returns the end-of-file (EOF) flag.
fcbbase
int fcbbase(const unsigned int mode, const unsigned int base, const unsigned int chrs, const int inlen, const unsigned char *in, unsigned char *out)
Base encoding or decoding for one message.
fcbhadd
int fcbhadd(void *hdl, const unsigned int datlen, const unsigned char *dat)
Adds a buffer of data to the hash calculation.
fcbnewmbr
void * fcbnewmbr(void *hdl, const char *fmtstr, const char *state)
Start with a new member in an open file.
fcbhfin
int fcbhfin(void *hdl, unsigned int *hshlen, unsigned char *hsh)
Finalize hash calculation.
fcbconv
int fcbconv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Converts independent data blocks (with copy)
fcbvsn
const char * fcbvsn(void)
Retrieves version information.
fcbgetc
int fcbgetc(void *hdl)
Gets the next character.
fcbprev
int fcbprev(void *hdl)
Sets the read position to the previous record or element.
fcbflush
int fcbflush(void *hdl)
Flush internal buffers to the file.
fcbgets
char * fcbgets(char *str, int n, void *hdl)
Reads a line.
fcbreadv
size_t fcbreadv(void *ptr, size_t size, size_t count, void *hdl, void *cnv, const int skip)
Read file data with conversion.
fcbopen
void * fcbopen(const char *filstr, const char *fmtstr)
Open file (without state management)
fcbeot
int fcbeot(void *hdl)
Returns the end-of-table (EOT) flag.
fcbclose2
int fcbclose2(void *hdl, const int success, const int stafmt, size_t *stasiz, char **stabuf)
Close file with return of statistics information.
fcbopen2
void * fcbopen2(const char *filstr, const char *fmtstr, char **state)
Open file (with state management)
fcbrunv
int fcbrunv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Converts dependent data blocks (with copy)
fcbclosev
int fcbclosev(void *cnv)
Close a converter.
fcbgtn
const char * fcbgtn(void *hdl)
Returns the current table name.
fcbstn
const char * fcbstn(void *hdl, const char *name)
Sets the current table format.
fcbabo
const char * fcbabo(void)
Retrieves about information.
fcberrtr
const char * fcberrtr(void)
Get error trace.
fcblic
const char * fcblic(void)
Retrieves the license text.
fcbnewmbr2
void * fcbnewmbr2(void *hdl, const char *fmtstr, const char *state, const int stafmt, size_t *stasiz, char **stabuf)
Start with a new member in a open file (with statistics information)
fcbhelp
const char * fcbhelp(const int what, const int depth, const char *path)
Returns help information about the file and format strings.
fcbclrlog
int fcbclrlog(void)
Clear the log information.
fcbclearerr
void fcbclearerr(void *hdl)
Clear error and EOF indicators.
fcbclose
int fcbclose(void *hdl)
Close file (without statistics)
fcbbini
void * fcbbini(const unsigned int mode, const unsigned int base, const unsigned int chrs)
Creates a handle for Base16/32/64 encoding or decoding.
fcbread
size_t fcbread(void *ptr, size_t size, size_t count, void *hdl)
Read file data.
fcbungetc
int fcbungetc(int chr, void *hdl)
Push a character back back to the stream.
fcbcheck
const char * fcbcheck(const int what, const char *string)
Check syntax for a certain CLP string.
fcbputc
int fcbputc(int chr, void *hdl)
Writes a character.
fcbhini
void * fcbhini(const unsigned int hmtd, const unsigned int kmtd, const unsigned int keylen, const unsigned char *key, const unsigned int icvlen, const unsigned char *icv)
Initialize hash calculation.
fcbbfin
int fcbbfin(void *hdl, const int inlen, const unsigned char *in, unsigned char *out)
Finalize en- or decoding.
fcbinfo
int fcbinfo(const char *infstr, const int format, size_t *bufsiz, char **buffer)
Provides various information.
fcbwritev
size_t fcbwritev(const void *ptr, size_t size, size_t count, void *hdl, void *cnv)
Write data to file with conversion.
fcbopnlog
int fcbopnlog(const char *logstr)
Open the logging facility for in-memory logging.