00001 #ifndef __MK_libdsp_H___ 00002 #define __MK_libdsp_H___ 00003 /* $Id: libdsp.h 218 2000-01-31 20:23:53Z leigh $ 00004 * External declarations for functions in libdsp_s.a 00005 * Copyright 1988-1992, NeXT Inc. All rights reserved. 00006 * Author: Julius O. Smith III 00007 * 00008 * Note that libdsp_s.a depends only on libsys_s.a. 00009 * 00010 * Functions with prefix DSPMK work only in conjunction with the 00011 * DSP Music Kit Monitor "/usr/local/lib/dsp/monitor/mkmon*.dsp", 00012 * obtained via DSPMKInit(). 00013 * 00014 * Functions with prefix DSPAP (see libarrayproc.h) work in conjunction 00015 * with the array processing monitor "apmon*.dsp", obtained via DSPAPInit(). 00016 * 00017 * Functions with prefix DSP work with EITHER the array processing or 00018 * Music Kit monitors. 00019 * 00020 * Each function returns an integer error code (0 = success, nonzero = error), 00021 * unless its name is of one of the following forms: 00022 * 00023 * (1) "DSPGet<v>()" 00024 * Returns <v>, where <v> can be any scalar C type. 00025 * Example: rx = DSPGetRX() reads the DSP RX register. 00026 * 00027 * (2) "DSP<var>IsEnabled()" 00028 * Returns an open-state variable <var> (zero or nonzero). 00029 * Example: if (DSPErrorLogIsEnabled()) ... 00030 * 00031 * (3) "DSPIs<condition>()" 00032 * Returns <condition> (zero or nonzero). 00033 * Example: if (DSPIsAlive()) ... 00034 * 00035 * For functions which return an error code, the exact nature 00036 * of the error is written to the error log file, if it is enabled. 00037 * (See DSPError.h for error log enabling functions.) 00038 */ 00039 00040 #import <mach/mach.h> 00041 00042 #import "DSPControl.h" 00043 #import "DSPMessage.h" 00044 #import "DSPTransfer.h" 00045 #import "DSPStructMisc.h" 00046 #import "DSPConversion.h" 00047 #import "DSPObject.h" 00048 #import "DSPSymbols.h" 00049 #import "DSPError.h" 00050 00051 /* ============================= DSPLoad.c ================================= */ 00052 00053 extern int DSPLoadFile(char *fn); 00054 /* 00055 * Load DSP from the file specified. 00056 * Equivalent to DSPReadFile followed by DSPLoad. 00057 * 00058 */ 00059 00060 extern int DSPLoad(DSPLoadSpec *dspimg); 00061 /* 00062 * Load everything in *dspimg to the DSP. 00063 */ 00064 00065 00066 /* =============================== DSPBoot.c =============================== */ 00067 00068 extern int DSPBootFile(char *fn); 00069 /* 00070 * Boot DSP from the file specified. 00071 * Equivalent to DSPReadFile followed by DSPBoot. 00072 */ 00073 00074 00075 extern int DSPBoot(DSPLoadSpec *system); 00076 /* 00077 * Load DSP bootstrap program. 00078 * DSPBoot closes the DSP if it is open, resets it, and feeds the 00079 * resident monitor supplied in the struct 'system' to the bootstrapping DSP. 00080 * If system is NULL, the default resident monitor is supplied to the DSP. 00081 * On return, the DSP is open. 00082 */ 00083 00084 extern int DSPReboot(DSPLoadSpec *system); 00085 /* 00086 * Like DSPBoot() but assumes system is the same one used 00087 * the last time this DSP was booted (an optimization to avoid 00088 * resetting the cache.) 00089 */ 00090 00091 00092 /* ============================= DSPReadFile.c ============================= */ 00093 00094 extern int DSPReadFile(DSPLoadSpec **dsppp, const char *fn); 00095 /* 00096 * Read in a DSP file (as produced by the assembler in absolute mode). 00097 * It looks in the system-wide .dsp directory for the given file if 00098 * the user's working directory does not contain a readable version of 00099 * the file (.lnk, .lod, or .dsp). 00100 */ 00101 00102 /* ================================ _DSPCV.c =============================== */ 00103 00104 extern char *DSPFix24ToStr(DSPFix24 datum); 00105 /* 00106 * Convert type DSPFix24 to fractional fixed-point string 00107 */ 00108 00109 00110 extern char *DSPFix48ToSampleStr(DSPFix48 *aTimeStampP); 00111 /* 00112 * Convert type DSPFix48 to fractional time-stamp string in samples 00113 */ 00114 00115 00116 extern char *DSPTimeStampStr(DSPFix48 *aTimeStampP); 00117 /* 00118 * Convert type DSPFix48 to fractional time-stamp string in samples 00119 * or the string "<untimed>" if null, or the string "at end of current tick" 00120 * if time-stamp is zero. 00121 */ 00122 00123 /* ============================= _DSPString.c ============================== */ 00124 00125 extern char *DSPCat(char *f1, const char *f2); 00126 /* 00127 * Concatenate two strings into the returned string. 00128 * Uses malloc to create the returned string. 00129 */ 00130 00131 /* libdsp is by J. O. Smith */ 00132 00133 #endif