ARB
Classes | Macros | Functions | Variables
readseq.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "ureadseq.h"
#include <gets_noOverflow.h>
Include dependency graph for readseq.c:

Go to the source code of this file.

Classes

struct  formatTable
 

Macros

#define __NO_CTYPE
 
#define kFormCount   30
 
#define kMaxFormName   15
 
#define kDupmatch   -2
 
#define USERINPUT_BUFFERSIZE   128
 
#define USERINPUT_BUFFERSIZE_SEQ   256
 
#define kMaxwhichlist   50
 
#define kOptOkay   1
 
#define kOptNone   0
 
#define Exit(a)   exit(a)
 
#define exit_main(err)
 
#define indexout()
 

Functions

const charformatstr (short format)
 
int rs_isdigit (int c)
 
int parseformat (char *name2)
 
static void dumpSeqList (char *list, short format)
 
void usage ()
 
void erralert (short err)
 
int chooseFormat (boolean quietly)
 
boolean checkopt (boolean casesense, char *sopt, const char *smatch, short minword)
 
void resetGlobals ()
 
int readopt (char *sopt)
 
int main (int argc, char *argv[])
 

Variables

const chartitle = "readSeq (1Feb93), multi-format molbio sequence reader.\n"
 
static char inputfilestore [256]
 
static charinputfile = inputfilestore
 
const charformats [kMaxFormat+1]
 
const struct formatTable formname []
 
const charkASN1headline = "Bioseq-set ::= {\nseq-set {\n"
 
const char compl [] = " !\"#$%&'()*+,-./0123456789:;<=>?@TVGHNNCDNNMNKNNYRYSAABWNRN[\\]^_`tvghnncdnnmnknnyrysaabwnrn{|}~"
 
boolean chooseall = false
 
boolean quietly = false
 
boolean gotinputfile = false
 
boolean listonly = false
 
boolean closeout = false
 
boolean verbose = false
 
boolean manyout = false
 
boolean dolower = false
 
boolean doupper = false
 
boolean doreverse = false
 
boolean askout = true
 
boolean dopipe = false
 
boolean interleaved = false
 
short nfile = 0
 
short iwhichlist =0
 
short nwhichlist = 0
 
short whichlist [kMaxwhichlist+1]
 
long whichSeq = 0
 
long outform = kNoformat
 
char onamestore [USERINPUT_BUFFERSIZE]
 
charoname = onamestore
 
FILE * foo = NULL
 

Macro Definition Documentation

#define __NO_CTYPE

Definition at line 174 of file readseq.c.

#define kFormCount   30

Definition at line 204 of file readseq.c.

Referenced by parseformat().

#define kMaxFormName   15

Definition at line 205 of file readseq.c.

Referenced by parseformat().

#define kDupmatch   -2

Referenced by parseformat().

#define USERINPUT_BUFFERSIZE   128

Definition at line 409 of file readseq.c.

Referenced by chooseFormat(), and main().

#define USERINPUT_BUFFERSIZE_SEQ   256

Definition at line 410 of file readseq.c.

Referenced by main().

#define kMaxwhichlist   50

Definition at line 457 of file readseq.c.

Referenced by readopt().

#define kOptOkay   1

Definition at line 487 of file readseq.c.

Referenced by readopt().

#define kOptNone   0

Definition at line 488 of file readseq.c.

Referenced by readopt().

#define Exit (   a)    exit(a)

Definition at line 718 of file readseq.c.

#define exit_main (   err)
Value:
{ \
if (closeout) fclose(fout); \
if (closein) fclose(fin); \
if (*tempname!=0) remove(tempname);\
Exit(err); }
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163
#define Exit(a)
Definition: readseq.c:718
boolean closeout
Definition: readseq.c:461

Referenced by main().

#define indexout ( )
Value:
if (noutindex>=outindexmax) {\
outindexmax= noutindex + 20;\
outindex= (long*) realloc(outindex, sizeof(long)*outindexmax);\
if (outindex==NULL) { err= eMemFull; erralert(err); exit_main(err); }\
}\
outindex[noutindex++]= ftell(fout);\
}
#define eMemFull
Definition: ureadseq.h:29
void erralert(short err)
Definition: readseq.c:379
boolean interleaved
Definition: readseq.c:463
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:163
#define exit_main(err)

Referenced by main().

Function Documentation

const char* formatstr ( short  format)

Definition at line 251 of file readseq.c.

References kASN1, kASNseqentry, kASNseqset, kMaxFormat, kPhylip, kPhylipInterleave, and kPhylipSequential.

