root/tags/5.52/r1.c

Revision 4, 0.8 kB (checked in by heitor.barbieri, 2 years ago)

Versão 5.52 do cisis (28/04/2010)

Line 
1/* Program R1: dumps the field contents of all active records
2               of a given data base
3*/
4#include <stdio.h>
5#include "cisis.h"   /* CISIS Interface header file */
6#include "cirun.h"   /* CISIS Interface runtime declarations */
7
8void main(int argc, char *argv[])
9{
10        RECSTRU *recp;  /* mandatory for defines REC,MFR,DIR,FIELDP */
11        LONGX mfn;
12        int diridx,dirloop,chrloop;
13        char *p;
14
15        if (argc != 2) { printf("\nR1 <dbname> \n"); exit(1); }
16
17        for (mfn=1L; ; mfn++) {
18                RECORD(0L,argv[1],mfn);
19                if (RECrc == RCEOF) break;
20                if (RECrc != RCNORMAL) continue;
21                printf("mfn %ld\n",mfn);
22                for (diridx=0, dirloop=MFRnvf; dirloop--; diridx++) {
23                        printf("%3u  ",DIRtag(diridx));
24                        p=FIELDP(diridx);
25                        for (chrloop=DIRlen(diridx); chrloop--; p++)
26                                printf("%c",*p);
27                        printf("\n");
28                }
29        }
30} /* end of main */
Note: See TracBrowser for help on using the browser.