FLCBYT-API
FLUC Byte Interface Version: 5.2.0-38401
FLCBYT.h
Go to the documentation of this file.
1
380
381#ifndef INC_FLCBYT_H
382#define INC_FLCBYT_H
384#ifdef __cplusplus
385 extern "C" {
386#endif
387
389
390/**********************************************************************/
391
392#include <stddef.h>
393#include <stdint.h>
394#include "FLMRTC.h"
395#include "FLMDEF.h"
396
397/**********************************************************************/
399
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
412extern int isFcbEnvar;
413
414extern int* piFcbErrno(void);
416/**********************************************************************/
422
434#define fcberrno (*piFcbErrno())
435
437/**********************************************************************/
443
453extern const char* fcbvsn(void);
454
465extern const char* fcbabo(void);
466
476extern const char* fcblic(void);
477
491extern int fcbrand(const int len, unsigned char* dat);
492
510extern int fcbenv(const int sys, const int std, const char* env);
511
523extern char* fcbsym(const char* name,size_t size,char* string);
524
525
573extern int fcbinfo(const char* infstr, const int format, size_t* bufsiz, char** buffer);
574
575
591extern int fcbopnlog(const char* logstr);
592
605extern int fcbgetlog(const char** buffer);
606
614extern int fcbclrlog(void);
615
624extern int fcbclslog(void);
625
701extern void* fcbopen(const char* filstr, const char* fmtstr);
702
767extern void* fcbopen2(const char* filstr, const char* fmtstr, char** state);
768
781extern int fcbclose(void* hdl);
782
817extern int fcbclose2(void* hdl, const int success, const int stafmt, size_t* stasiz, char** stabuf);
818
830extern const char* fcbgtn(void* hdl);
831
846extern const char* fcbgfn(void* hdl, const int ind);
847
867extern const char* fcbstn(void* hdl, const char* name);
868
879extern int fcbflush(void* hdl);
880
898extern void* fcbnewmbr(void* hdl, const char* fmtstr,const char* state);
899
916extern void* fcbnewmbr2(void* hdl, const char* fmtstr,const char* state, const int stafmt, size_t* stasiz, char** stabuf);
917
989extern void* fcbopenv(void* hdl, const char* cnvstr);
990
1002extern int fcbclosev(void* cnv);
1003
1130extern size_t fcbread(void* ptr, size_t size, size_t count, void* hdl);
1131
1175extern size_t fcbreadv(void* ptr, size_t size, size_t count, void* hdl, void* cnv, const int skip);
1176
1232extern size_t fcbwrite(const void *ptr, size_t size, size_t count, void* hdl);
1233
1251extern size_t fcbwritev(const void *ptr, size_t size, size_t count, void* hdl, void* cnv);
1252
1273extern int fcbprev(void* hdl);
1274
1275
1288extern int fcbgetc(void *hdl);
1289
1307extern int fcbungetc(int chr, void *hdl);
1308
1325extern int fcbputc(int chr, void *hdl);
1326
1357extern char *fcbgets(char *str, int n, void *hdl);
1358
1376extern int fcbputs(const char *str, void *hdl);
1377
1455extern int fcbconv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1456
1472extern int fcbconp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1473
1503extern int fcbrunv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1504
1520extern int fcbrunp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1521
1543extern int fcbfinv(void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1544
1560extern int fcbfinp(void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1561
1573extern int fcbeof(void* hdl);
1574
1586extern int fcbeot(void* hdl);
1587
1600extern int fcberror(void* hdl);
1601
1613extern const char* fcberrms(const int code);
1614
1628extern const char* fcberrtr(void);
1629
1638extern void fcbclearerr(void* hdl);
1639
1656extern const char* fcbhelp(const int what, const int depth, const char* path);
1657
1673extern const char* fcbsyntax(const int what, const int depth, const char* path);
1674
1686extern const char* fcbcheck(const int what, const char* string);
1687
1711extern long long int fcbcount(void* hdl, const int direction, const int what, const int kind);
1712
1736extern void* fcbbini(
1737 const unsigned int mode,
1738 const unsigned int base,
1739 const unsigned int chrs);
1740
1758extern int fcbbrun(
1759 void* hdl,
1760 const int inlen,
1761 const unsigned char* in,
1762 unsigned char* out);
1763
1781extern int fcbbfin(
1782 void* hdl,
1783 const int inlen,
1784 const unsigned char* in,
1785 unsigned char* out);
1786
1801extern int fcbbase(
1802 const unsigned int mode,
1803 const unsigned int base,
1804 const unsigned int chrs,
1805 const int inlen,
1806 const unsigned char* in,
1807 unsigned char* out);
1808
1835extern void* fcbhini(
1836 const unsigned int hmtd,
1837 const unsigned int kmtd,
1838 const unsigned int keylen,
1839 const unsigned char* key,
1840 const unsigned int icvlen,
1841 const unsigned char* icv);
1842
1854extern int fcbhadd(
1855 void* hdl,
1856 const unsigned int datlen,
1857 const unsigned char* dat);
1858
1875extern int fcbhfin(
1876 void* hdl,
1877 unsigned int* hshlen,
1878 unsigned char* hsh);
1879
1899extern int fcbhash(
1900 const unsigned int hmtd,
1901 const unsigned int kmtd,
1902 const unsigned int keylen,
1903 const unsigned char* key,
1904 const unsigned int icvlen,
1905 const unsigned char* icv,
1906 const unsigned int datlen,
1907 const unsigned char* dat,
1908 unsigned int* hshlen,
1909 unsigned char* hsh);
1910
1911
1913/**********************************************************************/
1915#define FCB_KIND_NONE 0x00000000u
1916#define FCB_KIND_BLOCK 0x00000001u
1917#define FCB_KIND_RECORD 0x00000002u
1918#define FCB_KIND_ELEMENT 0x00000004u
1919#define FCB_KIND_ALL 0xFFFFFFFFu
1920extern int fcbhelp9(char* pcErr, const int siWhat, const int siDepth, const char* pcPath, size_t* pzOut, char** ppOut);
1921extern int fcbsyntax9(char* pcErr, const int siWhat, const int siDepth, const char* pcPath,size_t* pzOut, char** ppOut);
1922extern int fcbcheck9(char* pcErr, const int siWhat, const char* pcString, size_t* pzOut, char** ppOut);
1923extern int flopen9(char* pcErr, void** ppGbl,const int sys, const int std, const char* env, const char* log);
1924extern int flclose9(void* pvGbl);
1925extern int fcbvsn9(const int l, const int s, char* b);
1926extern int fcbabo9(const int l, const int s, char* b);
1927extern int fcblic9(const int s, char* b);
1928extern int fcbinfo9(void* pvGbl, char* pcErr, const char* infstr, const int format, size_t* bufsiz, char** buffer, unsigned int* piLen);
1929extern 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);
1930extern int fcbnewmbr9(char* pcErr, void* hdl,const char* fmtstr,const char* state, const int stafmt, size_t* stasiz, char** stabuf);
1931extern int fcbgtn9(char* pcErr, void* hdl, const char** name);
1932extern int fcbstn9(char* pcErr, void* hdl, const char* name);
1933extern int fcbgfn9(char* pcErr, void* pvHdl, const int uiIndex, const char** ppName);
1934extern int fcbflush9(char* pcErr, void* hdl, const int final, const int force);
1935extern 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);
1936extern int fcbopenv9(void* pvGbl, char* pcErr, void* hdl, void**ppHdl, const char* cnvstr);
1937extern int fcbclosev9(char* pcErr, void* cnv);
1938extern 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);
1939extern int fcbunreadv9(char* pcErr, const void* ptr, size_t size, size_t count, void* hdl, void* cnv);
1940extern int fcbwritev9(char* pcErr, size_t* piRet, const void *ptr, size_t size, size_t count, void* hdl, void* cnv);
1941extern int fcbconv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1942extern int fcbrunv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1943extern int fcbfinv9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void* out);
1944extern int fcbconp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1945extern int fcbrunp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1946extern int fcbfinp9(char* pcErr, void* cnv, size_t inplen, const void* inp, size_t* outlen, void** out);
1947extern int fcbpos9(char* pcErr, void* hdl, const int64_t offset);
1948extern int fcbrewind9(char* pcErr, void* pvHdl);
1949extern int fcbcount9(char* pcErr, void* hdl, const int direction, const int what, const int kind, long long int* count);
1950
1951extern int flopnlog9(void* pvGbl, char* pcErr, void** loghdl, const char* logstr);
1952extern int flgetlog9(void* loghdl,const char** buffer);
1953extern int flclrlog9(void* loghdl);
1954extern int flclslog9(void* loghdl);
1955
1956extern void* fcbpopen(char* errtrc, const char* filstr, const char* fmtstr, char** state, const int64_t offset);
1957extern int64_t fcbpread(char* errtrc, void* hdl, void* ptr, size_t count, int64_t offset);
1958extern int64_t fcbpwrite(char* errtrc, void* hdl, const void* ptr, size_t count, int64_t offset);
1959extern 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);
1960extern int fcbpflush(char* errtrc, void* hdl, const int final, const int force);
1961
1983extern int fcbcopy(const char* redstr, const char* fmtstr, const char* wrtstr, const int stafmt, size_t* stasiz, char** stabuf);
1984extern int fcbcopy9(void* pvGbl, char* pcErr, const char* redstr, const char* fmtstr, const char* wrtstr, const int stafmt, size_t* stasiz, char** stabuf);
1985
1986extern int fcbpfiopar(void* hdl, void** ppFioPar);
1987extern uint64_t fcbpsize(char* errtrc, const char* filstr, const char* fmtstr);
1988
1989extern void* fcbopen3(const char* filstr, const char* fmtstr, char** state, const int number); /* only for internal tests*/
1990extern size_t fcbreadr(void* ptr, size_t size, size_t count, void* hdl, void* cnv, const int skip); /* only for record interface*/
1991extern int fcbisenvar(const int set);
1992extern char* fcbpcerr(void);
1993
1994extern void* pvFcbGetCnvRedHdl(void* pvHdl);
1995extern void* pvFcbGetCnvWrtHdl(void* pvHdl);
1996
1998/**********************************************************************/
1999
2001
2002#ifdef __cplusplus
2003 }
2004#endif
2006#endif /* INC_FLCBYT_H */
2007
2008/**********************************************************************/
FLMDEF - External FLAM definitions.
FLMRTC - FLAM-Return-Codes.
int fcbenv(const int sys, const int std, const char *env)
Load the FLAM environment.
const char * fcbsyntax(const int what, const int depth, const char *path)
Returns syntax information about the file and format strings.
int fcbconp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Converts independent data blocks (with locate).
int fcbputs(const char *str, void *hdl)
Writes a null-terminated string.
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.
int fcbrunp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Converts dependent data blocks (with locate).
int fcbclslog(void)
Close the logging facility.
long long int fcbcount(void *hdl, const int direction, const int what, const int kind)
Determine current amount of processed data.
int fcbgetlog(const char **buffer)
Get log information.
int fcberror(void *hdl)
Get error code.
const char * fcbgfn(void *hdl, const int ind)
Returns the current file name.
char * fcbsym(const char *name, size_t size, char *string)
Determines a symbol from environment.
void * fcbopenv(void *hdl, const char *cnvstr)
Open converter.
int fcbbrun(void *hdl, const int inlen, const unsigned char *in, unsigned char *out)
En- or Decodes a data buffer.
size_t fcbwrite(const void *ptr, size_t size, size_t count, void *hdl)
Write data to file.
int fcbfinp(void *cnv, size_t inplen, const void *inp, size_t *outlen, void **out)
Finish conversion of dependent data blocks (with locate).
int fcbfinv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Finish conversion of dependent data blocks (with copy).
int fcbeof(void *hdl)
Returns the end-of-file (EOF) flag.
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.
int fcbhadd(void *hdl, const unsigned int datlen, const unsigned char *dat)
Adds a buffer of data to the hash calculation.
const char * fcberrms(const int code)
Get error message.
void * fcbnewmbr(void *hdl, const char *fmtstr, const char *state)
Start with a new member in an open file.
int fcbrand(const int len, unsigned char *dat)
Generate random bytes.
int fcbhfin(void *hdl, unsigned int *hshlen, unsigned char *hsh)
Finalize hash calculation.
int fcbconv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Converts independent data blocks (with copy).
const char * fcbvsn(void)
Retrieves version information.
int fcbgetc(void *hdl)
Gets the next character.
int fcbprev(void *hdl)
Sets the read position to the previous record or element.
int fcbflush(void *hdl)
Flush internal buffers to the file.
char * fcbgets(char *str, int n, void *hdl)
Reads a line.
size_t fcbreadv(void *ptr, size_t size, size_t count, void *hdl, void *cnv, const int skip)
Read file data with conversion.
void * fcbopen(const char *filstr, const char *fmtstr)
Open file (without state management).
int fcbeot(void *hdl)
Returns the end-of-table (EOT) flag.
int fcbclose2(void *hdl, const int success, const int stafmt, size_t *stasiz, char **stabuf)
Close file with return of statistics information.
void * fcbopen2(const char *filstr, const char *fmtstr, char **state)
Open file (with state management).
int fcbrunv(void *cnv, size_t inplen, const void *inp, size_t *outlen, void *out)
Converts dependent data blocks (with copy).
int fcbclosev(void *cnv)
Close a converter.
const char * fcbgtn(void *hdl)
Returns the current table name.
const char * fcbstn(void *hdl, const char *name)
Sets the current table format.
const char * fcbabo(void)
Retrieves about information.
const char * fcberrtr(void)
Get error trace.
const char * fcblic(void)
Retrieves the license text.
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).
const char * fcbhelp(const int what, const int depth, const char *path)
Returns help information about the file and format strings.
int fcbclrlog(void)
Clear the log information.
void fcbclearerr(void *hdl)
Clear error and EOF indicators.
int fcbclose(void *hdl)
Close file (without statistics).
void * fcbbini(const unsigned int mode, const unsigned int base, const unsigned int chrs)
Creates a handle for Base16/32/64 encoding or decoding.
size_t fcbread(void *ptr, size_t size, size_t count, void *hdl)
Read file data.
int fcbungetc(int chr, void *hdl)
Push a character back back to the stream.
const char * fcbcheck(const int what, const char *string)
Check syntax for a certain CLP string.
int fcbputc(int chr, void *hdl)
Writes a character.
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.
int fcbbfin(void *hdl, const int inlen, const unsigned char *in, unsigned char *out)
Finalize en- or decoding.
int fcbinfo(const char *infstr, const int format, size_t *bufsiz, char **buffer)
Provides various information.
size_t fcbwritev(const void *ptr, size_t size, size_t count, void *hdl, void *cnv)
Write data to file with conversion.
int fcbopnlog(const char *logstr)
Open the logging facility for in-memory logging.