Referenced by dumpSeqList(), and main().

int rs_isdigit ( int  c)

Definition at line 265 of file readseq.c.

Referenced by main(), parseformat(), and readopt().

int parseformat ( char name2)
static void dumpSeqList ( char list,
short  format 
)
static

Definition at line 308 of file readseq.c.

References formatstr(), NEWLINE, and s.

Referenced by main().

void usage ( )

Definition at line 328 of file readseq.c.

References fputs(), kMaxFormat, kMinFormat, and title.

Referenced by main(), readopt(), and string2enum_or_die().

void erralert ( short  err)

Definition at line 379 of file readseq.c.

References eASNerr, eFileCreate, eFileNotFound, eItemNotFound, eMemFull, eNoData, eOneFormat, ePipeStdin, eUnequalSize, and eUnknownFormat.

Referenced by main(), and readopt().

int chooseFormat ( boolean  quietly)

Definition at line 412 of file readseq.c.

References gets_noOverflow(), kMaxFormat, kMinFormat, kNoformat, kPearson, outform, parseformat(), and USERINPUT_BUFFERSIZE.

Referenced by main().

boolean checkopt ( boolean  casesense,
char sopt,
const char smatch,
short  minword 
)

Definition at line 436 of file readseq.c.

References max, min, result, and Strncasecmp().

Referenced by readopt().

void resetGlobals ( )
int readopt ( char sopt)
int main ( int  argc,
char argv[] 
)

Variable Documentation

const char* title = "readSeq (1Feb93), multi-format molbio sequence reader.\n"
char inputfilestore[256]
static

Definition at line 181 of file readseq.c.

Referenced by main().

char * inputfile = inputfilestore
static

Definition at line 181 of file readseq.c.

Referenced by main(), Helpfile::readHelp(), and Helpfile::writeXML().

const char* formats[kMaxFormat+1]
Initial value:
= {
" 1. IG/Stanford",
" 2. GenBank/GB",
" 3. NBRF",
" 4. EMBL",
" 5. GCG",
" 6. DNAStrider",
" 7. Fitch",
" 8. Pearson/Fasta",
" 9. Zuker (in-only)",
"10. Olsen (in-only)",
"11. Phylip3.2",
"12. Phylip",
"13. Plain/Raw",
"14. PIR/CODATA",
"15. MSF",
"16. ASN.1",
"17. PAUP/NEXUS",
"18. Pretty (out-only)",
"" }

Definition at line 183 of file readseq.c.

const struct formatTable formname[]
const char* kASN1headline = "Bioseq-set ::= {\nseq-set {\n"

Definition at line 243 of file readseq.c.

const char compl[] = " !\"#$%&'()*+,-./0123456789:;<=>?@TVGHNNCDNNMNKNNYRYSAABWNRN[\\]^_`tvghnncdnnmnknnyrysaabwnrn{|}~"

Definition at line 247 of file readseq.c.

boolean chooseall = false

Definition at line 460 of file readseq.c.

boolean quietly = false

Definition at line 460 of file readseq.c.

Referenced by main(), and resetGlobals().

boolean gotinputfile = false

Definition at line 460 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean listonly = false

Definition at line 461 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean closeout = false

Definition at line 461 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean verbose = false

Definition at line 461 of file readseq.c.

Referenced by main(), readopt(), resetGlobals(), and start_remote_command_for_application().

boolean manyout = false

Definition at line 462 of file readseq.c.

Referenced by main(), and resetGlobals().

boolean dolower = false

Definition at line 462 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean doupper = false

Definition at line 462 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean doreverse = false

Definition at line 462 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean askout = true

Definition at line 463 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean dopipe = false

Definition at line 463 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

boolean interleaved = false

Definition at line 463 of file readseq.c.

Referenced by main(), readSeqMain(), and resetGlobals().

short nfile = 0

Definition at line 464 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

short iwhichlist =0

Definition at line 464 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

short nwhichlist = 0

Definition at line 464 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

short whichlist[kMaxwhichlist+1]

Definition at line 465 of file readseq.c.

Referenced by main(), and readopt().

long whichSeq = 0

Definition at line 466 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().

long outform = kNoformat

Definition at line 466 of file readseq.c.

Referenced by chooseFormat(), main(), readopt(), and resetGlobals().

Definition at line 467 of file readseq.c.

Referenced by resetGlobals().

char * oname = onamestore
FILE* foo = NULL

Definition at line 468 of file readseq.c.

Referenced by main(), readopt(), and resetGlobals().