ftp.nice.ch/pub/next/unix/audio/cmusic.bs.N.tar.gz#/src/cmusic/m.defs.h

This is m.defs.h in view mode; [Download] [Up]

#include "m.structs.h"

/* DEFINITIONS */

#define ALLOC(n,s,t) (t *) calloc((n), (s)*sizeof(t))
#define BARE0(s) if(Barefile)fprintf(Barefile,s);
#define BARE1(s,a) if(Barefile)fprintf(Barefile,s,a);
#define CMD(name) print(sprintf(Junk,"Command '%s'", name));
#define ENDLIST(p,n,r) for(p=r; p->n; p=p->n)
#define EXCESS print(" Excess")
#define EXTEND(p,r,n,t) if(r) r = (t *) realloc(r,(n)*sizeof(t));\
 else r = (t *) malloc((n)*sizeof(t)); p = (t *) (r+(n)-1)
#define FORLIST(p,n,r) for(p=r; p; p=p->n)
#define FTYPE(name) print(sprintf(Junk," Field Type '%c'",name))
#define FUNC(name) print(sprintf(Junk," Function '%s'", name))
#define GEN(name) print(sprintf(Junk,"Generator '%s'", name))
#define ILLEG print(" Illegal")
#define INS(name) print(sprintf(Junk,"Instrument '%s'", name))
#define LINK(p,n,r,t) if(!r)r = p = NEWNODE(t);\
 else{ ENDLIST(p,n,r); p->n = NEWNODE(t); p = p->n; }
#define	UNLINK(p,n,r,t)	if(p==r)r=p->n;else{for(t=r;t->n!=p;t=t->n);t->n=p->n;}
#define NEWNODE(type) (struct type *) calloc(1, sizeof(struct type))
#define NL print("\n")
#define OS(x) print(sprintf(Junk," %s ",x))
#define	PROUT(a,b) print(sprintf(Junk,a,b));
#define SBRK " ,;\t"
#define SEMIC if(bc!=';')while(field(fld,SIGS,SBRK) != ';')
#define SEQ(X)  {Error++;\
 print(sprintf(Junk,"X: Sequence error: @Time=%.3f < Now=%.3f\n",\
 Time,Now));SEMIC;return;}
#define SFINC(x) if(index(sfld,'x')!=0){\
 Error++;UG(up->ug_name);ILLEG;SFLD(fld); NL;USAGE(up->ug_arglist);continue;}
#define SFLD(name) print(sprintf(Junk," Field '%s'",name))
#define SIGS "\t\n"
#define SKIP {while(field(fld,SIGS,SBRK) != ';'); continue;}
#define STORE(s) strcpy(malloc(strlen(s)+1),s)
#define S1(a,b) !strncmp(a,b,1)
#define S2(a,b) !strncmp(a,b,2)
#define S3(a,b) !strncmp(a,b,3)
#define TWOPI 2.0*3.1415926535
#define UG(name) print(sprintf(Junk," Unit Generator '%s'",name))
#define UNREC Error++; print(" Unrecognized")
#define USAGE(string) print(sprintf(Junk," Usage: '%s'\n",string))
#define DEFERFLAG 02

char *sprintf();
char sfield();

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.