Tmax FDL Reference Manual : TMFR-0702-08-380 : Tmax 3.8 : Sep 20, 2003 : Sep 20, 2003
Tmax FDL Reference Manual Tmax 3.8 1
2
Copyright (c) 2001 Tmax Soft Co., Ltd. All Rights Reserved.,,, Tmax soft.,,,..... Tmax, WebT, WebtoB, JEUS, Host-Link, WebInOne Tmax Soft Co., Ltd.. Tmax 135-708 946-1 18 Tel: +82-2-6288-2114, 2006 Fax: +82-2-6288-2115 E-Mail: info@tmax.co.kr Document Edition Date Version TMFR-0501-03-380 FEB 19, 2003 Tmax 3.8 Tmax. Tmax Standard. Tmax Standard TP Function + 2 Phase Commit Web Admin Console, X.25 Gateway, TCP/IP Gateway, Host-Link, Power Tmax Options Builder Interface Module, SERIAL Gateway, TCP/IP Service Gateway 3
? Tmax FDL(Field Definition Language) 3-tier architecture system. ( ) FDL buffer type API. SUN 32bit, SUN 64bit, Compaq, HP 32bit, HP64bit, Linux, Windows NT 3.0/4.0 and Windows 2000. Tmax System UNIX, UNIX UNIX. UNIX,.?. 1 : FDL 2 : FDL API 1 FDL, 2 FDL ( ) API prototype,,,,. Tmax Programming Guide ( C ) Tmax Administration Guide Tmax Reference Manual { [ ] ( ) Numeric String Literal abc abc 4
1. FDL 8 1.1 FDL. 8 1.2 FDL. 9 1.3 FDL... 10 2. FDL API... 12 fballoc.. 12 fbbufop 14 fbbufop_proj... 18 fbcalcsize... 20 fbchg_tu... 21 fbchg_tut... 23 fbdelall. 25 fbdelall_tu... 27 fbdelete... 29 fbextread... 31 fbfldcount... 34 fbfprint. 35 fbfree... 36 fbftos... 37 fbget... 40 fbgetalloc_tu... 42 fbgetalloc_tut... 44 fbget_fbsize 46 fbget_fldkey 47 fbget_fldname... 48 fbget_fldno.. 49 fbget_fldtype... 50 5
fbgetlast_tu. 52 fbget_strfldtype.. 54 fbget_tu... 55 fbget_tut... 57 fbget_unused... 59 fbget_used.. 60 fbgetf... 61 fbgetlen... 63 fbgetnth... 65 fbgetntht... 67 fbgetval... 69 fbgetvali... 71 fbgetval_last_tu.. 73 fbgetvall_tu. 75 fbgetvals... 77 fbgetvals_tu 79 fbgetvalt... 81 fbinit... 83 fbinsert 85 fbisfbuf 87 fbispres... 88 fbkeyoccur.. 89 fbmake_fldkey... 90 fbnext_tu... 91 fbprint.. 93 fbput... 95 fbputt... 97 fbrealloc... 99 fbread 101 fbsnull... 103 fbstelinit... 105 6
fbstinit... 107 fbstof. 109 fbstrerror... 112 fbtypecvt... 113 fbupdate... 115 fbwrite... 117 getfberrno. 119 getfberror.. 120 7
1. FDL 1.1 FDL..,. Tmax FDL. FDL(Field Definition Language) C. FDL. FDL (,, ). FDL FDL FDL. : FDL (fieldkey). :. : C(ANSI C) short, integer, long, float, double, char. Tmax string carray. :. 8
1.2 FDL. C struct. C C id,,,,. struct student { long stid; char name[10]; char addr[40]; short age; char sex; ; stid long, name addr [carray], age short sex character. x student. x->stid, x->name, x->addr, x->age, x->sex,..... 16...,.... 9
1.3 FDL Tmax fdlc.. Tmax. demo.f # name number type flags comments *base 100 INPUT 101 string - - OUTPUT 102 string - - SEQNO 201 string - - CORPNO 202 string - - COMPDATE 203 string - - TOTMON 204 long - - GUARAT 205 float - - GUAMON 206 float - T_BITMAP 900 carray - - FILENAME 901 string - - NEWFILE 902 string - - *base 1000 data1 301 long - - data2 302 long - - data3 303 long - - sumdata 304 long - - data4 305 long - - name, number, type. name 48 fbget_fldkey(). number type. number type, type number. demo.f *base base number base INPUT number 201. base base. type. char, short, int, long, float, double, string, carray 8. fdlc. fdlc [-a -c -u -d] {-i [-o ] [-h ] [-f ] [-ji -jc] [-p ] -a : (default tmax.fdl) i 10
. -c :. (default tmax.fdl). -u : (default tmax.fdl) i. -d : (default tmax.fdl) i. -i :.. -o : (.fdl). tmax.fdl. -h :. fdl _fdl.h. -f : -a,-u,-d. tmax.fdl. -ji : webt Tmax fdlc java interface. -jc : webt Tmax fdlc java class. -p : class interface. fdlc -c -i demo.f demo.f fdlc demo_fdl.h tmax.fdl. o. fdlc -c -i demo.f -o filename.fdl ( ). FDLFILE filename.fdl. ( filename.fdl, fdlc. default tmax.fdl, -o.) FDLFILE=/home/tmax/sample/fdl/filename.fdl. fdlc Tmax Reference Manual. 11
2. FDL API fballoc fballoc : FBUF *fballoc(int count, FLDLEN datalen) fbcalcsize(),tpalloc() tpinit() argument. argument 1024 byte default 1024 byte.. fbfree(). count datalen.(allocation memory size count*sizeof(int) + datalen +.), NULL fberror setting. fballoc(), fberrno. FBEMALLOC :..... FBUF *fbuf; if ((fbuf = fballoc(100, 1000)) == NULL) { printf( fballoc failed, errno = %d\n, fberror);... /* result allocated size : 1408 bytes */ tpalloc(). tpalloc() argument 0 default 12
1024 byte. argument 1024 byte default 1024 byte. FBUF *fbuf; if ((fbuf = (FBUF *)tpalloc( FIELD, NULL, 0)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); /* result allocated size : 1024 bytes */ fbisfbuf(), fbcalcsize(), tpalloc(), fbinit() 13
fbbufop fbbufop :,,, int fbbufop(fbuf *dest, FBUF *src, int mode),, input argument mode. fbbufop() argument dest src. * Process Modes FBMOVE FBCOPY FBCOMP FBCONCAT FBJOIN : src dest. dest argument string carray. string carray dest argument (FBUF *) type casting. : src dest. dest, src argument. : dest, src matching 1 0 matching 1 return. 0 dest, src value,,, 1,, value. : src dest. dest src. : matching src dest. dest. matching.. matching src dest FBOJOIN FBUPDATE matching src dest. FBOJOIN : FBJOIN FBUPDATE : FBOJOIN dest src fballoc() tpalloc() Mode process mode. 14
1, 1 fberror setting. fbbufop(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEMALLOC :. fberror FBEMALLOC setting. FBEINVAL : input argument argument. #include "demo_fdl.h" main() { FBUF *destbuf, *srcbuf; destbuf=fballoc(5,5); fbput(destbuf, INPUT, "5555", 0); fbput(destbuf, INPUT, "7777", 0); fbput(destbuf, OUTPUT, "3333", 0); fbput(destbuf, SEQNO, "8888", 0); srcbuf=fballoc(5,5); fbput(srcbuf, INPUT, "1111", 0); fbput(srcbuf, OUTPUT, "2222", 0); fbput(srcbuf, CORPNO, "3333", 0); /* Mode select. */ printf("input : "); scanf("%d", &a); switch(a) { /*FBMOVE mode */ case 1: iret=fbbufop(destbuf, srcbuf, FBMOVE); 15
fbprint(destbuf); break; /* destbuf : 1111, 2222, 3333 */ /*FBCOMP mode */ case 2: iret=fbbufop(destbuf, srcbuf, FBCOMP); printf("ret = %d\n", iret); if(iret < 0) { printf("do not match!!!\n"); fbfree(destbuf); fbfree(srcbuf); exit(0); printf("match!!!\n"); break; /* Do not match!!! */ /*FBCOPY mode */ case 3: iret=fbbufop(destbuf, srcbuf, FBCOPY); fbprint(destbuf); break; /* destbuf : 1111, 2222, 3333 */ /*FBCONCAT mode */ case 4: iret=fbbufop(destbuf, srcbuf, FBCONCAT); fbprint(destbuf); break; /* destbuf : 5555, 7777, 3333, 8888, 1111, 2222, 3333 */ /*FBJOIN mode */ case 5: iret=fbbufop(destbuf, srcbuf, FBJOIN); fbprint(destbuf); break; /* destbuf : 1111, 2222 */ /*FBOJOIN mode */ case 6: iret=fbbufop(destbuf, srcbuf, FBOJOIN); fbprint(destbuf); 16
break; /* destbuf : 1111, 7777, 2222, 8888 */ /*FBUPDATE mode */ case 7: iret=fbbufop(destbuf, srcbuf, FBUPDATE); fbprint(destbuf); break; /* destbuf : 1111, 7777, 2222, 8888, 3333 */ fbfree(destbuf); fbfree(srcbuf); fbbufop_proj() 17
fbbufop_proj fbbufop_proj : dest int fbbufop_proj(fbuf *dest, FBUF *src, FLDKEY *fldkey) src dest. argument fieldkey src dest fieldkey. fbbufop_proj() argument dest src. argument NULL setting dest. dest src fballoc() tpalloc(). fieldkey. 0. 1, 1 fberror setting. fbbufop_proj(), fberrno. FBEMALLOC :. fberror FBEMALLOC setting. #include demo_fdl.h... int iret, i; FBUF *destbuf, *srcbuf; FLDKEY fkey[4];... fbput(destbuf, INPUT, "aaa", 0); fbput(destbuf, OUTPUT, "bbb", 0); fbput(destbuf, SEQNO, "ccc", 0); fbput(srcbuf, TEST1, "AAA", 0); 18
fbput(srcbuf, TEST2, "BBB", 0); fbput(srcbuf, TEST3, "CCC", 0); fkey[0]=fbget_fldkey("input"); fkey[1]=fbget_fldkey("seqno"); fkey[2]=0; /* The last entry in the array must be 0 */ ret=fbbufop_proj(destbuf, NULL, fkey); /* destbuf : aaa, ccc */ fkey[0]=fbget_fldkey("test3"); fkey[1]=fbget_fldkey("test1"); fkey[2]=fbget_fldkey("test2"); fkey[3]=0; /* The last entry in the array must be 0 */ ret=fbbufop_proj(destbuf, srcbuf, fkey); /* destbuf : AAA, BBB, CCC */ /* fkey array is sorted if the entries are not in numeric order */ fbbufop() 19
fbcalcsize fbcalcsize : long fbcalcsize(int count, FLDLEN datalen) fballoc() tpalloc(). (byte ) argument. count datalen. input argument(count, datalen) byte. #include demo_fdl.h FBUF *fbuf; long size; size = fbcalcsize(100, 1000); printf( size : [%ld]\n, size); /* output : size : [1408] */ if ((fbuf = (FBUF *)tpalloc( FIELD, NULL, size)) == NULL) { printf( tpalloc failed, errno = %d\n, tperrno);. /* fbuf is set in 1024 bytes by default if size is less than 1024*/... fballoc(), tpalloc() 20
fbchg_tu fbchg_tu : int fbchg_tu(fbuf *fbuf, FLDKEY fldkey, int nth, char *value, FLDLEN fldlen) fballoc() tpalloc() input argument. Input argument (nth) (nth).,. fbuf fballoc() tpalloc() fldkey. nth fldkey. value (char *) type (char *) type casting. value NULL. fldlen. type FB_CARRAY byte. 1, 1 fberror setting. fbchg_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. #include demo_fdl.h... long rcvlen, ret; char buffer[100]; FLDLEN fldlen; 21
FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, tperrno);... fbput(fbuf, INPUT, aaaa, 0); /* aaaa. */ ret = fbchg_tu(fbuf, INPUT, 1, bbbb, 4); /* bbbb. */ if (ret < 0) { error processing... ret = fbget_tu(fbuf, INPUT, 1, buffer, &fldlen); /* buffer. */ if (ret < 0) { error processing... printf( Field Data: [%s]\n, buffer); /* output : Field Data: [bbbb] */ fbprint(fbuf); /* output : aaaa, bbbb */... fbput(), fbchg_tut(), fbget_tu(), fbchg_tu(), fbgetval(), fbgetval_last_tu(),fbgetvals_tu(), fbgetvall_tu() 22
fbchg_tut fbchg_tut : int fbchg_tut(fbuf *fbuf, FLDKEY fldkey, int nth, char *value, FLDLEN fldlen, int type) fballoc() or tpalloc() input argument. fbchg_tu(). Input argument.,. fbuf fballoc() tpalloc() fldkey. nth fldkey. value argument char * char * type casting. fldlen. FB_CARRAY byte. type. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_INT, FB_STRING, FB_CHAR, FB_FLOAT 1, 1 fberror setting. fbchg_tut(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument.(fb_carray.) 23
FBETYPE FBEBADFLD : Tmax type. :. #include demo_fdl.h long ret, lval=100000; FBUF *fbuf; fbputt(fbuf, INPUT, "aaaa", 0, FB_STRING); fbchg_tut(fbuf, INPUT, 0, (char *)&lval, 0, FB_LONG); printf("1st occurrence of INPUT field is changed as follows : \n"); fbprint(fbuf);... /* fkey = 469762149, fname = INPUT, type = string, value = 100000 */ fbput(), fbchg_tu(), fbget_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 24
fbdelall fbdelall : int fbdelall(fbuf *fbuf, FLDKEY fldkey) argument. argument. 1 fberror FBENOENT settinge. fbuf fballoc() tpalloc(), fldkey., 1 fberror setting. fbdelall(). fbdelall(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. #include demo_fdl.h int ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, cccc, 0); ret = fbdelall(fbuf, INPUT); printf( Delete Field Number: [%d]\n, ret); /* output: Delete Field Number: [3] */... 25
fbput(), fbget(), fbdelete(), fbdelall_tu() 26
fbdelall_tu fbdelall_tu : int fbdelall_tu(fbuf *fbuf, FLDKEY *fldkey) argument. fbdelall_tu() fbdelall(). argument. index 0. fbuf fballoc() tpalloc(), fieldkey. fbdelall_tu(). fbdelall_tu(), fberrno. FBENOENT : fldkey fberror FBENOENT setting. #include demo_fdl.h FLDKEY fkey[3]; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, OUTPUT, cccc, 0); fkey[0] = INPUT; fkey[1] = OUTPUT; fkey[2] = 0; /* The last entry in the array must be 0 */ ret = fbdelall_tu(fbuf, fkey); 27
printf( The Number of deleted fields: [%d]\n, ret); /* output: Number of deleted fields: [3] */... fbput(), fbget(), fbdelete(), fbdelall() 28
fbdelete fbdelete : int fbdelete(fbuf *fbuf, FLDKEY fldkey, int nth) fballoc() tpalloc(). fbchg_tu() fbdelete() fberror FBENOENT setting. argument. fbuf fballoc() tpalloc(), fieldkey, nth. argument fbdelete() 1 fberror setting. 1. fbdelete(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. fberror FBENOENT setting. #include demo_fdl.h char buffer[100]; int ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); 29
fbput(fbuf, INPUT, aaaa, 0); /* fbuf 0 aaaa. */ fbput(fbuf, INPUT, bbbb, 0); /* fbuf 1 bbbb. */ fbput(fbuf, INPUT, cccc, 0); /* fbuf 2 cccc. */ fbdelete(fbuf, INPUT, 1); /* fbuf 1 bbbb. */ ret=fbdelete(fbuf, INPUT, 3); if(ret<0){ printf("fbdelete error : %s\n", fbstrerror(fberror)); /* fbuf 3 fbdelete error : FBENOENT (not found). */ fbget(fbuf, INPUT, buffer, 0); printf( INPUT: [%s]\n, buffer); /* output: INPUT: [aaaa] */ fbget(fbuf, INPUT, buffer, 0); printf( INPUT: [%s]\n, buffer); /* output: INPUT: [cccc] */... fbput(), fbget(), fbdelall(), fbdelall_tu() 30
fbextread fbextread : #include <stdio.h> #include <usrinc/fbuf.h> int fbextread(fbuf *fbuf, FILE *iop) iop fballoc() tpalloc(). fbuf fballoc() tpalloc() iop.. flag + flag : [flag] field_name or field_id (tab) field_value flag = : [flag] field_name1 or field_id1 (tab) field_name2 or field_id2 flag : [flag] field_name or field_id flag 4. + : 0. - : 0. = : (field_name1) 0 (field_name2) 0. # : comment ( ) : flag fbput(), flag + fbchg_tu(), - fbdelete(), = fbget_tu() fbchg_tu(). fbextread(). 1, 1 fberror setting. #include <stdio.h> #include <usrinc/atmi.h> 31
#include <usrinc/fbuf.h> #include "demo_fdl.h" int main() { long len; int ret; FILE *fp; FBUF *fbuf; FLDLEN fldlen; char buffer[100]; fbuf = (FBUF *)tpalloc("field", NULL, 0); if (fbuf == NULL) { printf("fbuf tpalloc fail[%d]\n", tperrno); ret = fbput(fbuf, INPUT, "user_input", 10); if (ret < 0) { printf("fbput fail[%d]\n", fberror); return -1; ret = fbput(fbuf, OUTPUT, "user_output", 10); if (ret < 0) { printf("fbput fail[%d]\n", fberror); return -1; ret = fbput(fbuf, STATLIN, "user_statlin", 10); if (ret < 0) { printf("fbput fail[%d]\n", fberror); return -1; fp = fopen("file", "r"); fbprint(fbuf); ret = fbextread(fbuf, fp); if (ret < 0) printf("fextread fail[%s]\n", fberror); printf("\n\n<after Fextread>-----------------\n"); fbprint(fbuf); tpfree((char *)fbuf); 1) +STATLIN statlin0_ 32
: user_input, user_output, statlin0_, user_statlin 2) OUTPUT OUTPUT0_ INPUT INPUT0_ INPUT INPUT1_ : user_input, user_output, user_statlin, OUTPUT0_, INPUT0_, INPUT1_ 3) =OUTPUT INPUT : user_input, user_input, user_statlin 4) INPUT : user_output, user_statlin fbput(), fbchg_tu(), fbdelete(), fbget_tu() 33
fbfldcount fbfldcount : int fbfldcount(fbuf *fbuf) fballoc() tpalloc(). API. fbfldcount().,. fbuf fballoc() tpalloc()., 0. #include demo_fdl.h int cnt; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, OUTPUT, cccc, 0); cnt = fbfldcount(fbuf); printf( Field Count: [%d]\n, cnt); /* output: Field Count: [3] */ fbgetnth(), fbkeyoccur() 34
fbfprint fbfprint : int fbfprint(fbuf *fbuf, FILE *iop)., fbprint(). fbuf fballoc() tpalloc(), iop. 1, 1 fberror setting. fbfprint(), fberrno. FBEBADFB :.. FBEINVAL : input argument argument. #include demo_fdl.h FILE *iop; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); iop = fopen( sample.text, w ); fbput(fbuf, INPUT, 5555, 0); fbput(fbuf, INPUT, 7777, 0); fbfprint(fbuf, iop); fclose(iop); fbprint() 35
fbfree fbfree : int fbfree(fbuf *fbuf) fballoc() tpalloc()... fbuf fballoc() tpalloc(). 1, 1. #include demo_fdl.h int ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); ret = fbfree(fbuf); printf( fbfree, ret = %d\n, ret); /* output : fbfree, ret = 1 */ fbput(fbuf, INPUT, bbbb, 0); fbprint(fbuf); /* an error occurs since memory was not allocated. */ fbcalcsize(), tpalloc(), fballoc(), fbinit() 36
fbftos fbftos : matching struct int fbftos(fbuf *fbuf, char *cstruct, char *stname) fballoc() tpalloc() matching C Structure (stname). ***.s. 1 : 1 mapping. C struct mapping. VIEW demo #type cname Fldkey count flag size null string demodata INPUT 5-20 carray carraydata CARRAYDATA 1-20 star char chardata CHARDATA 1 - - c int inum INTDATA 5 - - 0 short snum SHORTDATA 1 - - 0 long lnum LONGDATA 1 - - 1 float fnum FLOATDATA 1 - - 1.0 double dnum DOUBLEDATA 1 - - 1.0 END type cname. fldkey mapping ( ***.f.) count. size string type null C Structure C Structure. null C Structure. string, carray, char NULL int, short, long 0, float, double 0.0. demo.s demo.v VIEW sdlc utility(structure file compiling utility) VIEW file. $TMAXDIR$/sample/sdl> sdlc c v demo.s o tmax.sdl 37
$TMAXDIR$/sample/sdl> sdlc c v demo.v o tmax.sdl (korn shell.profile) SDLFILE o.sdl. SDLFILE. VIEW ***.f. VIEW demo_sdl.h tmax.sdl. demo_sdl.h include. sdlc utility(structure file compiling utility) VIEW file. $TMAXDIR$/sample/sdl> sdlc v demo.s demo_sdl.c demo_sdl.h. demo_sdl.c demo_sdl.c. tmax.sdl. mapping. fbuf fballoc() tpalloc(), cstruct (char *) type casting. stname VIEW. cstruct 1, -1 fberror setting. fbftos(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. FBEBADSTRUCT :. Tmax system. #include demo_fdl.h 38
#include demo_sdl.h int ret, fdllen, val = 1000; struct demo temp; FBUF *fbuf; Char *cstruct; if(tpstart((tpstart_t *)NULL) == -1) { printf( tpstart failed\n ); if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); cstruct = (char *)&temp; if(fbstinit((char *)&temp, demo ) < 1) { printf( fbstinit failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INTDATA, (char *)&val, 0); if(fbftos(fbuf, cstruct, demo ) < 0) { fbstof(), fbstinit(), fbstelinit() 39
fbget fbget : int fbget(fbuf *fbuf, FLDKEY fldkey, char *loc, FLDLEN *fldlen) argument. argument loc.... fbuf fballoc() tpalloc(), fieldkey, loc. type casting. fldlen. 1 fberror setting. 1. fbget(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEINVAL : input argument argument. (CARRAY fldlen.) FBETYPE : Tmax type. #include demo_fdl.h long rcvlen, ret; FLDLEN fldlen; char buffer[100]; 40
FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, cccc, 0); fbget(fbuf, INPUT, buffer, &fldlen); printf( Field Data: [%s]\n, buffer); /* output: Field Data: [aaaa] */ fbput(), fbchg_tu(), fbget_tu(), fbchg_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 41
fbgetalloc_tu fbgetalloc_tu : char *fbgetalloc_tu(fbuf *fbuf, FLDKEY fldkey, int nth, int *extralen) argument argument. extralen 0 setting. extralen.. fbuf fballoc() tpalloc(), fieldkey, nth. extralen. NULL fberror setting.. fbgetalloc_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEMALLOC :, fberror FBEMALLOC setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. #include demo_fdl.h long ret; int extralen; char *buffer; 42
FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, cccc, 0); extralen = 4; buffer = fbgetalloc_tu(fbuf, INPUT, 0, &extralen); printf( Field Data: [%s]\n, buffer); /* output: Field Data: [aaaa], returned after adding 4 bytes to the length of the field value. */ fbfree(fbuf);. fbgetalloc_tut(), fbput(), fbchg_tu(), fbget_tu(), fbchg_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 43
fbgetalloc_tut fbgetalloc_tut :. char *fbgetalloc_tut(fbuf *fbuf, FLDKEY fldkey, int nth, int type, int *extralen) argument argument. fbgetalloc_tut() fbgetalloc_tu(). char * int, long, double, long, float type casting. extralen 0 setting. extralen.. fbuf fballoc() tpalloc(), fieldkey, nth. type, extralen byte. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_FLOAT, FB_INT NULL fberror setting.. fbgetalloc_tut(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEMALLOC :. fberror FBEMALLOC setting. FBENOSPACE : fberror FBENOSPACE setting. FBEBADFLD :. fdlc 44
FBETYPE utility fberror FBEBADFLD setting. : Tmax type. #include demo_fdl.h long ret; int extralen; char *buffer; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, cccc, 0); extralen = 4; buffer = fbgetalloc_tut(fbuf, INPUT, 0, FB_STRING, &extralen); printf( Field Data: [%s]\n, buffer); /* output: Field Data: [aaaa], returned after adding 4 bytes to the length of the field value. */ fbfree(fbuf); fbgetalloc_tu (), fbput(), fbget_tu(), fbchg_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 45
fbget_fbsize fbget_fbsize : long fbget_fbsize(fbuf *fbuf) fballoc() tpalloc(). fballoc() tpalloc() 1024 byte 1024 byte fbget_fbsize() 1024 byte. fbget_fbsize() fbcalcsize(). fbuf fballoc() tpalloc().. #include demo_fdl.h long ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, 1111, 0); ret = fbget_fbsize(fbuf ) ; printf( Field Buffer Size: [%ld]\n, ret); /* output: Field Buffer Size: [1024] */ fbcalcsize(), tpalloc(), fballoc(), fbfree(), fbinit() 46
fbget_fldkey fbget_fldkey : matching FLDKEY fbget_fldkey(char *name) fdlc utility (FDLFILE fdl ) matching (identifier).. name... fbget_fldkey() 0 matching. #include demo_fdl.h FLDKEY fkey; FBUF *sndbuf; fkey = fbget_fldkey( INPUT ); printf( Field Key : [%d]\n, fkey); /* output : Field Key : [469762149] */ fbput(sndbuf, fkey, 1111", 0); fbget_fldname(), fbget_fldno(), fbget_fldtype(), fbget_strfldtype(), fbtypecvt() 47
fbget_fldname fbget_fldname : matching char *fbget_fldname(fldkey fldkey) fbget_fldkey(), fbget_fldname() fdlc utility (FDLFILE fdl ) matching. fldkey (***.f) fdlc utility (***_fdl.h) fbget_fldkey(). NULL matching. #include demo_fdl.h FLDKEY fkey; char *name; fkey = fbget_fldkey( INPUT ); printf( Field Key : [%d]\n, fkey); /* output : Field Key : [469762149] */ name = fbget_fldname(fkey); printf( Field Name : [%s]\n, name); /* output : Field Name : [INPUT] */ fbget_fldkey(), fbget_fldno(), fbget_fldtype(), fbget_strfldtype(), fbtypecvt() 48
fbget_fldno fbget_fldno : matching int fbget_fldno(fldkey fldkey),, unique.. fbget_fldno() matching. fldkey (***.f) fdlc utility (***_fdl.h)fbget_fldkey(). matching. #include demo_fdl.h" FLDKEY fkey; int no; fkey = fbget_fldkey( INPUT ); printf( Field Key : [%d]\n, fkey); /* output : Field Key : [469762149] */ no = fbget_fldno(fkey); printf( Field No. : [%d]\n, no); /* output : Field No. : [101] */ fbget_fldname(), fbget_fldkey(), fbget_fldtype(), fbget_strfldtype(), fbtypecvt() 49
fbget_fldtype fbget_fldtype : int fbget_fldtype(fldkey fldkey). matching. RETURN VALUE (real type number) (real type number) Field type 1 character 2 short integer 3 integer 4 long integer 5 float 6 double 7 string 8 character array(carray) fldkey (***.f) fdlc utility (***_fdl.h) fbget_fldkey(). 1~8 int. #include demo_fdl.h FLDKEY fkey; int type; fkey = fbget_fldkey( INPUT ); printf( Field Key : [%d]\n, fkey);/* output: Field Key : [469762149] */ type = fbget_fldtype(fkey); printf( Field Type : [%d]\n, type);/* output : Field Type : [7] */ 50
fbget_fldname(), fbget_fldno(), fbget_fldkey(), fbget_strfldtype(), fbtypecvt() 51
fbgetlast_tu fbgetlast_tu : int fbgetlast_tu(fbuf *fbuf, FLDKEY fldkey, int *nth, char *loc, int *len).. fbuf fballoc() tpalloc(), fieldkey, nth. nth. loc, len. -1 fberror setting. 1. fbgetlast_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. FBEBADFLD :. #include demo_fdl.h long ret; FLDKEY len; int nth; char buffer[100]; FBUF *fbuf; 52
if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, cccc, 0); fbgetlast_tu(fbuf, INPUT, &nth, buffer, &len); printf( Field Data: [%s], occurrence = %d, len = %d\n, buffer, nth, len); /* output: Field Data: [cccc], occurrence = 2, len = 4 */ fbput(), fbchg_tu(), fbget_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetalloc_tu() 53
fbget_strfldtype fbget_strfldtype : char *fbget_strfldtype(fldkey fldkey). fbget_fldtype(). fldkey (***.f) fdlc utility (***_fdl.h) fbget_fldkey(). Argument. #include demo_fdl.h FLDKEY fkey; char *stype;.. fkey = fbget_fldkey( INPUT ); printf( Field Key : [%d]\n, fkey); /* output : Field Key : [469762149] */ stype = fbget_strfldtype(fkey); printf( Field Type : [%s]\n, stype); /* output : Field type : [string] */ fbget_fldname(), fbget_fldno(), fbget_fldtype(), fbtypecvt() 54
fbget_tu fbget_tu : int fbget_tu(fbuf *fbuf, FLDKEY fldkey, int nth, char *value, FLDLEN *len) argument argument. fbget() fbget() fbget_tu(). fbget() access fbget_tu(). fbuf fballoc() tpalloc(), fieldkey, nth. value. type casting. fldlen. value len. 1 fberror setting. 1. fbget_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. FBEBADFLD :. #include demo_fdl.h char buffer[100]; 55
long rcvlen; FLDLEN fldlen; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, OUTPUT, cccc, 0); fbget_tu(fbuf, INPUT, 1, buffer, &fldlen); printf( Data: [%s]\n, buffer) /* output: Data: [bbbb] */... fbput(), fbget(), fbget_tut(), fbgetval(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 56
fbget_tut fbget_tut : int fbget_tut(fbuf *fbuf, FLDKEY fldkey, int nth, char *value, FLDLEN *len, int type) argument argument. fbget_tu() fbget_tu() fbget_tut(). fbuf fballoc() tpalloc(), fieldkey, nth. value. prototype type casting. fldlen, type. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_FLOAT, FB_INT value len. 1 fberror setting. 1. fbget_tut(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBETYPE : Tmax type. FBEBADFLD :. #include demo_fdl.h FBUF *fbuf; int ret, val=65; 57
if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbputt(fbuf, INPUT, (char *)&val, 0, FB_INT); fbputt(fbuf, INTDATA, "1111", 0, FB_STRING); fbprint(fbuf); fbget_tut(fbuf, INTDATA, 0, (char *)&ret, &fldlen, FB_INT); printf("field Data: [%d]\n", ret); /* output: Field Data: [1111] */... fbput(), fbget(), fbget_tu(), fbgetval(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 58
fbget_unused fbget_unused : long fbget_unused(fbuf *fbuf) fballoc() tpalloc() byte. fbuf fballoc() tpalloc(). byte. #include demo_fdl.h long ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, 1111, 0); ret = fbget_unused (fbuf); printf( Unused Buffer Size: [%d]\n, ret); /* output: Unused Buffer Size: [1000] */ fbcalcsize(), fbget_fbsize(), fbget_used() 59
fbget_used fbget_used : long fbget_used(fbuf *fbuf) fballoc() tpalloc() byte. fbuf fballoc() tpalloc(). byte. #include demo_fdl.h long ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, 1111, 0); ret = fbget_used(fbuf); printf( Used Buffer Size: [%d]\n, ret); /* output: Used Buffer Size: [24] */ fbcalcsize(), fbget_fbsize(), fbget_unused() 60
fbgetf fbgetf : int fbgetf(fbuf *fbuf, FLDKEY fldkey, char *loc, int *fldlen, int *pos) fballoc() tpalloc(). fbgetf() fbget() fbget(). (e.g. Visual Basic 20,000, fbget() 400, fbgetf() 2.5.) pos fbgetf(), fbgetf() 0. fbuf fballoc() tpalloc(), fldkey, loc, fldlen. pos. 1 fberror setting. 1. fbgetf(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. #include demo_fdl.h int ret, int0_pos, str0_pos, fldlen; char str0[30]; FBUF *fbuf; if ((fbuf = fballoc(20000, 1000000)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); 61
int0_pos = str0_pos = 0; while(1) { ret = fbgetf(fbuf, STR0, (char *)str0, (int *)&fldlen, &str0_pos); if(ret < 0) { printf( FBERROR at STR0:%d\n, fberror); break; ret = fbgetf(fbuf, INT0, (char *)&int0, (int *)&fldlen, &int0_pos); if(ret < 0) {... fbget(), fbgetval(), fbget_tu(), fbgetvals(), fbgetvali(), fbgetvalt(), fbgetvall_tu() 62
fbgetlen fbgetlen : int fbgetlen(fbuf *fbuf, FLDKEY fldkey, int nth) fballoc() tpalloc(). fbuf fballoc() tpalloc(), fldkey, nth. 1 fberror setting.. fbgetlen(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. #include demo_fdl.h int ret; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); if(fbgetlen(fbuf, INPUT, 1) < 0) {...... 63
fbget_fbsize(), fbget_used(), fbget_unused(), fbcalcsize() 64
fbgetnth fbgetnth : int fbgetnth(fbuf *fbuf, FLDKEY fldkey, char *value, FLDLEN fldlen) argument (fldkey) argument(*value).. fbuf fballoc() tpalloc(), fieldkey, value. type casting. fldlen FB_CARRAY 0. 1 fberror setting.. fbgetnth(), fberrno. FBEINVAL : input argument argument. #include demo_fdl.h int occ; FBUF *fbuf;... if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); 65
fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, ddddd, 0); fbput(fbuf, INPUT, eeeee, 0); fbput(fbuf, OUTPUT, cccc, 0); occ = fbgetnth(fbuf, INPUT, eeee, 0); printf( Occurrence: [%d]\n, occ); /* output: Occurrence: [3] */... fbfldcount(), fbkeyoccur(), fbgetntht() 66
fbgetntht fbgetntht : int fbgetntht(fbuf *fbuf, FLDKEY fldkey, char *value, FLDLEN fldlen, int fromtype) fbgetntht() fbgetnth() fldkey value. fromtype fldkey value value, fldlen, fbgetnth(). fbgetntht() value matching. fbuf fballoc() tpalloc(), fieldkey, value. type casting. fldlen FB_CARRAY 0. fromtype value. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_FLOAT, FB_INT 1 fberror setting.. fbgetntht(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. FBEBADFLD :. fdlc 67
utility fberror FBEBADFLD setting. #include demo_fdl.h int occ, val; FBUF *fbuf;... if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); val = 1111; fbput(fbuf, INPUT, "aaaa", 0); fbput(fbuf, INPUT, "dddd", 0); fbput(fbuf, INPUT, 1111, 0); fbput(fbuf, OUTPUT, "cccc", 0); occ=fbgetntht(fbuf, INPUT, (char *)&val, 0, FB_INT); printf("occurrence: [%d]\n", occ); /* Occurrence: [2] */ fbfldcount(), fbkeyoccur(), fbgetnth() 68
fbgetval fbgetval : char *fbgetval(fbuf *fbuf, FLDKEY fldkey, int nth, FLDLEN *fldlen) argument argument.. fbgetval(). alignment. long double casting. fbgetvalt(). fbgetval() fbget_tu(). fbget_tu() argument fbgetval(). fbuf fballoc() tpalloc(), fieldkey, nth. value. type casting. fldlen. NULL fberror setting.. fbgetval(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. #include demo_fdl.h char *ptr; long rcvlen; FLDLEN fldlen; FBUF *fbuf; 69
fbuf = fballoc(10, 100);... fbput(fbuf, INPUT, "aaaa", 0); fbput(fbuf, INPUT, "bbbb", 0); ptr=fbgetval(fbuf, INPUT, 0, &fldlen); printf("data: [%s]\n", ptr); /* output: Data: [aaaa] */ printf("len = %d\n", fldlen); /* len = 4 */... fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 70
fbgetvali fbgetvali : int fbgetvali (FBUF *fbuf, FLDKEY fldkey, int nth) argument argument.., aaaa 0. fbuf fballoc() tpalloc(), fieldkey, nth. 0 fberror setting. fbgetvali(). fbgetvali(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. FBENOENT fberror FBENOENT setting. #include demo_fdl.h int cnt; int vali; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { 71
printf( fballoc failed, errno = %d\n, fberror); cnt=111; fbput(fbuf, TOTMON, (char *)&cnt, 0); fbput(fbuf, INPUT, "aaaa", 0); vali=fbgetvali(fbuf, TOTMON, 0); printf("field Data: [%d]\n", vali); /* output: Field Data: [111] */ vali = fbgetvali(fbuf, INPUT, 0); printf("field Data : [%d]\n", vali); /* output: Field Data: [0] */ fbfree(fbuf);... fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 72
fbgetval_last_tu fbgetval_last_tu : char *fbgetval_last_tu(fbuf *fbuf, FLDKEY fldkey, int *nth, FLDLEN *fldlen) argument.. fbgetlast_tu(). fbgetlast_tu() argument fbgetval_last_tu(). fbgetlast_tu() fbgetval_last_tu() argument. fbuf fballoc() tpalloc(), fieldkey, nth, fldlen. NULL fberror setting. char. fbgetval_last_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. #include demo_fdl.h char *ptr; long rcvlen; int i,occ ; FLDLEN fldlen; FBUF *fbuf; 73
if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, ddddd, 0); fbput(fbuf, INPUT, eeeee, 0); fbput(fbuf, OUTPUT, cccc, 0); ptr = fbgetval_last_tu(fbuf, INPUT, &occ, &fldlen); printf( Data: [%s], Occurrence: [%d]\n, ptr, occ); /* output: Data: [eeeee], Occurrence: [3] */ for (i = 0; i < occ; i++) { ptr = fbgetval(fbuf, INPUT, i, &fldlen); printf( Data: [%s]\n, ptr);... fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu(), fbgetlast_tu() 74
fbgetvall_tu fbgetvall_tu : long type long fbgetvall_tu(fbuf *fbuf, FLDKEY fldkey, int nth) argument argument short, int, long long type. fbgetval() fbgetval() fbgetvall_tu() long type. long type typefbgetvall_tu() 0. fbuf fballoc() tpalloc(), fieldkey, nth. short, int, long 0, fberror setting. fbgetvall_tu() long type. fbgetvall_tu(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBETYPE : Tmax type. short, int, long fldkey. #include demo_fdl.h long lval; short sval; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); 75
sval = 111; fbput(fbuf, INPUT, (char *)&sval, 0); lval = fbgetvall_tu(fbuf, INPUT, 0); printf( Field Data: [%ld]\n, lval); /* output: Field Data: [111] */... fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetval_last_tu() 76
fbgetvals fbgetvals : char *fbgetvals (FBUF *fbuf, FLDKEY fldkey, int nth) argument argument. fbgetval() fbgetval(), fbgetvals(). fbuf fballoc() tpalloc(), fieldkey, nth. NULL, fberror setting. fbgetvals(). fbgetvals(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. #include demo_fdl.h char *ptr; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); 77
fbput(fbuf, INPUT, aaaa, 0); ptr = fbgetvals(fbuf, INPUT, 0); printf( Field Data: [%s]\n, ptr); /* output: Field Data: [aaaa] */... fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 78
fbgetvals_tu fbgetvals_tu : char *fbgetvals_tu(fbuf *fbuf, FLDKEY fldkey, int nth) argument argument string. fbgetval() fbgetval() fbgetvals_tu(). fbgetvals(). fbgetvals() NULL fbgetvals_tu() ( ). fbgetvals(), fbgetvals_tu() string. argument fbgetvals_tu() ( ). fbuf fballoc() tpalloc(), fieldkey, nth. ( ), fbgetvals_tu(). #include demo_fdl.h char *ptr; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); ptr = fbgetvals_tu(fbuf, INPUT, 1); printf( Field Data: [%s]\n, ptr); /* output: Field Data: [bbbb] */... 79
fbget(), fbgetval(), fbgetvalt(), fbgetvals(), fbgetval_tu(), fbgetvall_tu(), fbgetval_last_tu() 80
fbgetvalt fbgetvalt : char *fbgetvalt(fbuf *fbuf, FLDKEY fldkey, int nth, FLDLEN *fldlen, int totype) argument argument (totype). fbgetval() alignment. long double casting. fbgetvalt() fbget_tut(). fbget_tut() argument fbgetvalt(). fbget_tut() fbgetvalt() argument. fbgetval() fbgetval() fbgetvalt(). fbuf fballoc() tpalloc(), fieldkey, nth. value. type casting. fldlen. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_INT, FB_FLOAT NULL fberror setting. char. fbgetvalt(), fberrno. FBENOENT : FDLFILE( : default tmax.fdl) fberror FBENOENT setting. FBENOSPACE : fberror FBENOSPACE setting. 81
FBEINVAL FBEBADFLD : input argument argument. :. fdlc utility fberror FBEBADFLD setting. #include demo_fdl.h int *ptr; long rcvlen; FLDLEN fldlen; FBUF *fbuf; Int totype; Int val = 111; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, (char *)&val, 0, FB_INT); ptr = fbgetvalt(fbuf, INPUT, 2, &fldlen, FB_INT); printf( Data: [%d]\n, ptr); /* output: Data: [111] */... fbput(), fbget(), fbgetval(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu() 82
fbinit fbinit : int fbinit(fbuf *fbuf, FLDLEN buflen) fballoc() tpalloc(). fballoc() tpalloc().. fbuf fballoc() tpalloc(), buflen. 1, fberror setting. 1. fbinit(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. buflen fbuf setting. #include demo_fdl.h FBUF *fbuf; int ret; long size; size = fbcalcsize(10, 100); if ((fbuf = (FBUF *)tpalloc( FIELD, NULL, size)) == NULL) { printf( tpalloc failed, errno = %d\n, tperrno); ret = fbinit(fbuf, size); printf( fbinit, ret : [%d]\n, ret); /* fbinit, ret: [1] */ 83
fbcalcsize(), tpalloc(), fballoc() 84
fbinsert fbinsert : int fbinsert(fbuf *fbuf, FLDKEY fldkey, int nth, char *value, int fldlen) fballoc() tpalloc() argumentargument. fbinsert() argument. nth.. fbuf fballoc() tpalloc(), fieldkey, nth. value. type casting. fldlen. FB_CARRAY argument 0. 1, fberror setting. 1. fbinsert(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. ( nth carray setting.) FBETYPE : Tmax type. #include demo_fdl.h 85
long rcvlen, ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbinsert(fbuf, INPUT, 0, aaaa, 0); fbinsert (fbuf, INPUT, 1, bbbb, 0); fbinsert (fbuf, INPUT, 2, cccc, 0);... fbput(), fbchg_tu(), fbget_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 86
fbisfbuf fbisfbuf : int fbisfbuf(fbuf *fbuf) fballoc() tpalloc(). fbisfbuf(). fbuf. 1 0. #include demo_fdl.h FBUF *fbuf; int ret; if ((fbuf = (FBUF *)tpalloc( FIELD, NULL, 0)) == NULL) { printf( tpalloc failed, errno = %d\n, tperrno); ret = fbisfbuf(fbuf); printf( ret : [%d]\n, ret); /* output : ret : [1] */ fballoc(), tpalloc() 87
fbispres fbispres : int fbispres(fbuf *fbuf, FLDKEY fldkey, int nth) argument. fbuf fballoc() tpalloc(), fieldkey, nth. 1, 0. #include demo_fdl.h int ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror);... fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); ret = fbispres(fbuf, INPUT, 1); printf( Field Occ: [%d]\n, ret); /* output: Field Occ: [1] */ fbgetnth(), fbfldcount(), fbkeyoccur() 88
fbkeyoccur fbkeyoccur : int fbkeyoccur(fbuf *fbuf, FLDKEY fldkey) argument. fbfldcount() (1 ) fbkeyoccur(). fbuf fballoc() tpalloc(), fieldkey. 0. #include demo_fdl.h int cnt; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, OUTPUT, cccc, 0); cnt = fbkeyoccur(fbuf, INPUT); printf( Field Count: [%d]\n, cnt); /* output: Field Count: [2] */... fbgetnth(), fbfldcount() 89
fbmake_fldkey fbmake_fldkey : FLDKEY fbmake_fldkey(int type, int no) (***.f). Tmax system unique argument.. - type no-. type, no. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_INT, FB_FLOAT type no. #include demo_fdl.h FLDKEY fkey; fkey = fbmake_fldkey(fb_string, 101); printf( Field Key : [%d]\n, fkey); /* output : Field Key : [469762149] */ fbget_fldkey() 90
fbnext_tu fbnext_tu : int fbnext_tu(fbuf *fbuf, FLDKEY *fldkey, int *nth, char *value, int *len) fldkey. FIRSTFLDKEY. fbuf fballoc() tpalloc(), fieldkey. nth, value. value NULL value, value NULL value fldkey nth. len. len. len value. fbnext_tu() 1 fldkey, nth, value, len. 0, 1 fberror setting. fbnext_tu(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. #include demo_fdl.h char data[100]; long rcvlen; int i, occ, nth, fc, len; FLDKEY fkey; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { 91
printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INPUT, bbbb, 0); fbput(fbuf, INPUT, dddd, 0); fbput(fbuf, INPUT, eeee, 0); fbput(fbuf, INPUT, cccc, 0); len = 4; for(fkey = FIRSTFLDKEY;fc = fbnext_tu(fbuf, &fkey, &occ, data, &len) > 0; len = sizeof(data)) printf( fkey = %ld Data: [%s], Occurrence: [%d] len [%d]\n, fkey, data, occ, len); /* output: fkey = 469762149 Data: [aaaa], Occurrence: [0] len [4] output: fkey = 469762149 Data: [bbbb], Occurrence: [0] len [4] output: fkey = 469762149 Data: [dddd], Occurrence: [0] len [4] output: fkey = 469762149 Data: [eeee], Occurrence: [0] len [4] output: fkey = 469762149 Data: [cccc], Occurrence: [0] len [4] */ fbput(), fbget(), fbgetval(), fbgetvalt(), fbgetval_tu(), fbgetvals_tu(), fbgetvall_tu(), fbgetval_last_tu(), fbgetlast_tu() 92
fbprint fbprint : int fbprint(fbuf *fbuf)... fkey = 469762149, fname = INPUT, type = string, value = 5555 fkey = 469762149, fname = INPUT, type = string, value = 7777 fkey = 469762149, fname = INPUT, type = string, value = 3333 fkey = 469762149, fname = INPUT, type = string, value = 8888 fbuf fballoc() tpalloc(). -1 fberror setting. 1. fbprint(), fberrno. FBEINVAL : input argument argument. FBEBADFB :.. #include demo_fdl.h FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, 5555, 0); fbput(fbuf, INPUT, 7777, 0); fbput(fbuf, INPUT, 3333, 0); fbput(fbuf, INPUT, 8888, 0); 93
fbprint(fbuf);... fbfprintf() 94
fbput fbput : int fbput(fbuf *fbuf, FLDKEY fldkey, char *value, FLDLEN len) fballoc() tpalloc(). argument value, value 1. fbput() fbinsert(). prototype value char * string type type casting. prototype FB_INT, FB_LONG, FB_FLOAT. fbuf fballoc() tpalloc(), fldkey, value, len value. FB_CARRAY 0. 1, fberror setting. 1 fbput(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. #include demo_fdl.h long rcvlen, ret; 95
FBUF *fbuf; int ival = 1000; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); fbput(fbuf, INPUT, aaaa, 0); fbput(fbuf, INTDATA, (char *)&ival, 0); fbinsert(), fbchg_tu(), fbget_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 96
fbputt fbputt : int fbputt(fbuf *fbuf, FLDKEY fldkey, char *value, FLDLEN len, int type) fballoc() tpalloc(). fbputt() fbput() fbput() fbputt()., value. fbuf fballoc() tpalloc(), fldkey, value, len value. FB_CARRAY 0. type. type. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_INT, FB_FLOAT 1, fberror setting. 1 fbputt(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. FBETYPE : Tmax type. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. #include demo_fdl.h 97
long rcvlen, ret; FBUF *fbuf; int ival; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); ival = 1111; fbputt(fbuf, INPUT, aaaa, 0, FB_STRING); /* string INPUT int ival(1111) FB_INT. */ fbputt(fbuf, INPUT, (char *)&ival, 0, FB_INT);. fbprint(fbuf); fbfree(fbuf); /* output : fkey = 469762149, fname = NAME, type = string, value = aaaa fkey = 469762149, fname = NAME, type = string, value = 1111 */... fbinsert(), fbchg_tu(), fbget_tu(), fbgetval(), fbgetval_last_tu(), fbgetvals_tu(), fbgetvall_tu() 98
fbrealloc fbrealloc : FBUF *fbrealloc(fbuf *fbuf, int ncount, int nlen) fballoc() tpalloc(). fbuf fballoc() tpalloc(), ncount nlen., NULL fberror setting. fbrealloc(), fberrno. FBEOS : Operating System System error (, Tmax system (e.g., send, recv, etc)) network. #include demo_fdl.h FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); printf( Buffer Size: [%ld]\n, fbget_fbsize(fbuf)); /* output: Buffer Size: [1024] */ if ((fbuf = (FBUF *)fbrealloc(fbuf, 1000, 150)) == NULL) { printf( fbrealloc failed, errno = %d\n, fberror); printf( Buffer Size: [%ld]\n fbget_fbsize(fbuf)); /* output: Buffer Size: [4158] */ 99
fballoc(), tpalloc(), fbget_fbsize(), fbget_used(), fbget_unused() 100
fbread fbread : int fbread(fbuf *fbuf, FILE *iop) argument fballoc() tpalloc(). fbwrite().. fbuf fballoc() tpalloc(), iop. 1, -1 fberror setting. fbread(), fberrno. FBEINVAL : input argument argument. FBEOS : Operating System System error (, Tmax system (e.g., send, recv, etc)) network. #include demo_fdl.h int ret; FILE *iop; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); iop = fopen( sample.dat, r ); ret = fbread(fbuf, iop); if (ret == 1) fbprint(fbuf); 101
fclose(iop)... fbwrite() 102
fbsnull fbsnull : NULL int fbsnull(char *cstruct, char *cname, int nth, char *stname) mapping NULL. cstruct (char *) type casting. cname, nth. stname VIEW. NULL 1, NULL 0 1 fberror setting. fbsnull(), fberrno. FBEBADSTRUCT :. Tmax system. #include demo_fdl.h #include demo_sdl.h int val = 1000, ret; struct demo temp; char *cstruct; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); if(tpstart((tpstart_t *)NULL) == NULL) { printf(tpstart error\n ); 103
cstruct = (char *)&temp; if(fbstinit(cstruct, demo ) < 0) { fbput(fbuf, INPUT, aaaa, 0); if(fbftos(fbuf, cstruct, demo ) < 0) { ret = fbsnull(cstruct, demodata, 0, demo ); if(ret < 0) { printf( fbsnull failed\n ); else if(ret == 0) printf( This occurrence is not null\n ); else printf( This occurrence is null\n ); fbgetlen(), fbstinit(), fbstelinit(), fbinit() 104
fbstelinit fbstelinit : NULL int fbstelinit(char *cstruct, char *cname, char *stname) input argument NULL. 0 NULL. cstruct (char *) type casting. cname, (char *) type casting, stname VIEW. 1, 1 fberror setting. fbstelinit(), fberrno. FBEBADSTRUCT :. Tmax system. #include demo_fdl.h #include demo_sdl.h cstruct demo temp; char *cstruct; if(tpstart((tpstart_t *)NULL) == NULL) { printf( tpstart failed\n );... cstruct = (char *)&temp; if(fbstelinit(cstruct, demodata, demo ) < 0) {...... 105
fbstinit(), fbinit(), fbsnull() 106
fbstinit int fbstinit(char *cstruct, char *stname) input argument. fbstelinit() fbstinit(). fbstelinit() fbstinit(). cstruct (char *) type casting. stname VIEW. 1, 1 fberror setting. fbstinit(), fberrno. FBEBADSTRUCT :. Tmax system. #include demo_fdl.h #include demo_sdl.h cstruct demo temp; char *cstruct; if(tpstart((tpstart_t *)NULL) == NULL) { printf( tpstart failed\n );... cstruct = (char *)&temp; if(fbstinit(cstruct, demo ) < 0) {...... 107
fbstelinit(), fbinit(), fbsnull() 108
fbstof fbstof : struct matching int fbstof(fbuf *fbuf, char *cstruct, int mode, char *stname) C structure (stname) matching. fbftos(). ***.s VIEW -. 1 : 1 mapping. VIEW fbftos(). fbstof() input argument mode. mode. FBUPDATE, FBJOIN, FBOJOIN, FBCONCAT mode fbbufop() fbbufop(). FBUPDATE mode NULL. fbuf fballoc() tpalloc(), cstruct (char *) type casting. mode, stname VIEW. fbstof() fbftos() C Structure. 1. VIEW null 2. fbftos() C Structure VIEW null C Structure fbstof() null. VIEW null fbftos() C Structure fbftos() C Structure fbstof(). 109
1, -1 fberror setting. fbstof(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBETYPE Tmax type. FBEINVAL : input argument argument. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. FBEBADSTRUCT :. Tmax system. FBEMALLOC :. fberror FBEMALLOC setting. #include demo_fdl.h #include demo_sdl.h int ret, fdllen, val = 1000; struct demo temp; FBUF *fbuf; Char *cstruct; if(tpstart((tpstart_t *)NULL) == -1) { printf( tpstart failed\n ); if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); cstruct = (char *)&temp; if(fbstinit((char *)&temp, demo ) < 1) { printf( fbstinit failed, errno = %d\n, fberror); strcpy(temp.demodata, aaaa ); temp.num = 1000; 110
if(fbstof(fbuf, cstruct, FBUPDATE, demo ) < 0) { fbftof(), fbbufop(), fbstinit(), fbstelinit(), fbsnull() 111
fbstrerror fbstrerror : char *fbstrerror(int fberror) API. API fberror setting. fberror input argument. FDL fbuf.h. NULL. #include demo_fdl.h int ret; FBUF *fbuf; if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); ret = fbget(fbuf, INPUT, aaaa, 0); if( ret < 0 ) printf( ret = %d, fberror = %s[%d]\n, ret, fbstrerror(fberror), fberror); /* output : ret = -1, fberror = not found[6] */ fberror() 112
fbtypecvt fbtypecvt : char *fbtypecvt(fldlen *tolen, int totype, char *fromval, int fromtype, FLDLEN fromlen) fromval fromtype totype. fbtypecvt() tolen. NULL.. tolen, totype. fromval, fromtype fromval, fromlen fromtype. type. : FB_CARRAY, FB_SHORT, FB_DOUBLE, FB_LONG, FB_STRING, FB_CHAR, FB_INT, FB_FLOAT fbtypecvt() NULL fberror setting.. fbtypecvt(), fberrno. FBENOSPACE : fberror FBENOSPACE setting. FBEINVAL : input argument argument. (FB_CARRAY.) FBETYPE : Tmax type. FBEBADFLD :. fdlc utility fberror FBEBADFLD setting. #include demo_fdl.h int tolen, totype, fromtype, fromlen; long vall; FBUF *fbuf; char *ptr; 113
if ((fbuf = fballoc(10, 100)) == NULL) { printf( fballoc failed, errno = %d\n, fberror); vall = 1111; fromlen = sizeof(long); fbput(fbuf, TOTMON,(char *)&vall, 0); ptr = fbtypecvt(&tolen, FB_STRING, (char *)&vall, FB_LONG, fromlen); printf( Converted string = %s\n, ptr); /* output Converted string = 1111 */... fbget_fldname(), fbget_fldno(), fbget_fldtype(), fbget_strfldtype() 114