home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 2 / goldfish_vol2_cd1.bin / files / misc / sci / gfft / source / gfft.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-10  |  3.0 KB  |  145 lines

  1. /***************************************************************************
  2.  *          Copyright (C) 1994  Charles P. Peterson                  *
  3.  *         4007 Enchanted Sun, San Antonio, Texas 78244-1254             *
  4.  *              Email: Charles_P_Peterson@fcircus.sat.tx.us                *
  5.  *                                                                         *
  6.  *          This is free software with NO WARRANTY.                  *
  7.  *          See gfft.c, or run program itself, for details.              *
  8.  *              Support is available for a fee.                      *
  9.  ***************************************************************************
  10.  *
  11.  * Program:     gfft--General FFT analysis
  12.  * File:        gfft.h
  13.  * Purpose:     general include file for gfft
  14.  * Author:      Charles Peterson (CPP)
  15.  * History:     29-May-1993 CPP; Created.
  16.  *               6-July-1994 CPP (0.74); Decreased command buffer size
  17.  *
  18.  */
  19.  
  20. #ifndef GFFT_H
  21. #define GFFT_H
  22.  
  23. /*
  24.  * Semi-permanent compilation options should be put here
  25.  */
  26.  
  27.  
  28. #include <setjmp.h>    /* jmp_buf  */
  29. #include "defxtern.h"
  30.  
  31. #ifdef AMIGA
  32. #include  "amigadef.h"
  33. #endif
  34.  
  35. #ifdef UNIX
  36. #include  "unixdef.h"
  37. #endif
  38.  
  39. #ifdef MSDOS
  40. #include "msdosdef.h"
  41. #endif
  42.  
  43.  
  44. /*
  45. * Terminations
  46. */
  47. #define CLOSEDINPUT 0   /* OK for now */
  48.  
  49. /*
  50.  * Sizes
  51.  */
  52. #define COMMAND_BUFFER_SIZE 512
  53. #define MAX_PATH 256
  54. #define MESSAGE_IOBUFFER_SIZE 256
  55.  
  56. /*
  57.  * Etc.
  58.  */
  59. #define PROMPT "gfft> "
  60.  
  61. #ifndef EXIT_SUCCESS
  62. #define EXIT_SUCCESS 0
  63. #endif
  64.  
  65. #ifndef EXIT_FAILURE
  66. #define EXIT_FAILURE 100
  67. #endif
  68.  
  69. /*
  70.  * Define TRUE, FALSE, and NULL undefining first if already defined
  71.  */
  72.  
  73. #ifdef TRUE
  74. #undef TRUE
  75. #endif
  76. #define TRUE 1
  77.  
  78. #ifdef FALSE
  79. #undef FALSE
  80. #endif
  81. #define FALSE 0
  82.  
  83. #ifdef NULL
  84. #undef NULL
  85. #endif
  86. #define NULL 0
  87.  
  88.  
  89. /*
  90.  * Codes
  91.  * 
  92.  */
  93. #define NOTHING_SPECIAL 0  /* Nothing special to do after longjmp */
  94. #define WORKBENCH_MODE 0
  95. #define INTERACTIVE_MODE 1
  96. #define BATCH_MODE 2
  97.  
  98. #define NEXT_FILE 3
  99.  
  100. /*
  101.  * typedefs and types
  102.  */
  103. typedef struct {
  104.     char* full_string;
  105.     char* min_string;
  106.     char *(*cfunction)(char *arguments);
  107. } Name_Info_St;
  108.  
  109. #define BIN_TYPE float
  110. #define FINAL_TYPE float   /* Used in final normalizations, etc. */
  111.  
  112.  
  113. /*
  114.  * Global variables
  115.  */
  116. DEFXTERNU(jmp_buf,SaveJmpBuf[50])
  117. DEFXTERN(jmp_buf,*JmpBufp,SaveJmpBuf)   /* We use this (for indirection) */
  118. DEFXTERN(float,*Save_Data,0)
  119. DEFXTERN(int,CommandMode,INTERACTIVE_MODE)
  120. DEFXTERN(char,Command[COMMAND_BUFFER_SIZE],{'\0'})
  121. DEFXTERN(char,*NullString,"\0")
  122. DEFXTERN(double,Sample_Sum_Of_Squares, 0.0)
  123. DEFXTERN(long,Sample_Frame_Count, 0)
  124.  
  125. /*
  126.  * Macros
  127.  */
  128. #define CATCH_ERROR     if (0 == setjmp (*++JmpBufp)) {
  129. #define ON_ERROR        } else {
  130. #define END_CATCH_ERROR } --JmpBufp;
  131. #define RAISE_ERROR(HANDLING) longjmp (*JmpBufp,(HANDLING));
  132.  
  133. /*
  134.  * Note: there is a little cheating here.
  135.  * If either of the following is modified, you must be sure to touch
  136.  * all dependent codes.  Or touch gfft.h to be certain.
  137.  * Otherwise, you're dead!
  138.  */
  139.  
  140. #include "errcodes.h" /* Define all error codes */
  141.  
  142. #include "gproto.h"   /* Define all prototypes */
  143.  
  144. #endif /* ifndef GFFT_H */
  145.