home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <dir.h>
- #include <string.h>
- #include <process.h>
-
- #include "mtypes.h"
- #include "wildfile.h"
-
- #include "mloader.h"
- #include "munitrk.h"
-
-
- /*
- Declare external loaders:
- */
-
- extern LOADER mtmload,s3mload,ultload,modload,dsmload,medload,
- farload,s69load,uniload,xmload,stmload,m15load;
-
-
-
- WORD MD_SampleLoad(FILE *fp,ULONG length,ULONG loopstart,ULONG loopend,UWORD flags)
- {
- return 1;
- }
-
-
- void MD_SampleUnLoad(WORD handle)
- {
- }
-
-
- char buffer[256];
-
-
- int main(int argc,char *argv[])
- {
- FILE *fpi;
- int t,v,w;
-
- puts(mikbanner);
-
- // Expand wildcards on commandline (only neccesary for MSDOS):
-
- MyGlob(&argc,&argv,0);
-
- /*
- Register the loaders we want to use..
- */
-
- ML_RegisterLoader(&m15load);
- ML_RegisterLoader(&modload);
- ML_RegisterLoader(&mtmload);
- ML_RegisterLoader(&farload);
- ML_RegisterLoader(&s69load);
- ML_RegisterLoader(&s3mload);
- ML_RegisterLoader(&stmload);
- ML_RegisterLoader(&dsmload);
- ML_RegisterLoader(&medload);
- ML_RegisterLoader(&ultload);
- ML_RegisterLoader(&uniload);
- ML_RegisterLoader(&xmload);
-
- if(argc==1 || argv[1][0]=='/'){
-
- // display a usage message
-
- puts("Usage: MIKDESC <fletch.mod> ...");
- puts("Adds 4Dos descriptions to your music modules\n");
- exit(-1);
- }
-
- for(t=1; t<argc; t++){
-
- UNIMOD *mf;
-
- printf("Adding description to : %s\n",argv[t]);
-
- if((fpi=fopen(argv[t],"rb"))==NULL){
- printf("MikDesc Error: Error opening input file\n");
- continue;
- }
-
- mf=ML_LoadFP(fpi);
-
- // didn't work -> exit with error
-
- if(mf==NULL){
- printf("MikDesc Error: %s\n",myerr);
- fclose(fpi);
- continue;
- }
-
- printf( "Songname: %s\n"
- "Modtype : %s\n",
- mf->songname,
- mf->modtype);
-
- if(mf->songname!=NULL){
- sprintf(buffer,"describe %s \"%s\"",argv[t],mf->songname);
- spawnlp(P_WAIT,getenv("COMSPEC"),getenv("COMSPEC"),"/C",buffer,NULL);
- }
-
- // and clean up
-
- fclose(fpi);
- ML_Free(mf);
- }
- return 0;
- }
-