home *** CD-ROM | disk | FTP | other *** search
- /*====================== A MIDI SHARE TOOL (© GRAME 92) =====================
-
- NAME
- MidiStat -- a very simple MidiShare MPW tool
-
- SYNOPSIS
- MidiStat
-
- DESCRIPTION
- "MidiStat" give some informations about the MidiShare environment :
- the amount of free cells in the MidiShare memory and the list of all
- the MidiShare applications currently actives.
-
- ===============================================================================*/
-
-
- #include <String.h>
- #include <StdLib.h>
- #include <Stdio.h>
- #include <MidiShare.h>
-
-
-
- //----------------------------- utilities ---------------------------------
-
- void PtoCstr( char *p, char *c)
- {
- int l;
-
- for (l = *p++; l; l--) *c++ = *p++;
- *c = 0;
- }
-
-
- //-------------------------------- main ------------------------------------
-
- main( int, char **)
- {
- short n, i, r;
- char s[256];
-
- printf("Free space : %d (total space %d)\n", MidiFreeSpace(), MidiTotalSpace());
-
- n = MidiCountAppls(); // count the MidiShare applications
- for (i = 1; i <= n; i++) { // for each application
- r = MidiGetIndAppl(i); // get its reference number from its order number
- PtoCstr(MidiGetName(r), s); // get its name, convert-it to a C string
- printf(" %d: %s (%d)\n", i, s, r); // print its order number, name, and reference number
- }
- }
-
-