1 /* 2 * snackDecls.h -- 3 * 4 * Declarations of functions in the platform independent public Snack API. 5 * 6 * Copyright (c) 1998-1999 by Scriptics Corporation. 7 * 8 * See the file "license.terms" for information on usage and redistribution 9 * of this file, and for a DISCLAIMER OF ALL WARRANTIES. 10 * 11 */ 12 13 #ifndef _SNACKDECLS 14 #define _SNACKDECLS 15 16 /* 17 * WARNING: This file is automatically generated by the tools/genStubs.tcl 18 * script. Any modifications to the function declarations below should be made 19 * in the generic/snack.decls script. 20 */ 21 22 /* !BEGIN!: Do not edit below this line. */ 23 24 /* 25 * Exported function declarations: 26 */ 27 28 /* Slot 0 is reserved */ 29 /* Slot 1 is reserved */ 30 /* 2 */ 31 EXTERN int Snack_AddSubCmd _ANSI_ARGS_((int snackCmd, 32 char * cmdName, Snack_CmdProc * cmdProc, 33 Snack_DelCmdProc * delCmdProc)); 34 /* 3 */ 35 EXTERN int Snack_AddFileFormat _ANSI_ARGS_((char * formatName, 36 guessFileTypeProc * guessProc, 37 getHeaderProc * GetHeaderProc, 38 extensionFileTypeProc * extProc, 39 putHeaderProc * PutHeaderProc, 40 openProc * OpenProc, closeProc * CloseProc, 41 readSamplesProc * ReadSamplesProc, 42 writeSamplesProc * WriteSamplesProc, 43 seekProc * SeekProc)); 44 /* 4 */ 45 EXTERN int Snack_AddCallback _ANSI_ARGS_((Sound * s, 46 updateProc * proc, ClientData cd)); 47 /* 5 */ 48 EXTERN void Snack_RemoveCallback _ANSI_ARGS_((Sound * s, int id)); 49 /* 6 */ 50 EXTERN void Snack_ExecCallbacks _ANSI_ARGS_((Sound * s, int flag)); 51 /* 7 */ 52 EXTERN void Snack_UpdateExtremes _ANSI_ARGS_((Sound * s, 53 int start, int end, int flag)); 54 /* 8 */ 55 EXTERN Sound * Snack_GetSound _ANSI_ARGS_((Tcl_Interp * interp, 56 char * name)); 57 /* 9 */ 58 EXTERN Sound * Snack_NewSound _ANSI_ARGS_((int frequency, 59 int format, int nchannels)); 60 /* 10 */ 61 EXTERN int Snack_ResizeSoundStorage _ANSI_ARGS_((Sound * s, 62 int len)); 63 /* 11 */ 64 EXTERN void Snack_DeleteSound _ANSI_ARGS_((Sound * s)); 65 /* 12 */ 66 EXTERN void Snack_PutSoundData _ANSI_ARGS_((Sound * s, int pos, 67 void * buf, int nBytes)); 68 /* 13 */ 69 EXTERN void Snack_GetSoundData _ANSI_ARGS_((Sound * s, int pos, 70 void * buf, int nBytes)); 71 /* 14 */ 72 EXTERN unsigned char Snack_Lin2Alaw _ANSI_ARGS_((short pcm_val)); 73 /* 15 */ 74 EXTERN unsigned char Snack_Lin2Mulaw _ANSI_ARGS_((short pcm_val)); 75 /* 16 */ 76 EXTERN short Snack_Alaw2Lin _ANSI_ARGS_((unsigned char a_val)); 77 /* 17 */ 78 EXTERN short Snack_Mulaw2Lin _ANSI_ARGS_((unsigned char u_val)); 79 /* 18 */ 80 EXTERN short Snack_SwapShort _ANSI_ARGS_((short s)); 81 /* 19 */ 82 EXTERN int SnackSeekFile _ANSI_ARGS_((seekProc * SeekProc, 83 Sound * s, Tcl_Interp * interp, 84 Tcl_Channel ch, int pos)); 85 /* 20 */ 86 EXTERN int SnackOpenFile _ANSI_ARGS_((openProc * OpenProc, 87 Sound * s, Tcl_Interp * interp, 88 Tcl_Channel * ch, char * mode)); 89 /* 21 */ 90 EXTERN int SnackCloseFile _ANSI_ARGS_((closeProc * CloseProc, 91 Sound * s, Tcl_Interp * interp, 92 Tcl_Channel * ch)); 93 /* 22 */ 94 EXTERN void Snack_WriteLog _ANSI_ARGS_((char * s)); 95 /* 23 */ 96 EXTERN void Snack_WriteLogInt _ANSI_ARGS_((char * s, int n)); 97 /* 24 */ 98 EXTERN Snack_FileFormat * Snack_GetFileFormats _ANSI_ARGS_((void)); 99 /* 25 */ 100 EXTERN void Snack_InitWindow _ANSI_ARGS_((float * hamwin, 101 int winlen, int fftlen, int type)); 102 /* 26 */ 103 EXTERN int Snack_InitFFT _ANSI_ARGS_((int n)); 104 /* 27 */ 105 EXTERN void Snack_DBPowerSpectrum _ANSI_ARGS_((float * x)); 106 /* 28 */ 107 EXTERN void Snack_StopSound _ANSI_ARGS_((Sound * s, 108 Tcl_Interp * interp)); 109 /* 29 */ 110 EXTERN int Snack_ProgressCallback _ANSI_ARGS_((Tcl_Obj * cmd, 111 Tcl_Interp * interp, char * type, 112 double fraction)); 113 /* 30 */ 114 EXTERN void Snack_CreateFileFormat _ANSI_ARGS_(( 115 Snack_FileFormat * typePtr)); 116 /* 31 */ 117 EXTERN long Snack_SwapLong _ANSI_ARGS_((long s)); 118 /* 32 */ 119 EXTERN int Snack_PlatformIsLittleEndian _ANSI_ARGS_((void)); 120 /* 33 */ 121 EXTERN void Snack_CreateFilterType _ANSI_ARGS_(( 122 Snack_FilterType * typePtr)); 123 /* 34 */ 124 EXTERN int SaveSound _ANSI_ARGS_((Sound * s, 125 Tcl_Interp * interp, char * filename, 126 Tcl_Obj * obj, int objc, 127 Tcl_Obj *CONST objv[], int startpos, int len, 128 char * type)); 129 130 typedef struct SnackStubs { 131 int magic; 132 struct SnackStubHooks *hooks; 133 134 void *reserved0; 135 void *reserved1; 136 int (*snack_AddSubCmd) _ANSI_ARGS_((int snackCmd, char * cmdName, Snack_CmdProc * cmdProc, Snack_DelCmdProc * delCmdProc)); /* 2 */ 137 int (*snack_AddFileFormat) _ANSI_ARGS_((char * formatName, guessFileTypeProc * guessProc, getHeaderProc * GetHeaderProc, extensionFileTypeProc * extProc, putHeaderProc * PutHeaderProc, openProc * OpenProc, closeProc * CloseProc, readSamplesProc * ReadSamplesProc, writeSamplesProc * WriteSamplesProc, seekProc * SeekProc)); /* 3 */ 138 int (*snack_AddCallback) _ANSI_ARGS_((Sound * s, updateProc * proc, ClientData cd)); /* 4 */ 139 void (*snack_RemoveCallback) _ANSI_ARGS_((Sound * s, int id)); /* 5 */ 140 void (*snack_ExecCallbacks) _ANSI_ARGS_((Sound * s, int flag)); /* 6 */ 141 void (*snack_UpdateExtremes) _ANSI_ARGS_((Sound * s, int start, int end, int flag)); /* 7 */ 142 Sound * (*snack_GetSound) _ANSI_ARGS_((Tcl_Interp * interp, char * name)); /* 8 */ 143 Sound * (*snack_NewSound) _ANSI_ARGS_((int frequency, int format, int nchannels)); /* 9 */ 144 int (*snack_ResizeSoundStorage) _ANSI_ARGS_((Sound * s, int len)); /* 10 */ 145 void (*snack_DeleteSound) _ANSI_ARGS_((Sound * s)); /* 11 */ 146 void (*snack_PutSoundData) _ANSI_ARGS_((Sound * s, int pos, void * buf, int nBytes)); /* 12 */ 147 void (*snack_GetSoundData) _ANSI_ARGS_((Sound * s, int pos, void * buf, int nBytes)); /* 13 */ 148 unsigned char (*snack_Lin2Alaw) _ANSI_ARGS_((short pcm_val)); /* 14 */ 149 unsigned char (*snack_Lin2Mulaw) _ANSI_ARGS_((short pcm_val)); /* 15 */ 150 short (*snack_Alaw2Lin) _ANSI_ARGS_((unsigned char a_val)); /* 16 */ 151 short (*snack_Mulaw2Lin) _ANSI_ARGS_((unsigned char u_val)); /* 17 */ 152 short (*snack_SwapShort) _ANSI_ARGS_((short s)); /* 18 */ 153 int (*snackSeekFile) _ANSI_ARGS_((seekProc * SeekProc, Sound * s, Tcl_Interp * interp, Tcl_Channel ch, int pos)); /* 19 */ 154 int (*snackOpenFile) _ANSI_ARGS_((openProc * OpenProc, Sound * s, Tcl_Interp * interp, Tcl_Channel * ch, char * mode)); /* 20 */ 155 int (*snackCloseFile) _ANSI_ARGS_((closeProc * CloseProc, Sound * s, Tcl_Interp * interp, Tcl_Channel * ch)); /* 21 */ 156 void (*snack_WriteLog) _ANSI_ARGS_((char * s)); /* 22 */ 157 void (*snack_WriteLogInt) _ANSI_ARGS_((char * s, int n)); /* 23 */ 158 Snack_FileFormat * (*snack_GetFileFormats) _ANSI_ARGS_((void)); /* 24 */ 159 void (*snack_InitWindow) _ANSI_ARGS_((float * hamwin, int winlen, int fftlen, int type)); /* 25 */ 160 int (*snack_InitFFT) _ANSI_ARGS_((int n)); /* 26 */ 161 void (*snack_DBPowerSpectrum) _ANSI_ARGS_((float * x)); /* 27 */ 162 void (*snack_StopSound) _ANSI_ARGS_((Sound * s, Tcl_Interp * interp)); /* 28 */ 163 int (*snack_ProgressCallback) _ANSI_ARGS_((Tcl_Obj * cmd, Tcl_Interp * interp, char * type, double fraction)); /* 29 */ 164 void (*snack_CreateFileFormat) _ANSI_ARGS_((Snack_FileFormat * typePtr)); /* 30 */ 165 long (*snack_SwapLong) _ANSI_ARGS_((long s)); /* 31 */ 166 int (*snack_PlatformIsLittleEndian) _ANSI_ARGS_((void)); /* 32 */ 167 void (*snack_CreateFilterType) _ANSI_ARGS_((Snack_FilterType * typePtr)); /* 33 */ 168 int (*saveSound) _ANSI_ARGS_((Sound * s, Tcl_Interp * interp, char * filename, Tcl_Obj * obj, int objc, Tcl_Obj *CONST objv[], int startpos, int len, char * type)); /* 34 */ 169 } SnackStubs; 170 171 #ifdef __cplusplus 172 extern "C" { 173 #endif 174 extern SnackStubs *snackStubsPtr; 175 #ifdef __cplusplus 176 } 177 #endif 178 179 #if defined(USE_SNACK_STUBS) && !defined(USE_SNACK_STUB_PROCS) 180 181 /* 182 * Inline function declarations: 183 */ 184 185 /* Slot 0 is reserved */ 186 /* Slot 1 is reserved */ 187 #ifndef Snack_AddSubCmd 188 #define Snack_AddSubCmd \ 189 (snackStubsPtr->snack_AddSubCmd) /* 2 */ 190 #endif 191 #ifndef Snack_AddFileFormat 192 #define Snack_AddFileFormat \ 193 (snackStubsPtr->snack_AddFileFormat) /* 3 */ 194 #endif 195 #ifndef Snack_AddCallback 196 #define Snack_AddCallback \ 197 (snackStubsPtr->snack_AddCallback) /* 4 */ 198 #endif 199 #ifndef Snack_RemoveCallback 200 #define Snack_RemoveCallback \ 201 (snackStubsPtr->snack_RemoveCallback) /* 5 */ 202 #endif 203 #ifndef Snack_ExecCallbacks 204 #define Snack_ExecCallbacks \ 205 (snackStubsPtr->snack_ExecCallbacks) /* 6 */ 206 #endif 207 #ifndef Snack_UpdateExtremes 208 #define Snack_UpdateExtremes \ 209 (snackStubsPtr->snack_UpdateExtremes) /* 7 */ 210 #endif 211 #ifndef Snack_GetSound 212 #define Snack_GetSound \ 213 (snackStubsPtr->snack_GetSound) /* 8 */ 214 #endif 215 #ifndef Snack_NewSound 216 #define Snack_NewSound \ 217 (snackStubsPtr->snack_NewSound) /* 9 */ 218 #endif 219 #ifndef Snack_ResizeSoundStorage 220 #define Snack_ResizeSoundStorage \ 221 (snackStubsPtr->snack_ResizeSoundStorage) /* 10 */ 222 #endif 223 #ifndef Snack_DeleteSound 224 #define Snack_DeleteSound \ 225 (snackStubsPtr->snack_DeleteSound) /* 11 */ 226 #endif 227 #ifndef Snack_PutSoundData 228 #define Snack_PutSoundData \ 229 (snackStubsPtr->snack_PutSoundData) /* 12 */ 230 #endif 231 #ifndef Snack_GetSoundData 232 #define Snack_GetSoundData \ 233 (snackStubsPtr->snack_GetSoundData) /* 13 */ 234 #endif 235 #ifndef Snack_Lin2Alaw 236 #define Snack_Lin2Alaw \ 237 (snackStubsPtr->snack_Lin2Alaw) /* 14 */ 238 #endif 239 #ifndef Snack_Lin2Mulaw 240 #define Snack_Lin2Mulaw \ 241 (snackStubsPtr->snack_Lin2Mulaw) /* 15 */ 242 #endif 243 #ifndef Snack_Alaw2Lin 244 #define Snack_Alaw2Lin \ 245 (snackStubsPtr->snack_Alaw2Lin) /* 16 */ 246 #endif 247 #ifndef Snack_Mulaw2Lin 248 #define Snack_Mulaw2Lin \ 249 (snackStubsPtr->snack_Mulaw2Lin) /* 17 */ 250 #endif 251 #ifndef Snack_SwapShort 252 #define Snack_SwapShort \ 253 (snackStubsPtr->snack_SwapShort) /* 18 */ 254 #endif 255 #ifndef SnackSeekFile 256 #define SnackSeekFile \ 257 (snackStubsPtr->snackSeekFile) /* 19 */ 258 #endif 259 #ifndef SnackOpenFile 260 #define SnackOpenFile \ 261 (snackStubsPtr->snackOpenFile) /* 20 */ 262 #endif 263 #ifndef SnackCloseFile 264 #define SnackCloseFile \ 265 (snackStubsPtr->snackCloseFile) /* 21 */ 266 #endif 267 #ifndef Snack_WriteLog 268 #define Snack_WriteLog \ 269 (snackStubsPtr->snack_WriteLog) /* 22 */ 270 #endif 271 #ifndef Snack_WriteLogInt 272 #define Snack_WriteLogInt \ 273 (snackStubsPtr->snack_WriteLogInt) /* 23 */ 274 #endif 275 #ifndef Snack_GetFileFormats 276 #define Snack_GetFileFormats \ 277 (snackStubsPtr->snack_GetFileFormats) /* 24 */ 278 #endif 279 #ifndef Snack_InitWindow 280 #define Snack_InitWindow \ 281 (snackStubsPtr->snack_InitWindow) /* 25 */ 282 #endif 283 #ifndef Snack_InitFFT 284 #define Snack_InitFFT \ 285 (snackStubsPtr->snack_InitFFT) /* 26 */ 286 #endif 287 #ifndef Snack_DBPowerSpectrum 288 #define Snack_DBPowerSpectrum \ 289 (snackStubsPtr->snack_DBPowerSpectrum) /* 27 */ 290 #endif 291 #ifndef Snack_StopSound 292 #define Snack_StopSound \ 293 (snackStubsPtr->snack_StopSound) /* 28 */ 294 #endif 295 #ifndef Snack_ProgressCallback 296 #define Snack_ProgressCallback \ 297 (snackStubsPtr->snack_ProgressCallback) /* 29 */ 298 #endif 299 #ifndef Snack_CreateFileFormat 300 #define Snack_CreateFileFormat \ 301 (snackStubsPtr->snack_CreateFileFormat) /* 30 */ 302 #endif 303 #ifndef Snack_SwapLong 304 #define Snack_SwapLong \ 305 (snackStubsPtr->snack_SwapLong) /* 31 */ 306 #endif 307 #ifndef Snack_PlatformIsLittleEndian 308 #define Snack_PlatformIsLittleEndian \ 309 (snackStubsPtr->snack_PlatformIsLittleEndian) /* 32 */ 310 #endif 311 #ifndef Snack_CreateFilterType 312 #define Snack_CreateFilterType \ 313 (snackStubsPtr->snack_CreateFilterType) /* 33 */ 314 #endif 315 #ifndef SaveSound 316 #define SaveSound \ 317 (snackStubsPtr->saveSound) /* 34 */ 318 #endif 319 320 #endif /* defined(USE_SNACK_STUBS) && !defined(USE_SNACK_STUB_PROCS) */ 321 322 /* !END!: Do not edit above this line. */ 323 324 #endif /* _SNACKDECLS */ 325