/* These are default data sizes
   You may need to change them on different platforms 
   The text to data type conversion routines are also given here
   or at least in the associated C file
*/
#ifndef _DEDFAULTS_H_
#define _DEDFAULTS_H_

#define TRUE 1
#define FALSE 0

/* Following constants are used in print_.*_cols routines to decide
   how much information to output */
#define ASRAW 0 
#define DECODEBITS 1
#define PRINTSUBRECS 3
#define EXTRACTCOEFF 5
#define ARRAYVERBOSE 7
#define DOALL 16 
#define EMPTYBITS "000000000\0"
#define BITSTRLEN 9
#define NONLINEAR_ARSIZE 66

typedef int bool;
typedef char CHAR; 

struct NONLINEAR
{
	bool isValid;
	int noEntries;
	char field[200];
	int  value[NONLINEAR_ARSIZE];
};
typedef struct NONLINEAR NONLINEAR;

struct BITS
{
	bool isValid;
	int value;
	char bitString[BITSTRLEN];
};
typedef struct BITS BITS;

struct INT
{
	bool isValid;
	long value;
};
typedef struct INT INT;

struct FLOAT
{
	bool isValid;
	double value;
	int precision; /* number of real digits after decimal */
};
typedef struct FLOAT FLOAT;

int NONLINEARasStr( char* str, char* format, NONLINEAR* nums);
int BITSasStr( char* str, char* format, BITS* num);
int INTasStr( char* str, char* format, INT* num);
int FLOATasStr( char* str, char* format, FLOAT* num);
void strAsNONLINEAR (char* str, NONLINEAR* nums);
void strAsBITS (char* str, BITS* num);
void strAsINT (char* str, INT* num);
void strAsFLOAT (char* str, FLOAT* num);
void print_NONLINEAR(NONLINEAR* nums);
void print_NONLINEAR_cols(NONLINEAR* nums);
bool isBlank (char* str);
int getWidth (char* format);
int getPrecision (char* format);
bool blankOut (char *str, int width);
bool intToBits( char* bits,int num);
void showFlags( char* flags[],BITS* bits);
int crackStr(int* value, char* str, int width);
void checkIfCommandLineFlag (char **argv,int argc,int *i,int *cols,int *decode, int* quite,long* multiRecs);

#endif

