f2c.h

Go to the documentation of this file.
00001 /*
00002 
00003 $Log$
00004 Revision 1.15  2004/06/26 03:50:14  markster
00005 Merge source cleanups (bug #1911)
00006 
00007 Revision 1.14  2003/02/12 13:59:15  matteo
00008 mer feb 12 14:56:57 CET 2003
00009 
00010 Revision 1.1.1.1  2003/02/12 13:59:15  matteo
00011 mer feb 12 14:56:57 CET 2003
00012 
00013 Revision 1.2  2000/01/05 08:20:39  markster
00014 Some OSS fixes and a few lpc changes to make it actually work
00015 
00016  * Revision 1.2  1996/08/20  20:26:28  jaf
00017  * Any typedef defining a type that was used in lpc10_encoder_state or
00018  * lpc10_decoder_state struct's was commented out here and added to
00019  * lpc10.h.
00020  *
00021  * Revision 1.1  1996/08/19  22:32:13  jaf
00022  * Initial revision
00023  *
00024 
00025 */
00026 
00027 /*
00028  * f2c.h
00029  *
00030  * SCCS ID:  @(#)f2c.h 1.2 96/05/19
00031  */
00032 
00033 /* f2c.h  --  Standard Fortran to C header file */
00034 
00035 /**  barf  [ba:rf]  2.  "He suggested using FORTRAN, and everybody barfed."
00036 
00037    - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
00038 
00039 #ifndef F2C_INCLUDE
00040 #define F2C_INCLUDE
00041 
00042 #include "lpc10.h"
00043 
00044 /*typedef long int integer;*/
00045 /*typedef INT32 integer;*/
00046 /*typedef short int shortint;*/
00047 /*typedef INT16 shortint;*/
00048 /*typedef float real;*/
00049 /* doublereal only used for function arguments to sqrt, exp, etc. */
00050 typedef double doublereal;
00051 /* 32 bits seems wasteful, but there really aren't that many logical
00052  * variables around, and making them 32 bits could avoid word
00053  * alignment problems, perhaps.  */
00054 /*typedef long int logical;*/
00055 /*typedef INT32 logical;*/
00056 /* The following types are not used in the translated C code for the
00057  * LPC-10 coder, but they might be needed by the definitions down
00058  * below, so they don't cause compilation errors.  */
00059 typedef char *address;
00060 typedef struct { real r, i; } complex;
00061 typedef struct { doublereal r, i; } doublecomplex;
00062 typedef short int shortlogical;
00063 typedef char logical1;
00064 typedef char integer1;
00065 /* typedef long long longint; */ /* system-dependent */
00066 
00067 #define TRUE_ (1)
00068 #define FALSE_ (0)
00069 
00070 /* Extern is for use with -E */
00071 #ifndef Extern
00072 #define Extern extern
00073 #endif
00074 
00075 /* I/O stuff */
00076 
00077 #ifdef f2c_i2
00078 /* for -i2 */
00079 typedef short flag;
00080 typedef short ftnlen;
00081 typedef short ftnint;
00082 #else
00083 typedef long int flag;
00084 typedef long int ftnlen;
00085 typedef long int ftnint;
00086 #endif
00087 
00088 /*external read, write*/
00089 typedef struct
00090 {  flag cierr;
00091    ftnint ciunit;
00092    flag ciend;
00093    char *cifmt;
00094    ftnint cirec;
00095 } cilist;
00096 
00097 /*internal read, write*/
00098 typedef struct
00099 {  flag icierr;
00100    char *iciunit;
00101    flag iciend;
00102    char *icifmt;
00103    ftnint icirlen;
00104    ftnint icirnum;
00105 } icilist;
00106 
00107 /*open*/
00108 typedef struct
00109 {  flag oerr;
00110    ftnint ounit;
00111    char *ofnm;
00112    ftnlen ofnmlen;
00113    char *osta;
00114    char *oacc;
00115    char *ofm;
00116    ftnint orl;
00117    char *oblnk;
00118 } olist;
00119 
00120 /*close*/
00121 typedef struct
00122 {  flag cerr;
00123    ftnint cunit;
00124    char *csta;
00125 } cllist;
00126 
00127 /*rewind, backspace, endfile*/
00128 typedef struct
00129 {  flag aerr;
00130    ftnint aunit;
00131 } alist;
00132 
00133 /* inquire */
00134 typedef struct
00135 {  flag inerr;
00136    ftnint inunit;
00137    char *infile;
00138    ftnlen infilen;
00139    ftnint   *inex;   /*parameters in standard's order*/
00140    ftnint   *inopen;
00141    ftnint   *innum;
00142    ftnint   *innamed;
00143    char  *inname;
00144    ftnlen   innamlen;
00145    char  *inacc;
00146    ftnlen   inacclen;
00147    char  *inseq;
00148    ftnlen   inseqlen;
00149    char  *indir;
00150    ftnlen   indirlen;
00151    char  *infmt;
00152    ftnlen   infmtlen;
00153    char  *inform;
00154    ftnint   informlen;
00155    char  *inunf;
00156    ftnlen   inunflen;
00157    ftnint   *inrecl;
00158    ftnint   *innrec;
00159    char  *inblank;
00160    ftnlen   inblanklen;
00161 } inlist;
00162 
00163 #define VOID void
00164 
00165 union Multitype { /* for multiple entry points */
00166    integer1 g;
00167    shortint h;
00168    integer i;
00169    /* longint j; */
00170    real r;
00171    doublereal d;
00172    complex c;
00173    doublecomplex z;
00174    };
00175 
00176 typedef union Multitype Multitype;
00177 
00178 /*typedef long int Long;*/ /* No longer used; formerly in Namelist */
00179 
00180 struct Vardesc {  /* for Namelist */
00181    char *name;
00182    char *addr;
00183    ftnlen *dims;
00184    int  type;
00185    };
00186 typedef struct Vardesc Vardesc;
00187 
00188 struct Namelist {
00189    char *name;
00190    Vardesc **vars;
00191    int nvars;
00192    };
00193 typedef struct Namelist Namelist;
00194 
00195 #define abs(x) ((x) >= 0 ? (x) : -(x))
00196 #define dabs(x) (doublereal)abs(x)
00197 #define min(a,b) ((a) <= (b) ? (a) : (b))
00198 #define max(a,b) ((a) >= (b) ? (a) : (b))
00199 #define dmin(a,b) (doublereal)min(a,b)
00200 #define dmax(a,b) (doublereal)max(a,b)
00201 
00202 /* procedure parameter types for -A and -C++ */
00203 
00204 #define F2C_proc_par_types 1
00205 #ifdef __cplusplus
00206 typedef int /* Unknown procedure type */ (*U_fp)(...);
00207 typedef shortint (*J_fp)(...);
00208 typedef integer (*I_fp)(...);
00209 typedef real (*R_fp)(...);
00210 typedef doublereal (*D_fp)(...), (*E_fp)(...);
00211 typedef /* Complex */ VOID (*C_fp)(...);
00212 typedef /* Double Complex */ VOID (*Z_fp)(...);
00213 typedef logical (*L_fp)(...);
00214 typedef shortlogical (*K_fp)(...);
00215 typedef /* Character */ VOID (*H_fp)(...);
00216 typedef /* Subroutine */ int (*S_fp)(...);
00217 #else
00218 typedef int /* Unknown procedure type */ (*U_fp)(VOID);
00219 typedef shortint (*J_fp)(VOID);
00220 typedef integer (*I_fp)(VOID);
00221 typedef real (*R_fp)(VOID);
00222 typedef doublereal (*D_fp)(VOID), (*E_fp)(VOID);
00223 typedef /* Complex */ VOID (*C_fp)(VOID);
00224 typedef /* Double Complex */ VOID (*Z_fp)(VOID);
00225 typedef logical (*L_fp)(VOID);
00226 typedef shortlogical (*K_fp)(VOID);
00227 typedef /* Character */ VOID (*H_fp)(VOID);
00228 typedef /* Subroutine */ int (*S_fp)(VOID);
00229 #endif
00230 /* E_fp is for real functions when -R is not specified */
00231 typedef VOID C_f; /* complex function */
00232 typedef VOID H_f; /* character function */
00233 typedef VOID Z_f; /* double complex function */
00234 typedef doublereal E_f; /* real function with -R not specified */
00235 
00236 /* undef any lower-case symbols that your C compiler predefines, e.g.: */
00237 
00238 #ifndef Skip_f2c_Undefs
00239 #undef cray
00240 #undef gcos
00241 #undef mc68010
00242 #undef mc68020
00243 #undef mips
00244 #undef pdp11
00245 #undef sgi
00246 #undef sparc
00247 #undef sun
00248 #undef sun2
00249 #undef sun3
00250 #undef sun4
00251 #undef u370
00252 #undef u3b
00253 #undef u3b2
00254 #undef u3b5
00255 #undef unix
00256 #undef vax
00257 #endif
00258 
00259 #ifdef KR_headers
00260 extern integer pow_ii(ap, bp);
00261 extern double r_sign(a,b);
00262 extern integer i_nint(x);
00263 #else
00264 extern integer pow_ii(integer *ap, integer *bp);
00265 extern double r_sign(real *a, real *b);
00266 extern integer i_nint(real *x);
00267 
00268 #endif
00269 #ifdef P_R_O_T_O_T_Y_P_E_S
00270 extern int bsynz_(real *coef, integer *ip, integer *iv, 
00271                   real *sout, real *rms, real *ratio, real *g2pass,
00272                   struct lpc10_decoder_state *st);
00273 extern int chanwr_(integer *order, integer *ipitv, integer *irms,
00274                    integer *irc, integer *ibits, struct lpc10_encoder_state *st);
00275 extern int chanrd_(integer *order, integer *ipitv, integer *irms,
00276                    integer *irc, integer *ibits);
00277 extern int chanwr_0_(int n__, integer *order, integer *ipitv, 
00278                      integer *irms, integer *irc, integer *ibits,
00279                      struct lpc10_encoder_state *st);
00280 extern int dcbias_(integer *len, real *speech, real *sigout);
00281 extern int decode_(integer *ipitv, integer *irms, integer *irc, 
00282                    integer *voice, integer *pitch, real *rms,
00283                    real *rc, struct lpc10_decoder_state *st);
00284 extern int deemp_(real *x, integer *n, struct lpc10_decoder_state *st);
00285 extern int difmag_(real *speech, integer *lpita, integer *tau, integer *ltau,
00286                    integer *maxlag, real *amdf, integer *minptr, integer *maxptr);
00287 extern int dyptrk_(real *amdf, integer *ltau, integer *
00288                    minptr, integer *voice, integer *pitch, integer *midx,
00289                    struct lpc10_encoder_state *st);
00290 extern int encode_(integer *voice, integer *pitch, real *rms, real *rc,
00291                    integer *ipitch, integer *irms, integer *irc);
00292 extern int energy_(integer *len, real *speech, real *rms);
00293 extern int ham84_(integer *input, integer *output, integer *errcnt);
00294 extern int hp100_(real *speech, integer *start, integer *end,
00295         struct lpc10_encoder_state *st);
00296 extern int inithp100_(void);
00297 extern int invert_(integer *order, real *phi, real *psi, real *rc);
00298 extern int irc2pc_(real *rc, real *pc, integer *order, real *gprime, real *g2pass);
00299 extern int ivfilt_(real *lpbuf, real *ivbuf, integer *len, integer *nsamp, real *ivrc);
00300 extern int lpcdec_(integer *bits, real *speech);
00301 extern int initlpcdec_(void);
00302 extern int lpcenc_(real *speech, integer *bits);
00303 extern int initlpcenc_(void);
00304 extern int lpfilt_(real *inbuf, real *lpbuf, integer *len, integer *nsamp);
00305 extern integer median_(integer *d1, integer *d2, integer *d3);
00306 extern int mload_(integer *order, integer *awins, integer *awinf, real *speech, real *phi, real *psi);
00307 extern int onset_(real *pebuf, integer *osbuf, integer *osptr, integer *oslen, integer *sbufl, integer *sbufh, integer *lframe, struct lpc10_encoder_state *st);
00308 extern int pitsyn_(integer *order, integer *voice, integer *pitch, real *rms, real *rc, integer *lframe, integer *ivuv, integer *ipiti, real *rmsi, real *rci, integer *nout, real *ratio, struct lpc10_decoder_state *st);
00309 extern int placea_(integer *ipitch, integer *voibuf, integer *obound, integer *af, integer *vwin, integer *awin, integer *ewin, integer *lframe, integer *maxwin);
00310 extern int placev_(integer *osbuf, integer *osptr, integer *oslen, integer *obound, integer *vwin, integer *af, integer *lframe, integer *minwin, integer *maxwin, integer *dvwinl, integer *dvwinh);
00311 extern int preemp_(real *inbuf, real *pebuf, integer *nsamp, real *coef, real *z__);
00312 extern int prepro_(real *speech, integer *length,
00313          struct lpc10_encoder_state *st);
00314 extern int decode_(integer *ipitv, integer *irms, integer *irc, integer *voice, integer *pitch, real *rms, real *rc, struct lpc10_decoder_state *st);
00315 extern integer random_(struct lpc10_decoder_state *st);
00316 extern int rcchk_(integer *order, real *rc1f, real *rc2f);
00317 extern int synths_(integer *voice, integer *pitch, real *rms, real *rc, real *speech, integer *k, struct lpc10_decoder_state *st);
00318 extern int tbdm_(real *speech, integer *lpita, integer *tau, integer *ltau, real *amdf, integer *minptr, integer *maxptr, integer *mintau);
00319 extern int voicin_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *minamd, real *maxamd, integer *mintau, real *ivrc, integer *obound, integer *voibuf, integer *af, struct lpc10_encoder_state *st);
00320 extern int vparms_(integer *vwin, real *inbuf, real *lpbuf, integer *buflim, integer *half, real *dither, integer *mintau, integer *zc, integer *lbe, integer *fbe, real *qs, real *rc1, real *ar_b__, real *ar_f__);
00321 
00322 #endif
00323 
00324 
00325 #endif /* ! defined F2C_INCLUDE */

Generated on Thu Apr 16 06:27:34 2015 for Asterisk - The Open Source Telephony Project by  doxygen 1.5.6