1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
|
/* seqext.c -- seq extensions for xlisp */
/*
This file extends xlisp with the data type SEQ, including functions
to print and free SEQ type objects.
*/
/* (c) Copyright Carnegie Mellon University 1991, 1994
* For a statement of limited permission to use, see Permission.doc
*/
/* CHANGE LOG
* --------------------------------------------------------------------
* 28Apr03 dm portability fix: use %p instead of %lx
*/
#include "stdio.h"
#include "xlisp.h"
#include "cext.h"
#include "userio.h"
#include "midifns.h"
#include "timebase.h"
#include "seq.h"
#include "moxc.h"
#include "seqread.h"
#include "seqext.h"
#include "extern.h"
LVAL s_seq;
xtype_desc seq_desc;
static void xlseq_print();
void nop() {}
boolean seqp(s)
LVAL s;
{
return exttypep(s, s_seq);
}
/* xlseq_free gets called by xlisp when the GC frees a seq object.
* seq_free is a macro, so here we make it into a function pointer.
*/
static void xlseq_free(sequence)
seq_type sequence;
{
seq_free(sequence);
}
static void xlseq_print(fptr, sequence)
LVAL fptr;
seq_type sequence;
{
char s[32];
sprintf(s, "#<SEQ:0x%p>", sequence);
xlputstr(fptr, s);
}
static void xlseq_save(fp, sequence)
FILE *fp;
seq_type sequence;
{
errputstr("xlseq_save called\n");
}
static unsigned char *xlseq_restore(fp)
FILE *fp;
{
errputstr("xlseq_restore called\n");
return 0;
}
void seqext_init()
{
/* printf("localinit called\n"); */
seq_desc = create_desc("SEQ", xlseq_free, xlseq_print, xlseq_save,
xlseq_restore, NULL);
moxcinit(0, (char **) NULL);
}
void seqext_symbols()
{
s_seq = xlenter("SEQ");
}
|