MusicKit
0.0.0
|
00001 #ifndef __MK__libdsp_H___ 00002 #define __MK__libdsp_H___ 00003 /* Copyright 1988-1992, NeXT Inc. All rights reserved. */ 00004 /* _libdsp.h - private functions in libdsp_s.a 00005 00006 01/13/90/jos - Replaced _DSPMessage.h expansion by explicit import. 00007 */ 00008 00009 #include "MKDSPDefines.h" 00010 00011 #import "_DSPTransfer.h" 00012 #import "_DSPObject.h" 00013 #import "_DSPMach.h" 00014 #import "_DSPMessage.h" 00015 00016 /* ============================= _DSPRelocate.c ============================ */ 00017 00018 MKDSP_API int _DSPReloc(DSPDataRecord *data, DSPFixup *fixups, 00019 int fixupCount, int *loadAddresses); 00020 /* 00021 * dataRec is assumed to be a P data space. Fixes it up in place. 00022 * This is a private libdsp method used by _DSPSendUGTimed and 00023 * _DSPRelocate. 00024 */ 00025 00026 MKDSP_API int _DSPRelocate(); 00027 MKDSP_API int _DSPRelocateUser(); 00028 00029 /* ============================= DSPControl.c ============================== */ 00030 MKDSP_API int _DSPCheckMappedMode(); 00031 MKDSP_API int _DSPEnterMappedMode(); 00032 MKDSP_API int _DSPEnterMappedModeNoCheck(); 00033 MKDSP_API int _DSPEnterMappedModeNoPing(); 00034 MKDSP_API int _DSPExitMappedMode(); 00035 MKDSP_API int _DSPReadSSI(); 00036 MKDSP_API int _DSPSetSCISCR(); 00037 MKDSP_API int _DSPSetSCISCCR(); 00038 MKDSP_API int _DSPSetSSICRA(); 00039 MKDSP_API int _DSPSetSSICRB(); 00040 MKDSP_API int _DSPSetStartTimed(); 00041 MKDSP_API int _DSPSetTime(); 00042 MKDSP_API int _DSPSetTimeFromInts(); 00043 MKDSP_API int _DSPSineTest(); 00044 MKDSP_API int _DSPStartTimed(); 00045 MKDSP_API DSPDatum _DSPGetValue(); 00046 00047 /* ============================= DSPReadFile.c ============================= */ 00048 MKDSP_API char *_DSPFGetRecord(); 00049 MKDSP_API int _DSPGetIntHexStr6(); 00050 MKDSP_API int _DSPLnkRead(); 00051 MKDSP_API char *_DSPAddSymbol(); 00052 MKDSP_API int _DSPGetRelIntHexStr(); 00053 MKDSP_API char *_DSPUniqueName(); 00054 00055 /* ============================ DSPStructMisc.c ============================ */ 00056 00057 MKDSP_API int _DSPCheckingFWrite( int *ptr, int size, int nitems, FILE *stream); 00058 MKDSP_API int _DSPWriteString(char *str, FILE *fp); 00059 MKDSP_API int _DSPReadString(char **spp, FILE *fp); 00060 MKDSP_API int _DSPFreeString(char *str); 00061 MKDSP_API char *_DSPContiguousMalloc(unsigned size); 00062 MKDSP_API int _DSPContiguousFree(char *ptr); 00063 MKDSP_API void DSPMemMapInit(_DSPMemMap *mm); 00064 MKDSP_API void DSPMemMapPrint(_DSPMemMap *mm); 00065 00066 MKDSP_API char *_DSPContiguousMalloc(unsigned size); 00067 /* 00068 * Same as malloc except allocates in one contiguous piece of 00069 * memory. Calls realloc as necessary to extend the block. 00070 */ 00071 00072 00073 /* ============================ _DSPUtilities.c ============================ */ 00074 MKDSP_API void _DSPErr(); 00075 MKDSP_API char *_DSPFirstReadableFile(char *fn,...); 00076 MKDSP_API char *_DSPGetBody(); 00077 MKDSP_API char _DSPGetField(); 00078 MKDSP_API int _DSPGetFilter(); 00079 MKDSP_API float _DSPGetFloatStr(); 00080 MKDSP_API char *_DSPGetHead(); 00081 MKDSP_API void _DSPGetInputFile(); 00082 MKDSP_API void _DSPGetInputOutputFiles(); 00083 MKDSP_API int _DSPGetIntStr(); 00084 MKDSP_API char *_DSPGetLineStr(); 00085 MKDSP_API void _DSPGetOutputFile(); 00086 MKDSP_API char *_DSPGetSN(); 00087 MKDSP_API char *_DSPGetTail(); 00088 MKDSP_API char *_DSPGetTokStr(); 00089 MKDSP_API int _DSPInInt(); 00090 MKDSP_API int _DSPIndexS(); 00091 MKDSP_API char *_DSPIntToChar(); 00092 MKDSP_API int *_DSPMakeArray(); 00093 MKDSP_API FILE *_DSPMyFopen(); 00094 MKDSP_API char *_DSPPadStr(); 00095 MKDSP_API void _DSPParseName(); 00096 MKDSP_API void _DSPPutFilter(); 00097 MKDSP_API char *_DSPRemoveHead(); 00098 MKDSP_API char *_DSPRemoveTail(); 00099 MKDSP_API int _DSPSaveMatD(); 00100 MKDSP_API int _DSPSezYes(); 00101 MKDSP_API char *_DSPSkipToWhite(); 00102 MKDSP_API char *_DSPSkipWhite(); 00103 MKDSP_API DSP_BOOL _DSPGetFile(); 00104 MKDSP_API DSPLocationCounter _DSPGetMemStr(); 00105 MKDSP_API DSP_BOOL _DSPNotBlank(); 00106 00107 /* ============================ DSPConversion.c ============================ */ 00108 00109 MKDSP_API DSPFix48 *_DSPDoubleIntToFix48UseArg(double dval,DSPFix48 *aFix48P); 00110 /* 00111 * The double is assumed to be between -2^47 and 2^47. 00112 * Returns, in *aFix48P, the value as represented by dval. 00113 * aFix48P must point to a valid DSPFix48 struct. 00114 */ 00115 00116 /* ============================= _DSPError.c =============================== */ 00117 00118 MKDSP_API int _DSPCheckErrorFP(void); 00119 /* 00120 * Check error file-pointer. 00121 * If nonzero, return. 00122 * If zero, open /tmp/dsperrors and return file-pointer for it. 00123 * Also, write DSP interlock info to dsperrors. 00124 */ 00125 00126 00127 MKDSP_API int _DSPErrorV(int errorcode,char *fmt,...); 00128 00129 00130 MKDSP_API int _DSPError1( 00131 int errorcode, 00132 char *msg, 00133 char *arg); 00134 00135 00136 MKDSP_API int _DSPError( 00137 int errorcode, 00138 char *msg); 00139 00140 00141 MKDSP_API void _DSPFatalError( 00142 int errorcode, 00143 char *msg); 00144 00145 00146 MKDSP_API int _DSPMachError( 00147 int error, 00148 char *msg); 00149 00150 00151 MKDSP_API int _DSPCheckErrorFP(void); 00152 /* 00153 * Check error file-pointer. 00154 * If nonzero, return. 00155 * If zero, open /tmp/dsperrors and return file-pointer for it. 00156 * Also, write DSP interlock info to dsperrors. 00157 */ 00158 00159 00160 MKDSP_API int _DSPErrorV(int errorcode,char *fmt,...); 00161 00162 00163 MKDSP_API int _DSPError1( 00164 int errorcode, 00165 char *msg, 00166 char *arg); 00167 00168 00169 MKDSP_API int _DSPError( 00170 int errorcode, 00171 char *msg); 00172 00173 00174 MKDSP_API void _DSPFatalError( 00175 int errorcode, 00176 char *msg); 00177 00178 00179 MKDSP_API int _DSPMachError( 00180 int error, 00181 char *msg); 00182 00183 /* ============================== _DSPCV.c ================================= */ 00184 00185 MKDSP_API char *_DSPCVAS( 00186 int n, /* number to be converted */ 00187 int fmt); /* 0=decimal, 1=hex format */ 00188 /* 00189 * Convert integer to decimal or hex string 00190 */ 00191 00192 00193 MKDSP_API char *_DSPCVS(int n); 00194 /* 00195 * Convert integer to decimal string 00196 */ 00197 00198 00199 MKDSP_API char *_DSPCVHS(int n); 00200 /* 00201 * Convert integer to hex string 00202 */ 00203 00204 00205 MKDSP_API char *_DSPCVDS(float d); 00206 /* 00207 * Convert double to hex string 00208 */ 00209 00210 00211 MKDSP_API char *_DSPCVFS(float f); 00212 /* 00213 * Convert float to hex string 00214 */ 00215 00216 00217 MKDSP_API char *_DSPIntToChar(int i); 00218 /* 00219 * Convert digit between 0 and 9 to corresponding character. 00220 */ 00221 00222 /* ============================ _DSPString.c =============================== */ 00223 00224 MKDSP_API char *_DSPNewStr(int size); 00225 /* 00226 * Create string of given total length in bytes. 00227 */ 00228 00229 00230 MKDSP_API char *_DSPMakeStr( 00231 int size, /* size = total length incl \0 */ 00232 char *init); /* initialization string */ 00233 /* 00234 * create new string initialized by given string. 00235 */ 00236 00237 00238 MKDSP_API char *_DSPCat( 00239 char *f1, 00240 char *f2); 00241 /* 00242 * Concatenate two strings 00243 */ 00244 00245 00246 MKDSP_API char *_DSPReCat( 00247 char *f1, 00248 char *f2); 00249 /* 00250 * append second string to first via realloc 00251 */ 00252 00253 00254 MKDSP_API char *_DSPCopyStr(char *s); 00255 /* 00256 * Copy string s into freshly malloc'd storage. 00257 */ 00258 00259 00260 MKDSP_API char *_DSPToLowerStr( 00261 char *s); /* input string = output string */ 00262 /* 00263 * Convert all string chars to lower case. 00264 */ 00265 00266 00267 MKDSP_API char *_DSPToUpperStr( 00268 char *s); /* input string = output string */ 00269 /* 00270 * Convert all string chars to upper case. 00271 */ 00272 00273 MKDSP_API char *_DSPCopyToUpperStr( 00274 char *s); /* input string = output string */ 00275 /* 00276 * Efficient combo of _DSPCopyStr and _DSPToUpperStr 00277 */ 00278 00279 MKDSP_API int _DSPStrCmpI(char *mixedCaseStr,char *upperCaseStr) ; 00280 /* like strcmp but assumes first arg is mixed case and second is upper case 00281 * and does a case-independent compare. 00282 * 00283 * _DSPStrCmpI compares its arguments and returns an integer greater 00284 * than, equal to, or less than 0, according as mixedCaseStr is lexico- 00285 * graphically greater than, equal to, or less than upperCaseStr. 00286 */ 00287 00288 #endif 00289