Metropoli BBS
VIEWER: gfft.h MODE: TEXT (ASCII)
/***************************************************************************
 *		  Copyright (C) 1994  Charles P. Peterson                  *
 *	     4007 Enchanted Sun, San Antonio, Texas 78244-1254             *
 *              Email: Charles_P_Peterson@fcircus.sat.tx.us                *
 *                                                                         *
 *		  This is free software with NO WARRANTY.                  *
 *	      See gfft.c, or run program itself, for details.              *
 *		      Support is available for a fee.                      *
 ***************************************************************************
 *
 * Program:     gfft--General FFT analysis
 * File:        gfft.h
 * Purpose:     general include file for gfft
 * Author:      Charles Peterson (CPP)
 * History:     29-May-1993 CPP; Created.
 *               6-July-1994 CPP (0.74); Decreased command buffer size
 *               7-Jan-1995 CPP (1.19); Moved settings.h types here for port
 */

#ifndef GFFT_H
#define GFFT_H

/*
 * Semi-permanent compilation options should be put here
 */


#include <setjmp.h>    /* jmp_buf  */
#include "defxtern.h"

#ifdef AMIGA
#include  "amigadef.h"
#endif

#ifdef UNIX
#include  "unixdef.h"
#endif

#ifdef __MSDOS__
#include "msdosdef.h"
#endif


/*
* Terminations
*/
#define CLOSEDINPUT 0   /* OK for now */

/*
 * Sizes
 */
#define COMMAND_BUFFER_SIZE 512
#define MAX_PATH 256
#define MESSAGE_IOBUFFER_SIZE 256

/*
 * Etc.
 */
#define PROMPT "gfft> "

#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS 0
#endif

#ifndef EXIT_FAILURE
#define EXIT_FAILURE 100
#endif

/*
 * Define TRUE, FALSE, and NULL undefining first if already defined
 */

#ifdef TRUE
#undef TRUE
#endif
#define TRUE 1

#ifdef FALSE
#undef FALSE
#endif
#define FALSE 0

#ifdef NULL
#undef NULL
#endif
#define NULL 0


/*
 * Codes
 * 
 */
#define NOTHING_SPECIAL 0  /* Nothing special to do after longjmp */
#define WORKBENCH_MODE 0
#define INTERACTIVE_MODE 1
#define BATCH_MODE 2

#define NEXT_FILE 3

/*
 * typedefs and types
 */
typedef struct {
    char* full_string;
    char* min_string;
    char *(*cfunction)(char *arguments);
} Name_Info_St;

typedef struct
{
unsigned long zero;
int bits;
BOOLEAN binary;        /* Ascii otherwise */
}
IOFormatS;

struct cal_st
{ 
    struct cal_st *next;
    char *filename;
    long size;
    BOOLEAN db;
    double *frequencies;
    float *amplitudes;

    long index;  /* 'instance' variable */
};

struct list_st {
void *node;
struct list_st *next;
};

#define BIN_TYPE float
#define FINAL_TYPE float   /* Used in final normalizations, etc. */


/*
 * Global variables
 */
DEFXTERNU(jmp_buf,SaveJmpBuf[50])
DEFXTERN(jmp_buf,*JmpBufp,SaveJmpBuf)   /* We use this (for indirection) */
DEFXTERN(float,*Save_Data,0)
DEFXTERN(int,CommandMode,INTERACTIVE_MODE)
DEFXTERN(char,Command[COMMAND_BUFFER_SIZE],{'\0'})
DEFXTERN(int,Error_Count,0)
DEFXTERN(int,Interrupt_Count, 0)
DEFXTERN(char,*NullString,"\0")
DEFXTERN(double,Sample_Sum_Of_Squares, 0.0)
DEFXTERN(long,Sample_Frame_Count, 0)

/*
 * Macros
 */
#define CATCH_ERROR     if (0 == setjmp (*++JmpBufp)) {
#define ON_ERROR        } else {
#define END_CATCH_ERROR } --JmpBufp;
#define RAISE_ERROR(HANDLING) longjmp (*JmpBufp,(HANDLING));

/*
 * Note: there is a little cheating here.
 * If either of the following is modified, you must be sure to touch
 * all dependent codes.  Or touch gfft.h to be certain.
 * Otherwise, you're dead!
 */

#include "errcodes.h" /* Define all error codes */

#include "gproto.h"   /* Define all prototypes */

#endif /* ifndef GFFT_H */
[ RETURN TO DIRECTORY ]