| 1 |
/* File: command_.h |
| 2 |
* Author: Ed Griffiths ([email protected]) |
| 3 |
* Copyright (c) J Thierry-Mieg and R Durbin, 2000 |
| 4 |
*------------------------------------------------------------------- |
| 5 |
* This file is part of the ACEDB genome database package, written by |
| 6 |
* Richard Durbin (Sanger Centre, UK) [email protected], and |
| 7 |
* Jean Thierry-Mieg (CRBM du CNRS, France) [email protected] |
| 8 |
* |
| 9 |
* Description: Internal header for ace commands. |
| 10 |
* HISTORY: |
| 11 |
* Last edited: Aug 3 08:24 2004 (edgrif) |
| 12 |
* Created: Thu May 11 19:43:40 2000 (edgrif) |
| 13 |
* CVS info: $Id: command_.h,v 1.9 2004/08/04 10:18:10 edgrif Exp $ |
| 14 |
*------------------------------------------------------------------- |
| 15 |
*/ |
| 16 |
#ifndef DEF_COMMAND_PRIV_H |
| 17 |
#define DEF_COMMAND_PRIV_H |
| 18 |
|
| 19 |
#include <wh/command.h> /* command public header. */ |
| 20 |
|
| 21 |
|
| 22 |
/* Callers are returned an opaque reference to this struct, which contains */ |
| 23 |
/* all the state associated with a command. */ |
| 24 |
/* */ |
| 25 |
typedef struct _AceCommandStruct |
| 26 |
{ |
| 27 |
magic_t *magic ; /* == &AceCommand_MAGIC */ |
| 28 |
ACEOUT dump_out; /* used for show -f / aql -o etc |
| 29 |
* used to be outLevel/outfil */ |
| 30 |
BOOL noWrite ; |
| 31 |
SPREAD spread ; |
| 32 |
KEYSET ksNew, ksOld, kA ; |
| 33 |
Stack ksStack ; |
| 34 |
int nns ; /* number of entries on stack */ |
| 35 |
unsigned int choix ; |
| 36 |
unsigned int perms; |
| 37 |
Array aMenu ; |
| 38 |
KEY lastCommand ; |
| 39 |
BOOL quiet ; /* TRUE => only output result of |
| 40 |
command, no acedb comments. */ |
| 41 |
BOOL showStatus , beginTable ; |
| 42 |
BOOL showTableTitle; |
| 43 |
int nextObj, lastSpread ; |
| 44 |
int cumulatedTableLength ; |
| 45 |
int encore ; |
| 46 |
int minN ; /* startup */ |
| 47 |
int maxN ; /* -1 or, max number of desired output */ |
| 48 |
int notListable ; /* empty and alias objects */ |
| 49 |
BOOL dumpTimeStamps ; |
| 50 |
BOOL dumpComments ; |
| 51 |
BOOL noXref ; |
| 52 |
|
| 53 |
/* Flags for dumping of dna and much more. */ |
| 54 |
BOOL allowMismatches ; |
| 55 |
BOOL spliced ; |
| 56 |
BOOL cds_only ; |
| 57 |
COND showCond ; |
| 58 |
char beauty ; /* ace, tace, perl */ |
| 59 |
/* |
| 60 |
* For beauty, possible values are: (see w4/dump.c dumpKey2) |
| 61 |
* p ace perl |
| 62 |
* j java format |
| 63 |
* J another java format |
| 64 |
* a ace file format |
| 65 |
* A ace file format (same?) |
| 66 |
* C acec library binary format |
| 67 |
* H ??? |
| 68 |
* h ??? |
| 69 |
* m minilib format - much like ace file but shows all tags |
| 70 |
* and has special markings for type A objects (NCBI only) |
| 71 |
* k ??? (Sanger only) |
| 72 |
* K ??? (Sanger only) |
| 73 |
* x ??? (Sanger only) |
| 74 |
* X ??? (Sanger only) |
| 75 |
* y ??? (Sanger only) |
| 76 |
* Y ??? (Sanger only) |
| 77 |
* |
| 78 |
*/ |
| 79 |
char fastaCommand ; /* for DNA, Peptide more */ |
| 80 |
|
| 81 |
/* |
| 82 |
* these are all related to kget/kstore/kclear commands: |
| 83 |
*/ |
| 84 |
DICT *kget_dict; |
| 85 |
Array kget_namedSets ; |
| 86 |
} AceCommandStruct ; |
| 87 |
/* |
| 88 |
* bug: there should be a comment here that tells you where AceCommandStruct is |
| 89 |
* deallocated. I added the kget_* fields, but do not know where to free them |
| 90 |
* when the AceCommandStruct is no longer used. |
| 91 |
*/ |
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
/* Note the restricted possibilities here... */ |
| 96 |
/* CMD_FILESPEC_NONE => cmd does not use files at all */ |
| 97 |
/* CMD_FILESPEC_OPTIONAL */ |
| 98 |
/* => if file specified, must be last word on line. */ |
| 99 |
/* CMD_FILESPEC_OPTIONAL & CMD_FILESPEC_FLAG */ |
| 100 |
/* => will be word following flag on line. */ |
| 101 |
/* CMD_FILESPEC_COMPULSORY */ |
| 102 |
/* => file must be specified, must be last word on line. */ |
| 103 |
typedef enum _CmdFilespecType |
| 104 |
{ |
| 105 |
CMD_FILESPEC_NONE = 0x0, /* cmd. does not use files. */ |
| 106 |
CMD_FILESPEC_FLAG = 0x1, /* flag used to signal file. */ |
| 107 |
CMD_FILESPEC_OPTIONAL = 0x2, /* file is optional. */ |
| 108 |
CMD_FILESPEC_COMPULSORY = 0x4 /* file is compulsory (must be last |
| 109 |
word on command line). */ |
| 110 |
} CmdFilespecType ; |
| 111 |
|
| 112 |
|
| 113 |
/* Describes how files are specified within acedb command line commands. */ |
| 114 |
/* Notes: */ |
| 115 |
/* */ |
| 116 |
typedef struct _CmdFilespecStruct |
| 117 |
{ |
| 118 |
BOOL any_files ; /* Does cmd have any files ? */ |
| 119 |
CmdFilespecType infile ; /* How is file specified ? */ |
| 120 |
char *infile_flag ; /* flag, e.g. "-f", */ |
| 121 |
CmdFilespecType outfile ; /* How is file specified ? */ |
| 122 |
char *outfile_flag ; /* flag, e.g. "-f", */ |
| 123 |
} CmdFilespecStruct ; |
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
/* Command struct, defines format and use of an ace command. */ |
| 128 |
/* choix = one of the following: |
| 129 |
CHOIX_UNIVERSAL: universal |
| 130 |
CHOIX_NONSERVER: non-server |
| 131 |
CHOIX_SERVER: server |
| 132 |
CHOIX_GIF: gif |
| 133 |
*/ |
| 134 |
typedef struct |
| 135 |
{ |
| 136 |
unsigned int choix ; /* Which command "sets" this command |
| 137 |
belongs to. */ |
| 138 |
unsigned int perm ; /* What level of access (e.g. read) is */ |
| 139 |
/* required to run the command.*/ |
| 140 |
KEY key ; /* id by which command is known. */ |
| 141 |
char *text ; /* help text for command. */ |
| 142 |
CmdFilespecStruct filespec ; /* How in/out files are specified. */ |
| 143 |
} CHOIX ; |
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
/* Internal to the acecommand package. */ |
| 149 |
/* */ |
| 150 |
CHOIX *uAceCommandGetChoixMenu(void) ; /* return ptr to array of all possible */ |
| 151 |
/* commands. */ |
| 152 |
|
| 153 |
Array uAceCommandChoisirMenu(unsigned int choix, unsigned int perms) ; |
| 154 |
/* Return an array of allowed commands */ |
| 155 |
/* for a given command subset and |
| 156 |
permission level.*/ |
| 157 |
|
| 158 |
#endif /* DEF_COMMAND_PRIV_H */ |