-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfilepick.h
77 lines (69 loc) · 3.09 KB
/
filepick.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* filepick.h
*
* Copyright 2019 Ryan Koehler, VerdAscend Sciences, ryan@verdascend.com
*
* The programs and source code of the vertools collection are free software.
* They are distributed in the hope that they will be useful,
* WITHOUT ANY WARRANTY OF FITNESS FOR ANY PARTICULAR PURPOSE.
*
* Permission is granted for research, educational, and possibly commercial use
* and modification as long as 1) Code and any derived works are not
* redistributed for any fee, and 2) Proper credit is given to the authors.
* If you wish to include this software in a product, or use it commercially,
* please contact the authors.
*
* See https://www.verdascend.com/ for more
*
*/
#define VERSION_S "FilePick version 0.53"
#define DEF_STOK "UID"
#define FILEPICK_ID 5061
typedef struct FILEPICK
{
int ID;
char inname[NSIZE]; /* Input file name */
FILE *in; /* Input file */
char outname[NSIZE]; /* Output file name */
FILE *out; /* Outpuf file */
char stok[NSIZE]; /* Start token for block delineation */
char etok[NSIZE]; /* End token for block delineation */
int first, last; /* First / last records to qualify */
char wlisname[NSIZE]; /* Name for subset file */
struct WORDLIST *wlis; /* Subset names list structure */
int do_ner; /* Flag to not dump end record line */
int do_kc; /* Flag to keep case for name comparison */
int do_wst; /* Flag to check start for word comparison */
int do_wsub; /* Flag to check substring for word comparison */
int do_not; /* Flag to invert record qualifcations */
int do_dh; /* Flag to dump header (before first record) */
int do_oh; /* Flag to dump only header */
int do_snl; /* Flag to separate records with new lines */
int do_srn; /* Flag to separate records with record number line */
int do_rsany;
int do_esf; /* Flag to extract separate files */
char esbase[NSIZE]; /* Extracted file base name */
char esext[NSIZE]; /* Extracted file extension */
}FILEPICK;
#define CHECK_FILEPICK(fp) if(fp){DestroyFilepickI(fp);fp=NULL;}
#define REC_SEP_S "----------------------------"
/*********************** ppp ********************
* C function listing generated by gen_prot
* Sat Feb 22 10:10:21 2014
*/
/****************************************************************
* filepick.c
*/
int main(int argc, char **argv);
void FilePickUse(void);
int FilePickI(int argc, char **argv);
FILEPICK *CreateFilepickPO(void);
int DestroyFilepickI(FILEPICK *fpPO);
void InitFilepick(FILEPICK *fpPO);
int CheckFilepickOptions(FILEPICK *fpPO) ;
int LineMatchRecTokenI(FILEPICK *fpPO, char *bufS, char *tokS, char *nameS);
int MatchingTokenI(char *fS,char *sS,int kc);
int IsRecordOkI(FILEPICK *fpPO,int record,char *curecS);
int FpOutputThisLineI(FILEPICK *fpPO,int record,int in_rec,int ok_rec);
int HandleFilepickOutfileI(FILEPICK *fpPO,int record,char *recS);
int FpOutOneLineI(FILEPICK *fpPO, char *lineS, FILE *outPF);