You can subscribe to this list here.
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(22) |
Aug
(270) |
Sep
|
Oct
|
Nov
|
Dec
|
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2005 |
Jan
(8) |
Feb
(24) |
Mar
|
Apr
|
May
|
Jun
(5) |
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
(2) |
Dec
(2) |
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
(25) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(6) |
Oct
(3) |
Nov
(1) |
Dec
(14) |
| 2008 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
(31) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
|
Feb
|
Mar
|
Apr
(90) |
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|
From: Martin R. <ru...@us...> - 2004-08-05 23:14:06
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11334 Modified Files: misc.c module.m pointer.m signals.m tell.m Log Message: integrated OSX hack Index: pointer.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/pointer.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** pointer.m 5 Aug 2004 18:58:52 -0000 1.2 --- pointer.m 5 Aug 2004 23:13:56 -0000 1.3 *************** *** 36,41 **** #include <strings.h> ! // #include <objc/objc-class.h> /* for id, objc_class, etc */ #include <objc/objc-api.h> /* for id, objc_class, etc */ #define Object SchemeObject /* avoid Obj-C type clash */ --- 36,47 ---- #include <strings.h> ! ! #ifdef NeXT_RUNTIME ! #include <objc/objc-class.h> /* for id, objc_class, etc */ ! #elif GNU_RUNTIME #include <objc/objc-api.h> /* for id, objc_class, etc */ + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif #define Object SchemeObject /* avoid Obj-C type clash */ *************** *** 304,312 **** id obj = ((id) (POINTER_T(x)->pointer)); char *otype = "instance"; ! // if (CLS_GETINFO(obj->isa, CLS_META)) if (CLS_ISMETA(obj->class_pointer)) otype = "class"; ! // Printf(port, " {%s %s}", obj->isa->name, otype); Printf(port, " {%s %s}", obj->class_pointer->name, otype); } Printf(port, " (%u)]", (unsigned int)POINTER_T(x)->pointer); --- 310,328 ---- id obj = ((id) (POINTER_T(x)->pointer)); char *otype = "instance"; ! #ifdef NeXT_RUNTIME ! if (CLS_GETINFO(obj->isa, CLS_META)) ! #elif GNU_RUNTIME if (CLS_ISMETA(obj->class_pointer)) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif otype = "class"; ! #ifdef NeXT_RUNTIME ! Printf(port, " {%s %s}", obj->isa->name, otype); ! #elif GNU_RUNTIME Printf(port, " {%s %s}", obj->class_pointer->name, otype); + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif } Printf(port, " (%u)]", (unsigned int)POINTER_T(x)->pointer); Index: misc.c =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/misc.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** misc.c 5 Aug 2004 22:20:57 -0000 1.3 --- misc.c 5 Aug 2004 23:13:56 -0000 1.4 *************** *** 41,49 **** #endif #include <unistd.h> #include <string.h> #include <limits.h> // for PATH_MAX #include <sys/types.h> - #include <sys/timeb.h> #include <sys/wait.h> // #include <libc.h> --- 41,55 ---- #endif + #ifdef HAVE_SYS_TIME_H + #include <sys/time.h> + #endif + #ifdef HAVE_TIME_H + #include <time.h> + #endif + #include <unistd.h> #include <string.h> #include <limits.h> // for PATH_MAX #include <sys/types.h> #include <sys/wait.h> // #include <libc.h> Index: tell.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/tell.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tell.m 5 Aug 2004 18:58:52 -0000 1.2 --- tell.m 5 Aug 2004 23:13:56 -0000 1.3 *************** *** 35,49 **** #endif - // #include <objc/objc-runtime.h> - #include <Foundation/NSInvocation.h> #include <Foundation/NSMethodSignature.h> #include <objc/objc.h> #include <objc/objc-api.h> #include <objc/encoding.h> ! ! // for marg_setValue, method_getArgumentInfo etc... ! // #include <KoBase/KBCompatibility.h> #include <strings.h> --- 35,52 ---- #endif #include <Foundation/NSInvocation.h> #include <Foundation/NSMethodSignature.h> #include <objc/objc.h> + + #ifdef NeXT_RUNTIME + #include <objc/objc-class.h> /* for id, objc_class, etc */ + #include <objc/objc-runtime.h> + #elif GNU_RUNTIME #include <objc/objc-api.h> #include <objc/encoding.h> ! #else ! #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** ! #endif #include <strings.h> *************** *** 151,162 **** if (retsize == sizeof(double)) ! // ret.d = ((double (*) ())objc_msgSendv)(obj, sel, size, frame); ret.d = ((double (*) ())objc_msg_sendv)(obj, sel, frame); else ! // ret.V = objc_msgSendv(obj, sel, size, frame); ret.V = objc_msg_sendv(obj, sel, frame); return ret; } #define PUSH(type, value) marg_setValue(frame, offset, type, value); break --- 154,180 ---- if (retsize == sizeof(double)) ! { ! #ifdef NeXT_RUNTIME ! ret.d = ((double (*) ())objc_msgSendv)(obj, sel, size, frame); ! #elif GNU_RUNTIME ret.d = ((double (*) ())objc_msg_sendv)(obj, sel, frame); + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + } else ! { ! #ifdef NeXT_RUNTIME ! ret.V = objc_msgSendv(obj, sel, size, frame); ! #elif GNU_RUNTIME ret.V = objc_msg_sendv(obj, sel, frame); + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + } return ret; } + #define PUSH(type, value) marg_setValue(frame, offset, type, value); break *************** *** 504,534 **** selector = argv[1]; GC_Link2(receiver, selector); ! switch (TYPE(receiver)) { case T_Symbol: receiver = SYMBOL(receiver)->name; case T_String: name = Get_String(receiver); ! // if ((obj = objc_getClass(name)) == nil) if ((obj = objc_get_class(name)) == nil) Primitive_Error("class not found: ~s", receiver); break; default: ! if (TYPE(receiver) == T_Pointer) { if (POINTER_T(receiver)->type.data != C_ID) Primitive_Error("illegal receiver type: ~s", receiver); if ((obj = (id) POINTER_T(receiver)->pointer) == nil) Primitive_Error("null pointer: ~s", receiver); ! } else Wrong_Type_Combination(receiver, "string, symbol or pointer"); } ! switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); ! // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("method not found: ~s", selector); // new: this avoids breakdown in class_get_instance_method --- 522,579 ---- selector = argv[1]; GC_Link2(receiver, selector); ! switch (TYPE(receiver)) ! { case T_Symbol: receiver = SYMBOL(receiver)->name; + case T_String: name = Get_String(receiver); ! #ifdef NeXT_RUNTIME ! if ((obj = objc_getClass(name)) == nil) ! #elif GNU_RUNTIME if ((obj = objc_get_class(name)) == nil) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("class not found: ~s", receiver); + } break; + default: ! if (TYPE(receiver) == T_Pointer) ! { if (POINTER_T(receiver)->type.data != C_ID) + { Primitive_Error("illegal receiver type: ~s", receiver); + } if ((obj = (id) POINTER_T(receiver)->pointer) == nil) + { Primitive_Error("null pointer: ~s", receiver); ! } ! } else + { Wrong_Type_Combination(receiver, "string, symbol or pointer"); + } } ! ! switch (TYPE(selector)) ! { case T_Symbol: selector = SYMBOL(selector)->name; + case T_String: name = Get_String(selector); ! #ifdef NeXT_RUNTIME ! if ((sel = sel_getUid(name)) == 0) ! #elif GNU_RUNTIME if ((sel = sel_get_uid(name)) == 0) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("method not found: ~s", selector); + } // new: this avoids breakdown in class_get_instance_method *************** *** 538,556 **** } break; default: ! if (TYPE(selector) == T_Pointer) { if (POINTER_T(selector)->type.data != C_SEL) Primitive_Error("illegal selector type: ~s", selector); if ((sel = (SEL)POINTER_T(selector)->pointer) == NULL) Primitive_Error("null pointer: ~s", selector); if (sel_isMapped(sel) == NO) Primitive_Error("selector not mapped: ~s", selector); } else Wrong_Type_Combination(receiver, "string, symbol or sel"); ! } ! // if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) Primitive_Error("can't access method for selector: ~s", selector); result = Objc_Send(obj, sel, meth, argc - 2, argv + 2); GC_Unlink; --- 583,618 ---- } break; + default: ! if (TYPE(selector) == T_Pointer) ! { if (POINTER_T(selector)->type.data != C_SEL) + { Primitive_Error("illegal selector type: ~s", selector); + } if ((sel = (SEL)POINTER_T(selector)->pointer) == NULL) + { Primitive_Error("null pointer: ~s", selector); + } if (sel_isMapped(sel) == NO) + { Primitive_Error("selector not mapped: ~s", selector); + } } else + { Wrong_Type_Combination(receiver, "string, symbol or sel"); ! } ! } ! #ifdef NeXT_RUNTIME ! if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) ! #elif GNU_RUNTIME if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("can't access method for selector: ~s", selector); + } result = Objc_Send(obj, sel, meth, argc - 2, argv + 2); GC_Unlink; *************** *** 559,562 **** --- 621,625 ---- } + static SchemeObject P_Types(receiver, selector) SchemeObject receiver, selector; *************** *** 568,580 **** // Alloca_Begin; ! switch (TYPE(receiver)) { case T_Symbol: receiver = SYMBOL(receiver)->name; case T_String: name = Get_String(receiver); ! // if ((obj = objc_getClass(name)) == nil) if ((obj = objc_get_class(name)) == nil) Primitive_Error("class not found: ~s", receiver); break; default: if (TYPE(receiver) == T_Pointer) { --- 631,653 ---- // Alloca_Begin; ! switch (TYPE(receiver)) ! { case T_Symbol: receiver = SYMBOL(receiver)->name; + case T_String: name = Get_String(receiver); ! #ifdef NeXT_RUNTIME ! if ((obj = objc_getClass(name)) == nil) ! #elif GNU_RUNTIME if ((obj = objc_get_class(name)) == nil) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("class not found: ~s", receiver); + } break; + default: if (TYPE(receiver) == T_Pointer) { *************** *** 587,598 **** Wrong_Type_Combination(receiver, "string, symbol or pointer"); } ! switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); ! // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("selector not found: ~s", selector); // new: this avoids breakdown in class_get_instance_method --- 660,681 ---- Wrong_Type_Combination(receiver, "string, symbol or pointer"); } ! ! switch (TYPE(selector)) ! { case T_Symbol: selector = SYMBOL(selector)->name; + case T_String: name = Get_String(selector); ! #ifdef NeXT_RUNTIME ! if ((sel = sel_getUid(name)) == 0) ! #elif GNU_RUNTIME if ((sel = sel_get_uid(name)) == 0) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("selector not found: ~s", selector); + } // new: this avoids breakdown in class_get_instance_method *************** *** 603,616 **** break; default: Wrong_Type_Combination(selector, "string or symbol"); } ! // if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) Primitive_Error("can't access method for selector: ~s", selector); // Alloca_End; return Make_String(meth->method_types, strlen(meth->method_types)); } static SchemeObject P_Selector(selector) SchemeObject selector; --- 686,710 ---- break; + default: Wrong_Type_Combination(selector, "string or symbol"); } ! ! #ifdef NeXT_RUNTIME ! if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) ! #elif GNU_RUNTIME if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("can't access method for selector: ~s", selector); + } // Alloca_End; + return Make_String(meth->method_types, strlen(meth->method_types)); } + static SchemeObject P_Selector(selector) SchemeObject selector; *************** *** 621,643 **** // Alloca_Begin; ! switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); ! // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("selector not found: ~s", selector); break; default: Wrong_Type_Combination(selector, "string or symbol"); ! } // Alloca_End; if (sel_isMapped(sel) == NO) return False; ! else return A_Make_Pointer((int)sel, C_SEL); } void elk_init_tell() { --- 715,753 ---- // Alloca_Begin; ! switch (TYPE(selector)) ! { case T_Symbol: selector = SYMBOL(selector)->name; + case T_String: name = Get_String(selector); ! #ifdef NeXT_RUNTIME ! if ((sel = sel_getUid(name)) == 0) ! #elif GNU_RUNTIME if ((sel = sel_get_uid(name)) == 0) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("selector not found: ~s", selector); + } break; + default: Wrong_Type_Combination(selector, "string or symbol"); ! } // Alloca_End; + if (sel_isMapped(sel) == NO) + { return False; ! } ! else ! { return A_Make_Pointer((int)sel, C_SEL); + } } + void elk_init_tell() { Index: signals.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/signals.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** signals.m 5 Aug 2004 18:58:52 -0000 1.2 --- signals.m 5 Aug 2004 23:13:56 -0000 1.3 *************** *** 36,41 **** // #include <objc/objc-class.h> /* objc_class */ ! #include <objc/objc-api.h> /* objc_class */ ! #include <objc/Object.h> #define Object SchemeObject /* avoid Obj-C type clash */ --- 36,41 ---- // #include <objc/objc-class.h> /* objc_class */ ! // #include <objc/objc-api.h> /* objc_class */ ! // #include <objc/Object.h> #define Object SchemeObject /* avoid Obj-C type clash */ Index: module.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/module.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** module.m 5 Aug 2004 22:30:31 -0000 1.3 --- module.m 5 Aug 2004 23:13:56 -0000 1.4 *************** *** 35,41 **** #endif ! // #include <objc/objc-class.h> /* objc_class */ ! #include <objc/objc-api.h> /* objc_class */ ! #include <objc/Object.h> #define Object SchemeObject /* avoid Obj-C type clash */ --- 35,48 ---- #endif ! #ifdef NeXT_RUNTIME ! #include <objc/objc-class.h> /* for id, objc_class, etc */ ! #elif GNU_RUNTIME ! #include <objc/objc-api.h> /* for id, objc_class, etc */ ! #else ! #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** ! #endif ! ! #import <Foundation/NSString.h> ! // #include <objc/Object.h> #define Object SchemeObject /* avoid Obj-C type clash */ *************** *** 108,114 **** class = SYMBOL(class)->name; name = Get_String(class); ! // if ((objc_class = objc_getClass(name)) == nil) if ((objc_class = objc_get_class(name)) == nil) Primitive_Error("class not found: ~s", class); // Alloca_End; return A_Make_Module(objc_class); --- 115,128 ---- class = SYMBOL(class)->name; name = Get_String(class); ! #ifdef NeXT_RUNTIME ! if ((objc_class = objc_getClass(name)) == nil) ! #elif GNU_RUNTIME if ((objc_class = objc_get_class(name)) == nil) + #else + #error *** NEITHER NeXT NOR GNU RUNTIME PRESENT *** + #endif + { Primitive_Error("class not found: ~s", class); + } // Alloca_End; return A_Make_Module(objc_class); |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:38:05
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6206 Modified Files: context.m Log Message: integrated with MacOSX hack (serialization disabled) Index: context.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/context.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** context.m 5 Aug 2004 18:58:52 -0000 1.3 --- context.m 5 Aug 2004 22:37:56 -0000 1.4 *************** *** 52,55 **** --- 52,56 ---- SchemeObject V_Context; + static void Check_Context(o) SchemeObject o; *************** *** 60,63 **** --- 61,65 ---- } + SchemeObject Get_Context() { *************** *** 72,75 **** --- 74,78 ---- } + id getCurrentContext() /* used in ../kernel/Context.h */ { *************** *** 84,87 **** --- 87,91 ---- } + static SchemeObject P_Contextp(x) SchemeObject x; *************** *** 90,93 **** --- 94,98 ---- } + static SchemeObject P_Context_Lockedp(context) SchemeObject context; *************** *** 105,110 **** --- 110,117 ---- } + static int Debug_Context = 0; + static SchemeObject P_Debug_Context(flag) SchemeObject flag; *************** *** 119,122 **** --- 126,130 ---- } + static SchemeObject Kill_Context(context) SchemeObject context; *************** *** 126,134 **** fflush(stderr); } ! [CONTEXT_T(context)->pointer free]; CONTEXT_T(context)->pointer = NULL; return True; } static SchemeObject P_Kill_Context(context) SchemeObject context; --- 134,143 ---- fflush(stderr); } ! RELEASE(CONTEXT_T(context)->pointer); CONTEXT_T(context)->pointer = NULL; return True; } + static SchemeObject P_Kill_Context(context) SchemeObject context; *************** *** 140,143 **** --- 149,153 ---- } + static SchemeObject P_Kill_All_Contexts() { *************** *** 146,149 **** --- 156,160 ---- } + SchemeObject A_Make_Context(c) id c; *************** *** 163,166 **** --- 174,178 ---- } + static SchemeObject P_Make_Context(chans) SchemeObject chans; *************** *** 175,178 **** --- 187,191 ---- } + static SchemeObject P_Push_Time_Frame(context, number) SchemeObject context, number; *************** *** 192,195 **** --- 205,209 ---- } + static SchemeObject P_Pop_Time_Frame(context) SchemeObject context; *************** *** 209,212 **** --- 223,227 ---- } + static SchemeObject P_Context_Time(context) SchemeObject context; *************** *** 216,219 **** --- 231,235 ---- } + static SchemeObject P_Context_Time_Frames(context) SchemeObject context; *************** *** 223,226 **** --- 239,243 ---- } + static SchemeObject P_Context_Pointer(context) SchemeObject context; *************** *** 230,390 **** } ! int Write_Context(fp, context) ! FILE *fp; ! id context; ! { ! // NXStream *s; ! TypedStream *ts; ! // if ((s = NXOpenFile(fileno(fp), OBJC_WRITEONLY)) == NULL) ! // return -1; ! // if ((ts = objc_open_typed_stream(s, OBJC_WRITEONLY)) == NULL) { ! if ((ts = objc_open_typed_stream(fp, OBJC_WRITEONLY)) == NULL) { ! // NXClose(s); ! return -2; ! } ! objc_write_root_object(ts, context); ! objc_close_typed_stream(ts); ! // NXClose(s); ! return 1; ! } ! static SchemeObject P_Context_Write(argc, argv) ! int argc; ! SchemeObject *argv; ! { ! // NXStream *s; ! // TypedStream *ts; ! SchemeObject context = argv[0], port; ! if (argc < 2) ! port = Curr_Output_Port; ! else ! port = argv[1]; ! Check_Context(context); ! Check_Type(port, T_Port); ! if (!IS_OUTPUT(port)) ! Primitive_Error("not an output port: ~a", port); ! if (PORT(port)->flags & P_STRING) ! Primitive_Error("not a file port: ~a", port); ! switch (Write_Context(PORT(port)->file, CONTEXT_T(context)->pointer)) { ! case -1: ! Primitive_Error("cannot open stream for: ~a", port); ! case -2: ! // NXClose(s); ! Primitive_Error("cannot open typed stream for: ~a", port); ! } ! return True; ! } ! int Read_Context(fp, context) ! FILE *fp; ! id *context; ! { ! // NXStream *s; ! TypedStream *ts; ! // id c; ! // if ((s = NXOpenFile(fileno(fp), NX_READONLY)) == NULL) ! // return -1; ! // if ((ts = NXOpenTypedStream(s, NX_READONLY)) == NULL) { ! if ((ts = objc_open_typed_stream(fp, OBJC_READONLY)) == NULL) { ! // NXClose(s); ! return -2; ! } ! if (objc_read_object(ts, context) == -1) { ! objc_close_typed_stream(ts); ! // NXClose(s); ! return -3; ! } ! objc_close_typed_stream(ts); ! // NXClose(s); ! // *context = c; ! return 1; ! } ! static SchemeObject P_Context_Read(argc, argv) ! int argc; ! SchemeObject *argv; ! { ! SchemeObject port; ! // NXStream *s; ! // TypedStream *ts; ! id c; ! if (argc < 1) ! port = Curr_Input_Port; ! else ! port = argv[0]; ! Check_Type(port, T_Port); ! if (!IS_INPUT(port)) ! Primitive_Error("not an input port: ~a", port); ! if (PORT(port)->flags & P_STRING) ! Primitive_Error("not a file port: ~a", port); ! switch (Read_Context(PORT(port)->file, &c)) { ! case -1: ! Primitive_Error("cannot open stream for: ~a", port); ! case -2: ! Primitive_Error("cannot open typed stream for: ~a", port); ! case -3: ! Primitive_Error("cannot read from typed stream for: ~a", port); ! } ! return A_Make_Context(c); ! } ! static SchemeObject P_Context_Copy(context) ! SchemeObject context; ! { ! id c; ! // NXStream *ws, *rs; ! FILE *stream; ! TypedStream *ts; ! // char *buffer; ! // int len, maxlen; ! /* use tempfile instead of memory stream (workaround = ugly) */ ! Check_Context(context); ! // if ((ws = NXOpenMemory(NULL, 0, NX_WRITEONLY)) == NULL) ! // Primitive_Error("cannot open memory write stream"); ! // create tempfile ! if (! (stream = tmpfile())) ! { ! Primitive_Error("cannot create temporary file"); ! } ! // create typed stream ! if ((ts = objc_open_typed_stream(stream, OBJC_WRITEONLY)) == NULL) { ! // NXCloseMemory(ws, NX_FREEBUFFER); ! Primitive_Error("cannot open typed write stream"); ! } ! objc_write_root_object(ts, CONTEXT_T(context)->pointer); ! objc_close_typed_stream(ts); ! // NXGetMemoryBuffer(ws, &buffer, &len, &maxlen); ! // if ((rs = NXOpenMemory(buffer, len, NX_READONLY)) == NULL) ! // Primitive_Error("cannot open memory read stream"); ! rewind(stream); ! if ((ts = objc_open_typed_stream(stream, OBJC_READONLY)) == NULL) { ! // NXCloseMemory(ws, NX_FREEBUFFER); ! Primitive_Error("cannot open typed read stream"); ! } ! if (objc_read_object(ts, &c) == -1) ! Primitive_Error("bad context read"); ! objc_close_typed_stream(ts); ! // NXCloseMemory(ws, NX_FREEBUFFER); ! // NXCloseMemory(rs, NX_FREEBUFFER); ! fclose(stream); - return A_Make_Context(c); - } static SchemeObject P_Context_Interval(context) --- 247,413 ---- } ! // commented out so far ! // int Write_Context(fp, context) ! // FILE *fp; ! // id context; ! // { ! // // NXStream *s; ! // TypedStream *ts; ! // // if ((s = NXOpenFile(fileno(fp), OBJC_WRITEONLY)) == NULL) ! // // return -1; ! // // if ((ts = objc_open_typed_stream(s, OBJC_WRITEONLY)) == NULL) { ! // if ((ts = objc_open_typed_stream(fp, OBJC_WRITEONLY)) == NULL) { ! // // NXClose(s); ! // return -2; ! // } ! // objc_write_root_object(ts, context); ! // objc_close_typed_stream(ts); ! // // NXClose(s); ! // return 1; ! // } ! ! // static SchemeObject P_Context_Write(argc, argv) ! // int argc; ! // SchemeObject *argv; ! // { ! // // NXStream *s; ! // // TypedStream *ts; ! // SchemeObject context = argv[0], port; ! // if (argc < 2) ! // port = Curr_Output_Port; ! // else ! // port = argv[1]; ! // Check_Context(context); ! // Check_Type(port, T_Port); ! // if (!IS_OUTPUT(port)) ! // Primitive_Error("not an output port: ~a", port); ! // if (PORT(port)->flags & P_STRING) ! // Primitive_Error("not a file port: ~a", port); ! // switch (Write_Context(PORT(port)->file, CONTEXT_T(context)->pointer)) { ! // case -1: ! // Primitive_Error("cannot open stream for: ~a", port); ! // case -2: ! // // NXClose(s); ! // Primitive_Error("cannot open typed stream for: ~a", port); ! // } ! // return True; ! // } ! ! // int Read_Context(fp, context) ! // FILE *fp; ! // id *context; ! // { ! // // NXStream *s; ! // TypedStream *ts; ! // // id c; ! // // if ((s = NXOpenFile(fileno(fp), NX_READONLY)) == NULL) ! // // return -1; ! // // if ((ts = NXOpenTypedStream(s, NX_READONLY)) == NULL) { ! // if ((ts = objc_open_typed_stream(fp, OBJC_READONLY)) == NULL) { ! // // NXClose(s); ! // return -2; ! // } ! // if (objc_read_object(ts, context) == -1) { ! // objc_close_typed_stream(ts); ! // // NXClose(s); ! // return -3; ! // } ! // objc_close_typed_stream(ts); ! // // NXClose(s); ! // // *context = c; ! // return 1; ! // } ! ! // static SchemeObject P_Context_Read(argc, argv) ! // int argc; ! // SchemeObject *argv; ! // { ! // SchemeObject port; ! // // NXStream *s; ! // // TypedStream *ts; ! // id c; ! // if (argc < 1) ! // port = Curr_Input_Port; ! // else ! // port = argv[0]; ! // Check_Type(port, T_Port); ! // if (!IS_INPUT(port)) ! // Primitive_Error("not an input port: ~a", port); ! // if (PORT(port)->flags & P_STRING) ! // Primitive_Error("not a file port: ~a", port); ! // switch (Read_Context(PORT(port)->file, &c)) { ! // case -1: ! // Primitive_Error("cannot open stream for: ~a", port); ! // case -2: ! // Primitive_Error("cannot open typed stream for: ~a", port); ! // case -3: ! // Primitive_Error("cannot read from typed stream for: ~a", port); ! // } ! // return A_Make_Context(c); ! // } ! ! // static SchemeObject P_Context_Copy(context) ! // SchemeObject context; ! // { ! // id c; ! // // NXStream *ws, *rs; ! // FILE *stream; ! // TypedStream *ts; ! // // char *buffer; ! // // int len, maxlen; ! // /* use tempfile instead of memory stream (workaround = ugly) */ ! // Check_Context(context); ! // // if ((ws = NXOpenMemory(NULL, 0, NX_WRITEONLY)) == NULL) ! // // Primitive_Error("cannot open memory write stream"); ! // // create tempfile ! // if (! (stream = tmpfile())) ! // { ! // Primitive_Error("cannot create temporary file"); ! // } ! // // create typed stream ! // if ((ts = objc_open_typed_stream(stream, OBJC_WRITEONLY)) == NULL) { ! // // NXCloseMemory(ws, NX_FREEBUFFER); ! // Primitive_Error("cannot open typed write stream"); ! // } ! // objc_write_root_object(ts, CONTEXT_T(context)->pointer); ! // objc_close_typed_stream(ts); ! // // NXGetMemoryBuffer(ws, &buffer, &len, &maxlen); ! // // if ((rs = NXOpenMemory(buffer, len, NX_READONLY)) == NULL) ! // // Primitive_Error("cannot open memory read stream"); ! // rewind(stream); ! // if ((ts = objc_open_typed_stream(stream, OBJC_READONLY)) == NULL) { ! // // NXCloseMemory(ws, NX_FREEBUFFER); ! // Primitive_Error("cannot open typed read stream"); ! // } ! // if (objc_read_object(ts, &c) == -1) ! // Primitive_Error("bad context read"); ! // objc_close_typed_stream(ts); ! // // NXCloseMemory(ws, NX_FREEBUFFER); ! // // NXCloseMemory(rs, NX_FREEBUFFER); ! // fclose(stream); ! ! // return A_Make_Context(c); ! // } static SchemeObject P_Context_Interval(context) *************** *** 408,411 **** --- 431,435 ---- } + static int Context_Equal(a, b) SchemeObject a, b; *************** *** 414,417 **** --- 438,442 ---- } + static int Context_Print(x, port, raw, depth, length) SchemeObject x, port; *************** *** 426,429 **** --- 451,455 ---- } + static int Context_Visit(x, f) SchemeObject *x; *************** *** 438,441 **** --- 464,468 ---- } + #define DP Define_Primitive *************** *** 457,463 **** DP(P_Pop_Time_Frame, "foo:context-pop-time-frame", 1, 1, EVAL); DP(P_Context_Time, "foo:context-time", 1, 1, EVAL); ! DP(P_Context_Write, "foo:write-context", 1, 2, VARARGS); ! DP(P_Context_Read, "foo:read-context", 0, 1, VARARGS); ! DP(P_Context_Copy, "foo:copy-context", 1, 1, EVAL); DP(P_Context_Interval, "foo:context-interval", 1, 1, EVAL); --- 484,491 ---- DP(P_Pop_Time_Frame, "foo:context-pop-time-frame", 1, 1, EVAL); DP(P_Context_Time, "foo:context-time", 1, 1, EVAL); ! // serialization stuff commented out so far ! // DP(P_Context_Write, "foo:write-context", 1, 2, VARARGS); ! // DP(P_Context_Read, "foo:read-context", 0, 1, VARARGS); ! // DP(P_Context_Copy, "foo:copy-context", 1, 1, EVAL); DP(P_Context_Interval, "foo:context-interval", 1, 1, EVAL); |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:30:46
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5167 Modified Files: bpf.m module.m soundfile.m Log Message: [class description] -> [[class description] cString] (char * instead of NSString *) [snd dealloc] -> RELEASE(snd) (never call dealloc directly, since that violates the reference counting mechanism. instead use [snd release] or the GC-safe RELEASE() macro) Index: soundfile.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/soundfile.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** soundfile.m 5 Aug 2004 18:58:52 -0000 1.2 --- soundfile.m 5 Aug 2004 22:30:31 -0000 1.3 *************** *** 332,337 **** Primitive_Error("internal inconsistency"); } ! // [snd free]; ! [snd dealloc]; // Alloca_End; --- 332,336 ---- Primitive_Error("internal inconsistency"); } ! RELEASE(snd); // Alloca_End; Index: bpf.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/bpf.m,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bpf.m 5 Aug 2004 18:58:52 -0000 1.3 --- bpf.m 5 Aug 2004 22:30:31 -0000 1.4 *************** *** 68,72 **** BPF_T(bpf)->type = Null; BPF_T(bpf)->context = Get_Context(); ! BPF_T(bpf)->type = Intern((char*)[[object class] name]); GC_Unlink; return bpf; --- 68,72 ---- BPF_T(bpf)->type = Null; BPF_T(bpf)->context = Get_Context(); ! BPF_T(bpf)->type = Intern([[[object class] description] cString]); GC_Unlink; return bpf; Index: module.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/module.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** module.m 5 Aug 2004 18:58:52 -0000 1.2 --- module.m 5 Aug 2004 22:30:31 -0000 1.3 *************** *** 91,95 **** MODULE_T(module)->type = Null; MODULE_T(module)->context = Get_Context(); ! MODULE_T(module)->type = Intern((char*)[class name]); GC_Unlink; return module; --- 91,95 ---- MODULE_T(module)->type = Null; MODULE_T(module)->context = Get_Context(); ! MODULE_T(module)->type = Intern([[class description] cString]); GC_Unlink; return module; |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:21:30
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3585 Modified Files: configure.ac Log Message: check for gettimeofday() rather than ftime() Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** configure.ac 5 Aug 2004 22:11:46 -0000 1.4 --- configure.ac 5 Aug 2004 22:21:21 -0000 1.5 *************** *** 49,53 **** AC_TYPE_SIGNAL AC_FUNC_STAT ! AC_CHECK_FUNCS([bzero ftime getcwd memset mkdir pow rint rmdir sqrt strdup sigaction]) # check for foundation library to use --- 49,53 ---- AC_TYPE_SIGNAL AC_FUNC_STAT ! AC_CHECK_FUNCS([bzero gettimeofday getcwd memset mkdir pow rint rmdir sqrt strdup sigaction]) # check for foundation library to use |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:21:06
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3455 Modified Files: misc.c Log Message: integrated MacOSX hack: ftime() -> gettimeofday() Index: misc.c =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/misc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** misc.c 5 Aug 2004 08:55:09 -0000 1.2 --- misc.c 5 Aug 2004 22:20:57 -0000 1.3 *************** *** 76,88 **** } static Object P_Time() { ! struct timeb t; ! extern int ftime(); ! ! ftime(&t); ! return Make_Reduced_Flonum((double)t.time + t.millitm / 1000.); } static Object P_Getpid() { --- 76,90 ---- } + static Object P_Time() { ! struct timeval t; ! struct timezone tz; ! ! gettimeofday(&t, &tz); ! return Make_Reduced_Flonum((double)t.tv_sec + t.tv_usec / 1000000.); } + static Object P_Getpid() { *************** *** 90,93 **** --- 92,96 ---- } + static Object P_System (cmd) Object cmd; { register char *s; *************** *** 126,129 **** --- 129,133 ---- } + static Object P_Getenv (e) Object e; { register char *s; *************** *** 136,139 **** --- 140,144 ---- } + static Object P_Getwd () { char buffer[PATH_MAX + 1]; *************** *** 144,147 **** --- 149,153 ---- } + static Object P_Num_Sprintf (form, num) Object form; Object num; { char buffer[1024]; *************** *** 168,178 **** } void elk_init_misc() { ! Define_Primitive(P_Time, "time", 0, 0, EVAL); ! Define_Primitive(P_Getpid, "getpid", 0, 0, EVAL); ! Define_Primitive(P_System, "system", 1, 1, EVAL); ! Define_Primitive(P_Getenv, "getenv", 1, 1, EVAL); ! Define_Primitive(P_Getwd, "getwd", 0, 0, EVAL); ! Define_Primitive(P_Num_Sprintf, "foo:num-sprintf", 2, 2, EVAL); } --- 174,186 ---- } + void elk_init_misc() { ! /* "seconds" was formerly known as "time" */ ! Define_Primitive(P_Time, "seconds", 0, 0, EVAL); ! Define_Primitive(P_Getpid, "getpid", 0, 0, EVAL); ! Define_Primitive(P_System, "system", 1, 1, EVAL); ! Define_Primitive(P_Getenv, "getenv", 1, 1, EVAL); ! Define_Primitive(P_Getwd, "getwd", 0, 0, EVAL); ! Define_Primitive(P_Num_Sprintf, "foo:num-sprintf", 2, 2, EVAL); } |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:11:56
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1599 Modified Files: configure.ac Log Message: prepared for recursive build out of toplevel dir Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.ac 5 Aug 2004 19:00:04 -0000 1.3 --- configure.ac 5 Aug 2004 22:11:46 -0000 1.4 *************** *** 233,237 **** dnl fi else ! ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" fi --- 233,238 ---- dnl fi else ! INCLUDES="-I\$(top_srcdir)/../libfoo -I\$(top_builddir)/../libfoo ${INCLUDES}" ! ELKFOO_LIBS="${ELKFOO_LIBS} \$(top_builddir)/../libfoo/src/libfoo.la" fi |
|
From: Martin R. <ru...@us...> - 2004-08-05 22:11:56
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1599/src Modified Files: Makefile.am Log Message: prepared for recursive build out of toplevel dir Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 5 Aug 2004 18:58:51 -0000 1.3 --- Makefile.am 5 Aug 2004 22:11:47 -0000 1.4 *************** *** 51,55 **** -module -avoid-version -no-undefined elkfoo_la_LIBADD = $(ELKFOO_LIBS) $(FND_LIBS) \ - ../../libfoo/src/libfoo.la \ -lobjc --- 51,54 ---- |
|
From: Martin R. <ru...@us...> - 2004-08-05 21:18:12
|
Update of /cvsroot/foo/foo/libfoo/tests/foosine In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25019 Modified Files: Makefile.am Log Message: disabled installation of test program Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/libfoo/tests/foosine/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 2 Aug 2004 00:56:57 -0000 1.4 --- Makefile.am 5 Aug 2004 21:18:03 -0000 1.5 *************** *** 6,10 **** NULL = ! bin_PROGRAMS = foosine foosine_SOURCES = \ --- 6,10 ---- NULL = ! noinst_PROGRAMS = foosine foosine_SOURCES = \ *************** *** 27,31 **** $(FND_DEFINE) \ -I../../modules ! foosine_LDFLAGS = $(FOO_LDFLAGS) foosine_LDADD = $(FOO_LIBS) $(FND_LIBS) \ ../../src/libfoo.la --- 27,32 ---- $(FND_DEFINE) \ -I../../modules ! foosine_LDFLAGS = $(FOO_LDFLAGS) \ ! -no-install foosine_LDADD = $(FOO_LIBS) $(FND_LIBS) \ ../../src/libfoo.la |
|
From: Martin R. <ru...@us...> - 2004-08-05 21:14:12
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24483 Modified Files: FOOContext.m Log Message: fixed minor warning Index: FOOContext.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOContext.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FOOContext.m 4 Aug 2004 06:16:41 -0000 1.2 --- FOOContext.m 5 Aug 2004 21:14:03 -0000 1.3 *************** *** 165,169 **** - (FOOBuffer *) nextSharedBuffer { ! FOOBuffer *buffer = [_sharedBufferManager objectAtIndex: ++_numberOfSharedBuffers]; return [buffer setShared: YES]; --- 165,169 ---- - (FOOBuffer *) nextSharedBuffer { ! FOOBuffer *buffer = (FOOBuffer *)[_sharedBufferManager objectAtIndex: ++_numberOfSharedBuffers]; return [buffer setShared: YES]; |
|
From: Martin R. <ru...@us...> - 2004-08-05 19:00:13
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32579 Modified Files: configure.ac Log Message: detect elk installation dirs, added header install dir detection Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** configure.ac 5 Aug 2004 08:56:12 -0000 1.2 --- configure.ac 5 Aug 2004 19:00:04 -0000 1.3 *************** *** 149,153 **** # get elk's/fooelk's libdir ! AC_MSG_CHECKING([for elk installation dirs]) AC_TRY_RUN([ #include <stdio.h> --- 149,153 ---- # get elk's/fooelk's libdir ! AC_MSG_CHECKING([for ${ELK_LIBRARY} installation dirs]) AC_TRY_RUN([ #include <stdio.h> *************** *** 184,194 **** } ], ! [AC_MSG_RESULT([done]) ! ELK_LIB_DIR=`head -n1 conftest.data` ! ELK_SCM_DIR=`tail -n1 conftest.data` ! AC_MSG_NOTICE([using elk libdir ${ELK_LIB_DIR}]) ! AC_MSG_NOTICE([using elk scmdir ${ELK_SCM_DIR}])], [AC_MSG_RESULT([failed]) ! AC_MSG_ERROR([couldn't determine elk library installation dirs])]) # check for libfoo --- 184,206 ---- } ], ! [AC_MSG_RESULT([done]) ! ! ELK_LIB_DIR=`head -n1 conftest.data` ! ELK_SCM_DIR=`tail -n1 conftest.data` ! # quick'n'dirty'n'hacky: guess elk include dir ! ELK_INC_DIR=`echo ${ELK_LIB_DIR} | sed -e 's/\/lib\//\/include\//g'` ! # verify that ! AC_CHECK_FILE([${ELK_INC_DIR}/scheme.h], ! [guessed_elk_incdir_hit=yes], ! [guessed_elk_incdir_hit=no]) ! if test ${guessed_elk_incdir_hit} = no; then ! AC_MSG_WARN([couldn't determine ${ELK_LIBRARY} include dir]) ! ELK_INC_DIR=${includedir}/${PACKAGE} ! fi ! AC_MSG_NOTICE([using elk incdir ${ELK_INC_DIR}]) ! AC_MSG_NOTICE([using elk libdir ${ELK_LIB_DIR}]) ! AC_MSG_NOTICE([using elk scmdir ${ELK_SCM_DIR}])], [AC_MSG_RESULT([failed]) ! AC_MSG_ERROR([couldn't determine ${ELK_LIBRARY} installation dirs])]) # check for libfoo *************** *** 239,242 **** --- 251,256 ---- AC_SUBST(FOO_GNUSTEP_OBJCFLAGS) AC_SUBST(FOO_GNUSTEP_LDFLAGS) + AC_SUBST(ELK_LIBRARY) + AC_SUBST(ELK_INC_DIR) AC_SUBST(ELK_LIB_DIR) AC_SUBST(ELK_SCM_DIR) |
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32270 Modified Files: Makefile.am bpf.m context.m fooinit.m module.m modules.m pointer.m signals.m snd.m soundfile.m task.m tell.m Log Message: adopted src files to new catchall-header Index: tell.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/tell.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tell.m 4 Aug 2004 07:15:58 -0000 1.1 --- tell.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 57,62 **** #undef Object ! #include "pointer.h" ! #include "tell.h" #define SKIP_BODY(p, c) while (*p != c) if (!*p) goto format_error; else p++; --- 57,61 ---- #undef Object ! #include "elkfoo.h" #define SKIP_BODY(p, c) while (*p != c) if (!*p) goto format_error; else p++; Index: signals.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/signals.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** signals.m 4 Aug 2004 07:15:58 -0000 1.1 --- signals.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 47,52 **** #undef Object ! #include "signals.h" ! #include "module.h" int T_Signal; --- 47,51 ---- #undef Object ! #include "elkfoo.h" int T_Signal; Index: module.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/module.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** module.m 4 Aug 2004 07:15:58 -0000 1.1 --- module.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 47,53 **** #undef Object ! #include "pointer.h" ! #include "context.h" ! #include "module.h" int T_Module; --- 47,51 ---- #undef Object ! #include "elkfoo.h" int T_Module; Index: modules.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/modules.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** modules.m 4 Aug 2004 07:15:58 -0000 1.1 --- modules.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 82,90 **** #include <sys/timeb.h> ! #include "module.h" ! #include "snd.h" ! #include "bpf.h" ! #include "signals.h" ! #include "context.h" #define IdOf(module) (MODULE_T(module)->pointer) --- 82,86 ---- #include <sys/timeb.h> ! #include "elkfoo.h" #define IdOf(module) (MODULE_T(module)->pointer) Index: soundfile.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/soundfile.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** soundfile.m 4 Aug 2004 07:15:58 -0000 1.1 --- soundfile.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 54,60 **** #undef Object ! #include "context.h" ! #include "pointer.h" ! #include "snd.h" SchemeObject General_File_Operation (SchemeObject s, int op); --- 54,58 ---- #undef Object ! #include "elkfoo.h" SchemeObject General_File_Operation (SchemeObject s, int op); Index: bpf.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/bpf.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** bpf.m 5 Aug 2004 08:55:09 -0000 1.2 --- bpf.m 5 Aug 2004 18:58:52 -0000 1.3 *************** *** 45,51 **** #undef Object ! #include "context.h" ! #include "pointer.h" ! #include "bpf.h" int T_Bpf; --- 45,49 ---- #undef Object ! #include "elkfoo.h" int T_Bpf; Index: snd.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/snd.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** snd.m 4 Aug 2004 07:15:58 -0000 1.1 --- snd.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 53,59 **** #undef Object ! #include "context.h" ! #include "pointer.h" ! #include "snd.h" int T_Snd; --- 53,57 ---- #undef Object ! #include "elkfoo.h" int T_Snd; Index: context.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/context.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** context.m 5 Aug 2004 08:55:09 -0000 1.2 --- context.m 5 Aug 2004 18:58:52 -0000 1.3 *************** *** 46,51 **** #undef Object ! #include "context.h" ! #include "pointer.h" int T_Context; --- 46,50 ---- #undef Object ! #include "elkfoo.h" int T_Context; Index: fooinit.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/fooinit.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** fooinit.m 5 Aug 2004 08:55:09 -0000 1.2 --- fooinit.m 5 Aug 2004 18:58:52 -0000 1.3 *************** *** 119,123 **** Define_Primitive(P_Version, "foo:version", 0, 0, EVAL); ! P_Provide(Intern("libfoo.la")); } /* elk_init_foo_fooinit */ --- 119,123 ---- Define_Primitive(P_Version, "foo:version", 0, 0, EVAL); ! P_Provide(Intern("elkfoo.la")); } /* elk_init_foo_fooinit */ Index: pointer.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/pointer.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pointer.m 4 Aug 2004 07:15:58 -0000 1.1 --- pointer.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 47,51 **** #undef Object ! #include "pointer.h" int T_Pointer; --- 47,51 ---- #undef Object ! #include "elkfoo.h" int T_Pointer; Index: task.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/task.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** task.m 4 Aug 2004 07:15:58 -0000 1.1 --- task.m 5 Aug 2004 18:58:52 -0000 1.2 *************** *** 52,59 **** #undef Object ! #include "context.h" ! #include "pointer.h" ! #include "snd.h" ! #include "task.h" SchemeObject General_File_Operation (SchemeObject s, int op); /* in io.c */ --- 52,56 ---- #undef Object ! #include "elkfoo.h" SchemeObject General_File_Operation (SchemeObject s, int op); /* in io.c */ Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/Makefile.am,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile.am 5 Aug 2004 08:55:09 -0000 1.2 --- Makefile.am 5 Aug 2004 18:58:51 -0000 1.3 *************** *** 9,12 **** --- 9,14 ---- pkglib_LTLIBRARIES = elkfoo.la + pkglibdir = @ELK_LIB_DIR@ + #elkfoo_SOURCES = \ # main.c \ *************** *** 52,55 **** --- 54,58 ---- -lobjc + extensionsdir = $(pkgincludedir)/extensions #elkfoo_CFLAGS = $(ELKFOO_CFLAGS) @FOO_GNUSTEP_OBJCFLAGS@ |
|
From: Martin R. <ru...@us...> - 2004-08-05 18:57:50
|
Update of /cvsroot/foo/foo/elkfoo/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31995 Modified Files: Makefile.am Added Files: elkfoo.h Removed Files: bpf.h context.h module.h pointer.h signals.h snd.h task.h tell.h Log Message: bundled all definitions into one elk extension export header --- signals.h DELETED --- --- tell.h DELETED --- --- module.h DELETED --- Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/include/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 4 Aug 2004 07:15:13 -0000 1.1 --- Makefile.am 5 Aug 2004 18:57:41 -0000 1.2 *************** *** 6,23 **** NULL = extensionsdir = $(pkgincludedir)/extensions # we should have a complete elkfoo.h here extensions_HEADERS = \ $(NULL) ! noinst_HEADERS = \ ! bpf.h \ ! context.h \ ! module.h \ ! pointer.h \ ! signals.h \ ! snd.h \ ! task.h \ ! tell.h \ ! $(NULL) --- 6,25 ---- NULL = + pkgincludedir = @ELK_INC_DIR@ extensionsdir = $(pkgincludedir)/extensions # we should have a complete elkfoo.h here extensions_HEADERS = \ + elkfoo.h $(NULL) ! # noinst_HEADERS = \ ! # bpf.h \ ! # context.h \ ! # module.h \ ! # pointer.h \ ! # signals.h \ ! # snd.h \ ! # task.h \ ! # tell.h \ ! # $(NULL) --- context.h DELETED --- --- NEW FILE: elkfoo.h --- /* * elkfoo.h * * elkfoo extension header * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* $Id: elkfoo.h,v 1.1 2004/08/05 18:57:41 rumori Exp $ */ #ifndef FOO_ELKFOO_H_INCLUDED #define FOO_ELKFOO_H_INCLUDED /* * bpf */ struct S_Bpf { SchemeObject context; SchemeObject type; double offset; double length; id pointer; char reversed; }; #define BPF_T(x) ((struct S_Bpf *)POINTER(x)) extern int T_Bpf; /* * context */ struct S_Context { SchemeObject times; int channels; id pointer; }; #define CONTEXT_T(x) ((struct S_Context *)POINTER(x)) extern int T_Context; extern SchemeObject V_Context; extern int Write_Context(); extern int Read_Context(); SchemeObject Get_Context(void); /* * module */ struct S_Module { SchemeObject context; SchemeObject type; id pointer; }; #define MODULE_T(x) ((struct S_Module *)POINTER(x)) extern int T_Module; SchemeObject A_Make_Module(id class); /* * pointer */ struct S_Pointer { SchemeObject type; void *pointer; }; #define POINTER_T(x) ((struct S_Pointer *)POINTER(x)) extern int T_Pointer; extern SchemeObject A_Make_Pointer(); extern SchemeObject Null_Pointer; #define C_base 0 #define C_char (C_base + 1) #define C_short (C_base + 2) #define C_int (C_base + 3) #define C_long (C_base + 4) #define C_unsigned_char (C_base + 5) #define C_unsigned_short (C_base + 6) #define C_unsigned_int (C_base + 7) #define C_unsigned_long (C_base + 8) #define C_float (C_base + 9) #define C_double (C_base + 10) #define C_pointers (C_double + 1) #define C_VOID (C_pointers + 0) #define C_CHAR (C_pointers + 1) #define C_SHORT (C_pointers + 2) #define C_INT (C_pointers + 3) #define C_LONG (C_pointers + 4) #define C_UNSIGNED_CHAR (C_pointers + 5) #define C_UNSIGNED_SHORT (C_pointers + 6) #define C_UNSIGNED_INT (C_pointers + 7) #define C_UNSIGNED_LONG (C_pointers + 8) #define C_FLOAT (C_pointers + 9) #define C_DOUBLE (C_pointers + 10) #define C_ID (C_pointers + 11) #define C_CLASS (C_pointers + 12) #define C_SEL (C_pointers + 13) #define C_STRUCT (C_pointers + 14) #define C_UNION (C_pointers + 15) #define C_ARRAY (C_pointers + 16) #define C_undef (C_pointers + 17) #define C_CHARPTR (C_pointers + 18) #define C_UNDEF (C_pointers + 19) #define C_last C_UNDEF /* * signal */ struct S_Signal { SchemeObject vector; double value; char constant; char terminal; }; #define SIGNAL_T(x) ((struct S_Signal *)POINTER(x)) extern int T_Signal; #define FLONUM_FORMAT "%.15g" SchemeObject A_Make_Terminal_Signal(SchemeObject m, int c, double v); SchemeObject A_Make_Signal_Terminal(SchemeObject signal); SchemeObject Signal_Constantp(SchemeObject signal); /* * snd */ struct S_Snd { SchemeObject context; SchemeObject type; SchemeObject name; SchemeObject format; SchemeObject filetype; int channels; int channel; double samplerate; double offset; double length; id pointer; char reversed; }; #define SND_T(x) ((struct S_Snd *)POINTER(x)) extern int T_Snd; #define SND_MIX_FILE_NAME "mixfloat.imx" #define SND_MIX_LOCK_NAME "mixlock" struct symbol { char *name; int val; }; enum { SND_CHAR, SND_SHORT, SND_LONG, SND_FLOAT, SND_DOUBLE, SND_INCREMENTAL }; enum { SND_FILETYPE_WAV, SND_FILETYPE_AIFF, SND_FILETYPE_SND, SND_FILETYPE_PAF, SND_FILETYPE_SVX, SND_FILETYPE_NIST, SND_FILETYPE_VOC, SND_FILETYPE_IRCAM, SND_FILETYPE_WAV64, SND_FILETYPE_MAT4, SND_FILETYPE_MAT5, SND_FILETYPE_PVF, SND_FILETYPE_XI }; extern struct symbol sndTypes[]; extern struct symbol sndFileTypes[]; /* * task */ struct S_Task { SchemeObject context; SchemeObject output; int reference; int offset; int position; double samplingrate; int buffersize; char incremental; char type; }; #define TASK_T(x) ((struct S_Task *)POINTER(x)) extern int T_Task; #define DEFAULT_SAMPLING_RATE 44100 #define DEFAULT_BLOCK_SIZE 1024 /* * tell */ #define MAXFRAMESIZE 1024 typedef union _objc_return { /* 4 bytes on stack */ char c; short s; int i; long l; float f; void *V; char *C; short *S; int *I; long *L; float *F; double *D; /* 8 bytes on stack */ double d; char chars[8]; short shorts[4]; int ints[2]; } objc_return; #endif /* #ifndef FOO_ELKFOO_H_INCLUDED */ --- snd.h DELETED --- --- bpf.h DELETED --- --- pointer.h DELETED --- --- task.h DELETED --- |
|
From: Martin R. <ru...@us...> - 2004-08-05 08:56:21
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15440 Modified Files: configure.ac Log Message: added macro for elk/fooelk extensions dir detection (not yet working) Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/configure.ac,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** configure.ac 4 Aug 2004 07:13:08 -0000 1.1 --- configure.ac 5 Aug 2004 08:56:12 -0000 1.2 *************** *** 113,142 **** # check for libelk ! AC_ARG_WITH(elk_library, ! AC_HELP_STRING([--with-elk-library=DIR], [elk scheme library file DIR]), ! , ! with_elk_library=) ! AC_ARG_WITH(elk_include, ! AC_HELP_STRING([--with-elk-include=DIR], [elk scheme include files DIR]), ! , ! with_elk_include=) ! ! if test -n "${with_elk_library}"; then ! with_elk_library="-L${with_elk_library}" ! fi ! if test -n "${with_elk_include}"; then ! with_elk_include="-I${with_elk_include}" ! fi ! ! CPPFLAGS="${CPPFLAGS} ${with_elk_include}" ! LDFLAGS="${LDFLAGS} ${with_elk_library}" ! ! AC_CHECK_HEADERS(fooelk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([fooelk], [Elk_Init]) if test "${ac_cv_lib_fooelk_Elk_Init}" = yes; then ! INCLUDES="${INCLUDES} ${with_elk_include}" ! ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lfooelk" ELK_LIBRARY="fooelk" else --- 113,122 ---- # check for libelk ! AC_CHECK_HEADERS([fooelk/scheme.h], [have_elk=yes], [have_elk=no]) if test "${have_elk}" = yes; then AC_CHECK_LIB([fooelk], [Elk_Init]) if test "${ac_cv_lib_fooelk_Elk_Init}" = yes; then ! ELKFOO_LIBS="${ELKFOO_LIBS} -lfooelk" ELK_LIBRARY="fooelk" else *************** *** 146,156 **** if test "${have_elk}" = no; then ! AC_CHECK_HEADERS(elk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([elk], [Elk_Init]) if test "${ac_cv_lib_elk_Elk_Init}" = yes; then ! INCLUDES="${INCLUDES} ${with_elk_include}" ! ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lelk" ELK_LIBRARY="elk" else --- 126,135 ---- if test "${have_elk}" = no; then ! AC_CHECK_HEADERS([elk/scheme.h], [have_elk=yes], [have_elk=no]) if test "${have_elk}" = yes; then AC_CHECK_LIB([elk], [Elk_Init]) if test "${ac_cv_lib_elk_Elk_Init}" = yes; then ! ELKFOO_LIBS="${ELKFOO_LIBS} -lelk" ELK_LIBRARY="elk" else *************** *** 161,172 **** if test "${have_elk}" = no; then ! AC_MSG_WARN(Cannot find elk scheme header and/or library) echo "* elkfoo requires the elk scheme interpreter" ! echo "* Use --with-elk-library to specify the elk library" ! echo "* Use --with-elk-include to specify the elk header" ! echo "* directories if they are not in the usual place(s)" AC_MSG_ERROR([elkfoo will not compile without elk]) fi # include dir INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" --- 140,227 ---- if test "${have_elk}" = no; then ! AC_MSG_WARN([Cannot find elk scheme header and/or library]) echo "* elkfoo requires the elk scheme interpreter" ! echo "* try setting CPPFLAGS/LDFLAGS pointing to the" ! echo "* location of the elk headers/library" ! echo "* if they are not in the usual place(s)" AC_MSG_ERROR([elkfoo will not compile without elk]) fi + # get elk's/fooelk's libdir + AC_MSG_CHECKING([for elk installation dirs]) + AC_TRY_RUN([ + #include <stdio.h> + #include <${ELK_LIBRARY}/scheme.h> + + extern char *Lib_Dir; + extern char *Scm_Dir; + + int + main (int argc, + char **argv) + { + FILE *file; + + Elk_Init(argc, argv, 0, 0); + + if (Lib_Dir == NULL || Scm_Dir == NULL) + { + exit(1); + } + + if (! (file = fopen("conftest.data", "w"))) + { + exit(1); + } + + fputs(Lib_Dir, file); + fputs("\n", file); + fputs(Scm_Dir, file); + fputs("\n", file); + fclose(file); + + exit(0); + } + ], + [AC_MSG_RESULT([done]) + ELK_LIB_DIR=`head -n1 conftest.data` + ELK_SCM_DIR=`tail -n1 conftest.data` + AC_MSG_NOTICE([using elk libdir ${ELK_LIB_DIR}]) + AC_MSG_NOTICE([using elk scmdir ${ELK_SCM_DIR}])], + [AC_MSG_RESULT([failed]) + AC_MSG_ERROR([couldn't determine elk library installation dirs])]) + + # check for libfoo + # we can't meaningfully check for -lfoo unless it depends + # on getCurrentContext(), which will get compiled in this library :-( + # CHECK DEFFERED + if test -z "${RECURSIVE_BUILD}"; then + AC_MSG_WARN([ommitting check for libfoo]) + ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + + dnl AC_LANG_PUSH(Objective C) + dnl AC_CHECK_HEADERS([FOO/FOOObject.h], [have_libfoo=yes], [have_libfoo=no]) + + dnl if test "${have_libfoo}" = yes; then + dnl AC_CHECK_LIB([foo], [main]) + dnl if test "${ac_cv_lib_foo_main}" = yes; then + dnl ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + dnl else + dnl have_libfoo=no + dnl fi + dnl AC_LANG_POP(Objective C) + + dnl if test "${have_libfoo}" = no; then + dnl AC_MSG_WARN([Cannot find libfoo headers and/or library]) + dnl echo "* elkfoo requires libfoo" + dnl echo "* try setting CPPFLAGS/LDFLAGS pointing to the" + dnl echo "* location of the libfoo headers/library" + dnl echo "* if they are not in the usual place(s)" + dnl AC_MSG_ERROR([elkfoo will not compile without libfoo]) + dnl fi + else + ELKFOO_LIBS="${ELKFOO_LIBS} -lfoo" + fi + # include dir INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" *************** *** 184,188 **** --- 239,246 ---- AC_SUBST(FOO_GNUSTEP_OBJCFLAGS) AC_SUBST(FOO_GNUSTEP_LDFLAGS) + AC_SUBST(ELK_LIB_DIR) + AC_SUBST(ELK_SCM_DIR) + # output files AC_OUTPUT([ Makefile |
|
From: Martin R. <ru...@us...> - 2004-08-05 08:55:18
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15202 Modified Files: Makefile.am bpf.m context.m fooinit.m fractone.c misc.c Log Message: build system related fixes Index: fractone.c =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/fractone.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fractone.c 4 Aug 2004 07:15:58 -0000 1.1 --- fractone.c 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 33,46 **** /* $Id */ ! /* #include "config.h" */ #include <stdio.h> #include <math.h> ! /* #ifdef HAVE_FOOELK_SCHEME_H */ #include <fooelk/scheme.h> ! /* #else */ ! /* #include <elk/scheme.h> */ ! /* #endif */ #define SEMI_TONE_CHARACTER 's' --- 33,48 ---- /* $Id */ ! #ifdef HAVE_CONFIG_H ! #include "config.h" ! #endif #include <stdio.h> #include <math.h> ! #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! #else ! #include <elk/scheme.h> ! #endif #define SEMI_TONE_CHARACTER 's' Index: context.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/context.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** context.m 4 Aug 2004 07:15:58 -0000 1.1 --- context.m 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 31,35 **** */ ! #ifdef HAVE_CONTEXT_H #include "config.h" #endif --- 31,35 ---- */ ! #ifdef HAVE_CONFIG_H #include "config.h" #endif *************** *** 39,47 **** #define Object SchemeObject /* avoid Obj-C type clash */ ! // #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! // #else ! // #include <elk/scheme.h> ! // #endif #undef Object --- 39,47 ---- #define Object SchemeObject /* avoid Obj-C type clash */ ! #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! #else ! #include <elk/scheme.h> ! #endif #undef Object Index: misc.c =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/misc.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** misc.c 4 Aug 2004 07:15:58 -0000 1.1 --- misc.c 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 31,41 **** */ ! /* #include "config.h" */ ! /* #ifdef HAVE_FOOELK_SCHEME_H */ #include <fooelk/scheme.h> ! /* #else */ ! /* #include <elk/scheme.h> */ ! /* #endif */ #include <unistd.h> --- 31,43 ---- */ ! #ifdef HAVE_CONFIG_H ! #include "config.h" ! #endif ! #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! #else ! #include <elk/scheme.h> ! #endif #include <unistd.h> Index: fooinit.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/fooinit.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** fooinit.m 4 Aug 2004 07:15:58 -0000 1.1 --- fooinit.m 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 35,39 **** #ifdef HAVE_CONFIG_H #include "config.h" ! #endif // #ifdef HAVE_CONFIG_H #include <stdio.h> --- 35,39 ---- #ifdef HAVE_CONFIG_H #include "config.h" ! #endif #include <stdio.h> Index: Makefile.am =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/Makefile.am,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Makefile.am 4 Aug 2004 07:15:58 -0000 1.1 --- Makefile.am 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 6,19 **** NULL = ! bin_PROGRAMS = elkfoo pkglib_LTLIBRARIES = elkfoo.la ! elkfoo_SOURCES = \ ! main.c \ ! $(NULL) elkfoo_la_SOURCES = \ - fractone.c \ - misc.c \ bpf.m \ context.m \ --- 6,17 ---- NULL = ! # bin_PROGRAMS = elkfoo pkglib_LTLIBRARIES = elkfoo.la ! #elkfoo_SOURCES = \ ! # main.c \ ! # $(NULL) elkfoo_la_SOURCES = \ bpf.m \ context.m \ *************** *** 29,32 **** --- 27,32 ---- task.m \ tell.m \ + misc.c \ + fractone.c \ $(NULL) *************** *** 49,58 **** -module -avoid-version -no-undefined elkfoo_la_LIBADD = $(ELKFOO_LIBS) $(FND_LIBS) \ -lobjc ! elkfoo_CFLAGS = $(ELKFOO_CFLAGS) @FOO_GNUSTEP_OBJCFLAGS@ ! elkfoo_OBJCFLAGS = $(ELKFOO_OBJCFLAGS) \ ! $(FND_DEFINE) ! elkfoo_LDFLAGS = $(ELKFOO_LDFLAGS) ! elkfoo_LDADD = $(ELKFOO_LIBS) $(FND_LIBS) \ ! -lobjc --- 49,60 ---- -module -avoid-version -no-undefined elkfoo_la_LIBADD = $(ELKFOO_LIBS) $(FND_LIBS) \ + ../../libfoo/src/libfoo.la \ -lobjc ! ! #elkfoo_CFLAGS = $(ELKFOO_CFLAGS) @FOO_GNUSTEP_OBJCFLAGS@ ! #elkfoo_OBJCFLAGS = $(ELKFOO_OBJCFLAGS) \ ! # $(FND_DEFINE) ! #elkfoo_LDFLAGS = $(ELKFOO_LDFLAGS) ! #elkfoo_LDADD = $(ELKFOO_LIBS) $(FND_LIBS) \ ! # -lobjc Index: bpf.m =================================================================== RCS file: /cvsroot/foo/foo/elkfoo/src/bpf.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bpf.m 4 Aug 2004 07:15:58 -0000 1.1 --- bpf.m 5 Aug 2004 08:55:09 -0000 1.2 *************** *** 38,46 **** #define Object SchemeObject /* avoid Obj-C type clash */ ! // #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! // #else ! // #include <elk/scheme.h> ! // #endif #undef Object --- 38,46 ---- #define Object SchemeObject /* avoid Obj-C type clash */ ! #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> ! #else ! #include <elk/scheme.h> ! #endif #undef Object |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:16:07
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32122 Added Files: Makefile.am bpf.m context.m defaults.m foofun.m fooinit.m fractone.c main.c misc.c module.m modules.m pointer.m signals.m snd.m soundfile.m task.m tell.m Log Message: initial checkin. WARNING: not yet working --- NEW FILE: foofun.m --- /* * foofun.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #define Object SchemeObject /* avoid Obj-C type clash */ #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> #else #include <elk/scheme.h> #endif #undef Object #include <math.h> static SchemeObject P_Shelfing_Coefs (sGl, sGm, sGh, sfl, sfh, ssr) SchemeObject sGl, sGm, sGh, sfl, sfh, ssr; { SchemeObject ret = Null; double k1, k2, r1, r2, k1r1, k2r2, a1, a2, b1, b2, c1, c2; double C0, C1, C2, D0, D1, D2; double Gl = Get_Double(sGl); double Gm = Get_Double(sGm); double Gh = Get_Double(sGh); double fl = Get_Double(sfl); double fh = Get_Double(sfh); double sr = Get_Double(ssr); double pi = 4.*atan(1.); GC_Node; GC_Link(ret); k1 = pow(10., (Gl - Gm) / 20); r1 = tan(pi * (fl / sr)) / sqrt(k1); k1r1 = k1 * r1; c1 = (k1r1 + 1) / (r1 + 1); b1 = (k1r1 - 1) / (k1r1 + 1); a1 = (r1 - 1) / (r1 + 1); k2 = pow(10., (Gm - Gh) / 20); r2 = tan(pi * (fh / sr)) / sqrt(k2); k2r2 = k2 * r2; c2 = (k2r2 + 1) / (r2 + 1); b2 = (k2r2 - 1) / (k2r2 + 1); a2 = (r2 - 1) / (r2 + 1); C0 = c1 * c2 * pow(10., Gh / 20); C1 = a1 + a2; C2 = a1 * a2; D0 = C0; D1 = C0 * (b1 + b2); D2 = C0 * (b1 * b2); ret = Cons(Make_Reduced_Flonum(C2), ret); ret = Cons(Make_Reduced_Flonum(C1), ret); ret = Cons(Make_Reduced_Flonum(D2), ret); ret = Cons(Make_Reduced_Flonum(D1), ret); ret = Cons(Make_Reduced_Flonum(D0), ret); GC_Unlink;; return ret; } void elk_init_foofun() { Define_Primitive(P_Shelfing_Coefs, "foo:shelfing-coefs", 6, 6, EVAL); } --- NEW FILE: fractone.c --- /* * fractone.c * * fractional tones reader extension (elk extension) * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* $Id */ /* #include "config.h" */ #include <stdio.h> #include <math.h> /* #ifdef HAVE_FOOELK_SCHEME_H */ #include <fooelk/scheme.h> /* #else */ /* #include <elk/scheme.h> */ /* #endif */ #define SEMI_TONE_CHARACTER 's' #define QUARTER_TONE_CHARACTER 'q' extern Object Read_Special (Object port, int konst); Object read_fractones (Object port, int chr, int konst) { double sem; Object ret; GC_Node; GC_Link(ret); ret = Read_Special(port, konst); /* let Read_Special work for us */ sem = Get_Double(ret); GC_Unlink; switch (chr) { case SEMI_TONE_CHARACTER : /* 0.05776226504666210487259903061386 = 1/12.*log(2) */ return Make_Reduced_Flonum(exp(sem * 0.05776226504666210487259903061386)); case QUARTER_TONE_CHARACTER : /* 0.02888113252333105243629951530693 = 1/24.*log(2) */ return Make_Reduced_Flonum(exp(sem * 0.02888113252333105243629951530693)); default : Reader_Error(port, "internal error: fractone isn't responsible for that reader syntax"); } } /* read_fractones */ void elk_init_foo_fractone () { /* register reader functions */ Define_Reader(SEMI_TONE_CHARACTER, read_fractones); /* semitones */ Define_Reader(QUARTER_TONE_CHARACTER, read_fractones); /* quartertones */ } /* elk_init_foo_fractone */ --- NEW FILE: tell.m --- /* * tell.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif // #include <objc/objc-runtime.h> #include <Foundation/NSInvocation.h> #include <Foundation/NSMethodSignature.h> #include <objc/objc.h> #include <objc/objc-api.h> #include <objc/encoding.h> // for marg_setValue, method_getArgumentInfo etc... // #include <KoBase/KBCompatibility.h> #include <strings.h> #define Object SchemeObject /* avoid Obj-C type clash */ #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> #else #include <elk/scheme.h> #endif #undef Object #include "pointer.h" #include "tell.h" #define SKIP_BODY(p, c) while (*p != c) if (!*p) goto format_error; else p++; static int Convert_Type(type) char *type; { int t; switch (*type++) { case '\0': return 0; case _C_ID: return C_ID; case _C_CLASS: return C_CLASS; case _C_SEL: return C_SEL; case _C_CHR: return C_char; case _C_UCHR: return C_unsigned_char; case _C_SHT: return C_short; case _C_USHT: return C_unsigned_short; case _C_INT: return C_int; case _C_UINT: return C_unsigned_int; case _C_LNG: return C_long; case _C_ULNG: return C_unsigned_long; case _C_FLT: return C_float; case _C_DBL: return C_double; case _C_VOID: return C_VOID; case _C_UNDEF: return C_undef; case _C_CHARPTR: return C_CHAR; case _C_STRUCT_B: goto dont_accept; case _C_PTR: switch (*type++) { case '\0': goto format_error; case _C_CHR: return C_CHAR; case _C_UCHR: return C_UNSIGNED_CHAR; case _C_SHT: return C_SHORT; case _C_USHT: return C_UNSIGNED_SHORT; case _C_INT: return C_INT; case _C_UINT: return C_UNSIGNED_INT; case _C_LNG: return C_LONG; case _C_ULNG: return C_UNSIGNED_LONG; case _C_FLT: return C_FLOAT; case _C_DBL: return C_DOUBLE; case _C_VOID: return C_VOID; case _C_UNDEF: return C_UNDEF; case _C_CHARPTR: return C_CHARPTR; case _C_ARY_B: SKIP_BODY(type, _C_ARY_E); type++; return C_ARRAY; case _C_UNION_B: SKIP_BODY(type, _C_UNION_E); type++; return C_UNION; case _C_STRUCT_B: SKIP_BODY(type, _C_STRUCT_E); type++; return C_STRUCT; case _C_ARY_E: case _C_UNION_E: case _C_STRUCT_E: goto dont_accept; default: goto format_error; } /* NOTREACHED */ case _C_ARY_B: case _C_UNION_B: goto dont_accept; case _C_ARY_E: case _C_UNION_E: case _C_STRUCT_E: default: goto format_error; } /* NOTREACHED */ format_error: Primitive_Error("format error in objc method_types string detected"); dont_accept: Primitive_Error("argument or return type of method not supported"); /*NOTREACHED*/ return 0; /* to avoid compiler warning */ } static objc_return Send(obj, sel, size, frame, retsize) id obj; SEL sel; int size; //marg_list frame; arglist_t frame; int retsize; { objc_return ret; if (retsize == sizeof(double)) // ret.d = ((double (*) ())objc_msgSendv)(obj, sel, size, frame); ret.d = ((double (*) ())objc_msg_sendv)(obj, sel, frame); else // ret.V = objc_msgSendv(obj, sel, size, frame); ret.V = objc_msg_sendv(obj, sel, frame); return ret; } #define PUSH(type, value) marg_setValue(frame, offset, type, value); break static SchemeObject Objc_Send(obj, sel, meth, argc, argv) id obj; SEL sel; Method_t meth; int argc; SchemeObject *argv; { char *type; int offset, size, i, rettype, retsize, t; // objc_return ret; char retval[16]; // static char framebuf[MAXFRAMESIZE]; // marg_list frame = (marg_list) framebuf; // arglist_t frame = (arglist_t) framebuf; // no longer used NSInvocation *targetInvoc; // new NSMethodSignature *targetSign; Alloca_Begin; // new targetSign = [NSMethodSignature signatureWithObjCTypes: meth->method_types]; targetInvoc = [NSInvocation invocationWithMethodSignature: targetSign]; [targetInvoc setTarget: obj]; [targetInvoc setSelector: sel]; // targetSign = [targetInvoc methodSignature]; // if ((method_getNumberOfArguments(meth) - 2) != argc) // if ((method_get_number_of_arguments(meth) - 2) != argc) if (([targetSign numberOfArguments] - 2) != argc) Primitive_Error("wrong number of arguments"); // rettype = Convert_Type(meth->method_types); rettype = Convert_Type([targetSign methodReturnType]); // switch (rettype) { // case C_double: // retsize = sizeof(double); // break; // default: // retsize = sizeof(void *); // } retsize = [targetSign methodReturnLength]; // now handled by NSInvocation class // if ((size = method_getSizeOfArguments(meth)) > MAXFRAMESIZE) // if ((size = method_get_sizeof_arguments(meth)) > MAXFRAMESIZE) // Primitive_Error("tell stack frame too small for arguments"); #define SET_OBJC_ARG [targetInvoc setArgument: &value atIndex: i + 2]; break for (i = 0; i < argc; i++) { type = (char *)[targetSign getArgumentTypeAtIndex: i + 2]; switch (t = Convert_Type(type)) { case C_char: { char value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_short: { short value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_int: { int value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_long: { long value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_unsigned_char: { unsigned char value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_unsigned_short: { unsigned short value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_unsigned_int: { unsigned int value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_unsigned_long: { unsigned long value = Get_Integer(argv[i]); SET_OBJC_ARG; } case C_float: { float value = Get_Double(argv[i]); [targetInvoc setArgument: &value atIndex: i + 2]; break; } case C_double: { double double_value = Get_Double(argv[i]); [targetInvoc setArgument: &double_value atIndex: i + 2]; break; } case C_CHAR: { char *value; value = Get_String(argv[i]); [targetInvoc setArgument: value atIndex: i + 2]; break; } case C_VOID: case C_SHORT: case C_INT: case C_LONG: case C_UNSIGNED_CHAR: case C_UNSIGNED_SHORT: case C_UNSIGNED_INT: case C_UNSIGNED_LONG: case C_FLOAT: case C_DOUBLE: case C_ID: case C_CLASS: case C_SEL: case C_STRUCT: case C_UNION: case C_ARRAY: case C_CHARPTR: case C_UNDEF: Check_Type(argv[i], T_Pointer); if (POINTER_T(argv[i])->pointer != (void *)0 && POINTER_T(argv[i])->type.data != t) { Primitive_Error("pointer type mismatch: ~s", argv[i]); } [targetInvoc setArgument: POINTER_T(argv[i])->pointer atIndex: i + 2]; break; default: Primitive_Error("internal error when pushing args"); } } // original // method_getArgumentInfo(meth, i + 2, &type, &offset); // switch (t = Convert_Type(type)) { // case C_char: PUSH(char, Get_Integer(argv[i])); // case C_short: PUSH(short, Get_Integer(argv[i])); // case C_int: PUSH(int, Get_Integer(argv[i])); // case C_long: PUSH(long, Get_Integer(argv[i])); // case C_unsigned_char: PUSH(unsigned char, Get_Integer(argv[i])); // case C_unsigned_short: PUSH(unsigned short, Get_Integer(argv[i])); // case C_unsigned_int: PUSH(unsigned int, Get_Integer(argv[i])); // case C_unsigned_long: PUSH(unsigned long, Get_Integer(argv[i])); // case C_float: PUSH(float, Get_Double(argv[i])); // case C_double: PUSH(double, Get_Double(argv[i])); // case C_CHAR: // Make_C_String(argv[i], string); // PUSH(char *, string); // case C_VOID: // case C_SHORT: // case C_INT: // case C_LONG: // case C_UNSIGNED_CHAR: // case C_UNSIGNED_SHORT: // case C_UNSIGNED_INT: // case C_UNSIGNED_LONG: // case C_FLOAT: // case C_DOUBLE: // case C_ID: // case C_CLASS: // case C_SEL: // case C_STRUCT: // case C_UNION: // case C_ARRAY: // case C_CHARPTR: // case C_UNDEF: // Check_Type(argv[i], T_Pointer); // if (POINTER_T(argv[i])->pointer != (void *)0 && // POINTER_T(argv[i])->type.data != t) // Primitive_Error("pointer type mismatch: ~s", argv[i]); // PUSH(void *, POINTER_T(argv[i])->pointer); // default: // Primitive_Error("internal error when pushing args"); // } // } // ret = Send(obj, sel, size, frame, retsize); // replaced message passing mechanism [targetInvoc invoke]; // if (retsize == sizeof(double)) // { // [targetInvoc getReturnValue: (void *)ret.chars]; // } // else // { // [targetInvoc getReturnValue: ret.V]; // } [targetInvoc getReturnValue: retval]; RELEASE(targetInvoc); RELEASE(targetSign); switch (rettype) { case C_char: return Make_Integer(*retval); case C_short: return Make_Integer(*(short *)retval); case C_int: return Make_Integer(*(int *)retval); case C_long: return Make_Integer(*(long *)retval); case C_unsigned_char: return Make_Unsigned(*retval); case C_unsigned_short: return Make_Unsigned(*(short *)retval); case C_unsigned_int: return Make_Unsigned(*(int *)retval); case C_unsigned_long: return Make_Unsigned(*(long *)retval); case C_float: return Make_Reduced_Flonum(*(float *)retval); case C_double: return Make_Reduced_Flonum(*(double *)retval); case C_undef: return Make_Reduced_Flonum(*(int *)retval); case C_CHAR: if (retval == NULL) { return False; } else { return Make_String(*(char **)retval, strlen(*(char **)retval)); } case C_VOID: case C_SHORT: case C_INT: case C_LONG: case C_UNSIGNED_CHAR: case C_UNSIGNED_SHORT: case C_UNSIGNED_INT: case C_UNSIGNED_LONG: case C_FLOAT: case C_DOUBLE: case C_ID: case C_CLASS: case C_SEL: case C_STRUCT: case C_UNION: case C_ARRAY: case C_CHARPTR: case C_UNDEF: if ((void *)retval == NULL) return Null_Pointer; else return A_Make_Pointer(*(void **)retval, rettype); default: Primitive_Error("internal error with return"); } // original // switch (rettype) { // /* // * The original idea was to avoid indices with the union but either // * it never worked or NeXT changed something in the Obj-C runtime // * system ... since we discovered problems we hacked with indices // */ // case C_char: return Make_Integer(ret.chars[3]); // case C_short: return Make_Integer(ret.shorts[1]); // case C_int: return Make_Integer(ret.i); // case C_long: return Make_Integer(ret.l); // case C_unsigned_char: return Make_Unsigned(ret.chars[3]); // case C_unsigned_short: return Make_Unsigned(ret.shorts[1]); // case C_unsigned_int: return Make_Unsigned(ret.i); // case C_unsigned_long: return Make_Unsigned(ret.l); // case C_float: return Make_Reduced_Flonum(ret.f); // case C_double: return Make_Reduced_Flonum(ret.d); // case C_undef: return Make_Reduced_Flonum(ret.i); // case C_CHAR: // if (ret.C == (char *)0) // return False; // else // return Make_String(ret.C, strlen(ret.C)); // case C_VOID: // case C_SHORT: // case C_INT: // case C_LONG: // case C_UNSIGNED_CHAR: // case C_UNSIGNED_SHORT: // case C_UNSIGNED_INT: // case C_UNSIGNED_LONG: // case C_FLOAT: // case C_DOUBLE: // case C_ID: // case C_CLASS: // case C_SEL: // case C_STRUCT: // case C_UNION: // case C_ARRAY: // case C_CHARPTR: // case C_UNDEF: // if (ret.V == (void *)0) // return Null_Pointer; // else // return A_Make_Pointer(ret.V, rettype); // default: // Primitive_Error("internal error with return"); // } /* NOTREACHED */ Alloca_End; return Null_Pointer; /* avoid warning */ } static SchemeObject P_Tell(argc, argv) int argc; SchemeObject *argv; { SchemeObject receiver, selector, result; STR name; SEL sel = @selector(name); // to make compiler shut up id obj = nil; // idem Method_t meth; // Alloca_Begin; GC_Node2; receiver = argv[0]; selector = argv[1]; GC_Link2(receiver, selector); switch (TYPE(receiver)) { case T_Symbol: receiver = SYMBOL(receiver)->name; case T_String: name = Get_String(receiver); // if ((obj = objc_getClass(name)) == nil) if ((obj = objc_get_class(name)) == nil) Primitive_Error("class not found: ~s", receiver); break; default: if (TYPE(receiver) == T_Pointer) { if (POINTER_T(receiver)->type.data != C_ID) Primitive_Error("illegal receiver type: ~s", receiver); if ((obj = (id) POINTER_T(receiver)->pointer) == nil) Primitive_Error("null pointer: ~s", receiver); } else Wrong_Type_Combination(receiver, "string, symbol or pointer"); } switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("method not found: ~s", selector); // new: this avoids breakdown in class_get_instance_method if ([obj respondsToSelector: sel] == NO) { Primitive_Error("object does not understand selector: ~s", selector); } break; default: if (TYPE(selector) == T_Pointer) { if (POINTER_T(selector)->type.data != C_SEL) Primitive_Error("illegal selector type: ~s", selector); if ((sel = (SEL)POINTER_T(selector)->pointer) == NULL) Primitive_Error("null pointer: ~s", selector); if (sel_isMapped(sel) == NO) Primitive_Error("selector not mapped: ~s", selector); } else Wrong_Type_Combination(receiver, "string, symbol or sel"); } // if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) Primitive_Error("can't access method for selector: ~s", selector); result = Objc_Send(obj, sel, meth, argc - 2, argv + 2); GC_Unlink; // Alloca_End; return result; } static SchemeObject P_Types(receiver, selector) SchemeObject receiver, selector; { STR name; SEL sel = @selector(name); // make compiler shut up id obj = nil; // idem Method_t meth; // Alloca_Begin; switch (TYPE(receiver)) { case T_Symbol: receiver = SYMBOL(receiver)->name; case T_String: name = Get_String(receiver); // if ((obj = objc_getClass(name)) == nil) if ((obj = objc_get_class(name)) == nil) Primitive_Error("class not found: ~s", receiver); break; default: if (TYPE(receiver) == T_Pointer) { if (POINTER_T(receiver)->type.data != C_ID) Primitive_Error("illegal receiver type: ~s", receiver); if ((obj = (id) POINTER_T(receiver)->pointer) == nil) Primitive_Error("null pointer: ~s", receiver); } else Wrong_Type_Combination(receiver, "string, symbol or pointer"); } switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("selector not found: ~s", selector); // new: this avoids breakdown in class_get_instance_method if ([obj respondsToSelector: sel] == NO) { Primitive_Error("object does not understand selector: ~s", selector); } break; default: Wrong_Type_Combination(selector, "string or symbol"); } // if ((meth = class_getInstanceMethod(obj->isa, sel)) == NULL) if ((meth = class_get_instance_method(obj->class_pointer, sel)) == NULL) Primitive_Error("can't access method for selector: ~s", selector); // Alloca_End; return Make_String(meth->method_types, strlen(meth->method_types)); } static SchemeObject P_Selector(selector) SchemeObject selector; { STR name; SEL sel = @selector(name); // make compiler shut up SchemeObject result; // Alloca_Begin; switch (TYPE(selector)) { case T_Symbol: selector = SYMBOL(selector)->name; case T_String: name = Get_String(selector); // if ((sel = sel_getUid(name)) == 0) if ((sel = sel_get_uid(name)) == 0) Primitive_Error("selector not found: ~s", selector); break; default: Wrong_Type_Combination(selector, "string or symbol"); } // Alloca_End; if (sel_isMapped(sel) == NO) return False; else return A_Make_Pointer((int)sel, C_SEL); } void elk_init_tell() { Define_Primitive(P_Tell, "tell", 2, MANY, VARARGS); Define_Primitive(P_Types, "types", 2, 2, EVAL); Define_Primitive(P_Selector, "selector", 1, 1, EVAL); P_Provide(Intern("tell")); } --- NEW FILE: signals.m --- /* * signals.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif // #include <objc/objc-class.h> /* objc_class */ #include <objc/objc-api.h> /* objc_class */ #include <objc/Object.h> #define Object SchemeObject /* avoid Obj-C type clash */ #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> #else #include <elk/scheme.h> #endif #undef Object #include "signals.h" #include "module.h" int T_Signal; SchemeObject A_Add_List_Of_Terminal_Signals(SchemeObject list); static SchemeObject P_Signalp(x) SchemeObject x; { return TYPE(x) == T_Signal ? True : False; } SchemeObject A_Make_Signal(n, f) int n; SchemeObject f; { SchemeObject signal; GC_Node; GC_Link(f); signal = Alloc_Object(sizeof(struct S_Signal), T_Signal, 0); SIGNAL_T(signal)->vector = Make_Vector(n, f); GC_Unlink; SIGNAL_T(signal)->terminal = 0; return signal; } SchemeObject A_Make_Terminal_Signal(SchemeObject module, int constant, double value) { SchemeObject signal; signal = A_Make_Signal(1, module); SIGNAL_T(signal)->terminal = 1; if (constant != 0) { SIGNAL_T(signal)->constant = 1; SIGNAL_T(signal)->value = value; } else SIGNAL_T(signal)->constant = 0; return signal; } static SchemeObject P_Signal(argc, argv) int argc; SchemeObject *argv; { SchemeObject signal, x; int i; signal = A_Make_Signal(argc, Null); for (i = 0; i < argc; i++) { x = *argv++; Check_Type(x, T_Signal); VECTOR(SIGNAL_T(signal)->vector)->data[i] = x; } return signal; } static long Signal_Length(signal) SchemeObject signal; { return VECTOR(SIGNAL_T(signal)->vector)->size; } static SchemeObject P_Signal_Length(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return Make_Integer(Signal_Length(signal)); } static SchemeObject Signal_Ref (signal, n) SchemeObject signal; int n; { SchemeObject vector = SIGNAL_T(signal)->vector; if (n < 0 || n >= VECTOR(vector)->size) Range_Error (Make_Integer(n)); return VECTOR(vector)->data[n]; } static SchemeObject P_Signal_Ref (signal, n) SchemeObject signal, n; { int i = Get_Exact_Integer(n); Check_Type (signal, T_Signal); if (SIGNAL_T(signal)->terminal == 1 && i == 0) return signal; else return Signal_Ref(signal, i); } static SchemeObject P_Signal_Terminalp(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return SIGNAL_T(signal)->terminal == 0 ? False : True; } static SchemeObject Signal_Monop(SchemeObject signal) { if (SIGNAL_T(signal)->terminal == 1) return True; else if (Signal_Length(signal) != 1) return False; else return Signal_Monop(Signal_Ref(signal, 0)); } static SchemeObject P_Signal_Monop(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return Signal_Monop(signal); } SchemeObject Signal_Constantp(signal) SchemeObject signal; { if (Signal_Length(signal) != 1) return False; else if (SIGNAL_T(signal)->terminal == 1) return SIGNAL_T(signal)->constant == 1 ? True : False; else return Signal_Constantp(Signal_Ref(signal, 0)); } static SchemeObject P_Signal_Constantp(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return Signal_Constantp(signal); } double Signal_Constant_Value(signal) SchemeObject signal; { if (Signal_Length(signal) != 1) Primitive_Error("signal not constant"); else if (SIGNAL_T(signal)->terminal == 1) if (SIGNAL_T(signal)->constant != 1) Primitive_Error("signal not constant"); else return SIGNAL_T(signal)->value; else return Signal_Constant_Value(Signal_Ref(signal, 0)); } static SchemeObject P_Signal_Constant_Value(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return Make_Reduced_Flonum(Signal_Constant_Value(signal)); } static SchemeObject P_Signal_2_List(signal) SchemeObject signal; { SchemeObject list = Null; int i; GC_Node; Check_Type(signal, T_Signal); if (SIGNAL_T(signal)->terminal == 1) return Cons(signal, Null); GC_Link(signal); for (i = Signal_Length(signal) - 1; i >= 0; i--) list = Cons(Signal_Ref(signal, i), list); GC_Unlink; return list; } static SchemeObject P_Signal_Module(signal) SchemeObject signal; { Check_Type(signal, T_Signal); if (SIGNAL_T(signal)->terminal != 1) Primitive_Error("signal not terminal"); return Signal_Ref(signal, 0); } /* * produces a list of terminal signals */ void A_Signal_Flatten(signal, list) SchemeObject signal; SchemeObject *list; { int i; if (SIGNAL_T(signal)->terminal == 1) *list = Cons(signal, *list); else for (i = 0; i < Signal_Length(signal); i++) A_Signal_Flatten(Signal_Ref(signal, i), list); } SchemeObject A_Make_Signal_Terminal(signal) SchemeObject signal; { SchemeObject list = Null, ret; GC_Node; if (SIGNAL_T(signal)->terminal == 1) return signal; GC_Link(list); A_Signal_Flatten(signal, &list); if (Fast_Length(list) == 1) ret = Car(list); else ret = A_Make_Terminal_Signal(A_Add_List_Of_Terminal_Signals(list),0,0.); GC_Unlink; return ret; } static SchemeObject P_A_Make_Signal_Terminal(signal) SchemeObject signal; { Check_Type(signal, T_Signal); return A_Make_Signal_Terminal(signal); } static int Signal_Equal(a, b) SchemeObject a, b; { return EQ(a, b); } static void Signal_Print_Tree(x, port, raw, depth, length) SchemeObject x, port; int raw, depth, length; { SchemeObject s; int i; if (SIGNAL_T(x)->terminal == 1) Printf(port, "."); else { Printf(port, "("); for (i = 0; i < Signal_Length(x); i++) { s = VECTOR(SIGNAL_T(x)->vector)->data[i]; Signal_Print_Tree(s, port, raw, depth, length); } Printf(port, ")"); } } static int Signal_Print(x, port, raw, depth, length) SchemeObject x, port; int raw, depth, length; { SchemeObject module; Printf(port, "#[signal "); if (SIGNAL_T(x)->terminal == 1) { module = VECTOR(SIGNAL_T(x)->vector)->data[0]; Print_Object (MODULE_T(module)->type, port, raw, depth, length); if (SIGNAL_T(x)->constant == 1) { Printf(port, " "); Printf(port, FLONUM_FORMAT, SIGNAL_T(x)->value); } } else Signal_Print_Tree(x, port, raw, depth, length); Printf(port, "]"); return 0; } static int Signal_Visit(x, f) SchemeObject *x; int (*f)(SchemeObject*); { //fprintf(stderr, "visit signal\n"); //fflush(stderr); (*f)(&(SIGNAL_T(*x)->vector)); return 0; } #define DP Define_Primitive void elk_init_signals() { T_Signal = Define_Type(0, "signal", NOFUNC, sizeof(struct S_Signal), Signal_Equal, Signal_Equal, Signal_Print, Signal_Visit); DP(P_Signalp, "foo:signal?", 1, 1, EVAL); DP(P_Signal, "foo:signal", 0, MANY, VARARGS); DP(P_Signal_Length, "foo:signal-length", 1, 1, EVAL); DP(P_Signal_Ref, "foo:signal-ref", 2, 2, EVAL); DP(P_Signal_2_List, "foo:signal->list", 1, 1, EVAL); DP(P_Signal_Terminalp, "foo:signal-terminal?", 1, 1, EVAL); DP(P_Signal_Monop, "foo:signal-mono?", 1, 1, EVAL); DP(P_Signal_Constantp, "foo:signal-constant?", 1, 1, EVAL); DP(P_Signal_Constant_Value, "foo:signal-constant-value", 1, 1, EVAL); DP(P_Signal_Module, "foo:signal-module", 1, 1, EVAL); DP(P_A_Make_Signal_Terminal, "foo:signal-make-terminal", 1, 1, EVAL); P_Provide(Intern("signal")); } --- NEW FILE: misc.c --- /* * misc.c * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* #include "config.h" */ /* #ifdef HAVE_FOOELK_SCHEME_H */ #include <fooelk/scheme.h> /* #else */ /* #include <elk/scheme.h> */ /* #endif */ #include <unistd.h> #include <string.h> #include <limits.h> // for PATH_MAX #include <sys/types.h> #include <sys/timeb.h> #include <sys/wait.h> // #include <libc.h> extern char *getenv(); static int Open_Max () { #ifdef OPEN_MAX /* POSIX */ return OPEN_MAX; #else #ifdef GETDTABLESIZE return getdtablesize(); /* Return value may change during runtime */ #else #ifdef SYSCONF static r; if (r == 0) { if ((r = sysconf (_SC_OPEN_MAX)) == -1) r = 256; } return r; #else #ifdef NOFILE return NOFILE; #else return 256; #endif #endif #endif #endif } static Object P_Time() { struct timeb t; extern int ftime(); ftime(&t); return Make_Reduced_Flonum((double)t.time + t.millitm / 1000.); } static Object P_Getpid() { return Make_Integer(getpid()); } static Object P_System (cmd) Object cmd; { register char *s; register int i, n, pid; union wait status; s = Get_String(cmd); #ifdef VFORK switch (pid = vfork ()) { #else switch (pid = fork ()) { #endif case -1: /* where is extern errno defined ? Saved_Errno = errno; Primitive_Error ("cannot fork: ~E"); */ Primitive_Error ("cannot fork"); case 0: n = Open_Max (); for (i = 3; i < n; i++) (void)close (i); execl ("/bin/sh", "sh", "-c", s, (char *)0); _exit (127); default: Disable_Interrupts; while ((i = wait (&status)) != pid && i != -1) ; Enable_Interrupts; } if (i == -1) return False; if ((n = (status.w_status & 0377))) return Cons (Make_Fixnum (n), Null); return Make_Fixnum ((status.w_status >> 8) & 0377); } static Object P_Getenv (e) Object e; { register char *s; Object ret; s = Get_String(e); ret = (s = getenv (s)) ? Make_String (s, strlen (s)) : False; return ret; } static Object P_Getwd () { char buffer[PATH_MAX + 1]; if (getcwd(buffer, PATH_MAX) == NULL) return False; else return Make_String(buffer, strlen(buffer)); } static Object P_Num_Sprintf (form, num) Object form; Object num; { char buffer[1024]; char *f; Object ret; f = Get_String(form); switch (TYPE(num)) { case T_Fixnum: sprintf(buffer, f, FIXNUM(num)); break; case T_Bignum: sprintf(buffer, f, Bignum_To_Long(num)); break; case T_Flonum: sprintf(buffer, f, Get_Double(num)); break; default: Primitive_Error("illegal type - expected number"); } ret = Make_String(buffer, strlen (buffer)); return ret; } void elk_init_misc() { Define_Primitive(P_Time, "time", 0, 0, EVAL); Define_Primitive(P_Getpid, "getpid", 0, 0, EVAL); Define_Primitive(P_System, "system", 1, 1, EVAL); Define_Primitive(P_Getenv, "getenv", 1, 1, EVAL); Define_Primitive(P_Getwd, "getwd", 0, 0, EVAL); Define_Primitive(P_Num_Sprintf, "foo:num-sprintf", 2, 2, EVAL); } --- NEW FILE: modules.m --- /* * modules.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public [...1022 lines suppressed...] DP(P_Make_ReadTranspSnd, "foo:make-read-snd", 1, 1, EVAL); DP(P_Make_Reverb, "foo:make-reverb", 4, MANY, VARARGS); DP(P_Make_Reverb8, "foo:make-reverb8", 8, MANY, VARARGS); DP(P_Make_ReverbOutput, "foo:make-revout", 2, 2, EVAL); DP(P_Make_Sub, "foo:make-sub", 1, MANY, VARARGS); DP(P_Make_TranspBpf, "foo:make-transp-bpf", 2, 2, EVAL); DP(P_Make_TranspSnd, "foo:make-transp-snd", 2, 3, VARARGS); DP(P_Make_V2pf, "foo:make-v2pf", 3, 3, EVAL); /// math modules DP(P_Make_Abs, "foo:make-abs", 1, 1, EVAL); DP(P_Make_Exp, "foo:make-exp", 1, 1, EVAL); DP(P_Make_Log, "foo:make-log", 1, 1, EVAL); DP(P_Make_Log10, "foo:make-log10", 1, 1, EVAL); DP(P_Make_Sqrt, "foo:make-sqrt", 1, 1, EVAL); DP(P_Make_Pow, "foo:make-pow", 2, 2, EVAL); DP(P_Make_Min, "foo:make-min", 2, 2, EVAL); DP(P_Make_Max, "foo:make-max", 2, 2, EVAL); P_Provide(Intern("modules")); } --- NEW FILE: soundfile.m --- /* * soundfile.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <FOO/FOOSoundFile.h> #include <signal.h> #include <sndfile.h> #include <limits.h> /* for PATH_MAX */ #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> #define Object SchemeObject /* avoid Obj-C type clash */ #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> #else #include <elk/scheme.h> #endif #undef Object #include "context.h" #include "pointer.h" #include "snd.h" SchemeObject General_File_Operation (SchemeObject s, int op); SchemeObject Get_File_Name (SchemeObject name); #define MkSt(buffer) (Make_String(buffer, strlen(buffer))) enum { SND_LENGTH, SND_FORMAT, SND_CHANNELS, SND_SRATE, SND_FILETYPE }; static SchemeObject P_Make_Soundfile (int argc, SchemeObject *argv) { SF_INFO s; SNDFILE *sfd; SchemeObject name = General_File_Operation(argv[0], 0); char buffer[PATH_MAX + 1], *n; int type, fmode = 0644, dmode = 0755; /* fd, l, m; */ struct stat st; // double sr = [GlobalsManager getDefaultSamplingRate]; // Alloca_Begin; s.format = 0; // set soundfile filetype switch (type = Scheme_To_C_Symbol(argv[4], sndFileTypes)) { case SND_FILETYPE_WAV: s.format |= SF_FORMAT_WAV; break; case SND_FILETYPE_AIFF: s.format |= SF_FORMAT_AIFF; break; case SND_FILETYPE_SND: s.format |= SF_FORMAT_AU; break; case SND_FILETYPE_PAF: s.format |= SF_FORMAT_PAF; break; case SND_FILETYPE_SVX: s.format |= SF_FORMAT_SVX; break; case SND_FILETYPE_NIST: s.format |= SF_FORMAT_NIST; break; case SND_FILETYPE_VOC: s.format |= SF_FORMAT_VOC; break; case SND_FILETYPE_IRCAM: s.format |= SF_FORMAT_IRCAM; break; case SND_FILETYPE_WAV64: s.format |= SF_FORMAT_W64; break; case SND_FILETYPE_MAT4: s.format |= SF_FORMAT_MAT4; break; case SND_FILETYPE_MAT5: s.format |= SF_FORMAT_MAT5; break; case SND_FILETYPE_PVF: s.format |= SF_FORMAT_PVF; break; case SND_FILETYPE_XI: s.format |= SF_FORMAT_XI; break; default: Primitive_Error("soundfile.m: internal inconsistency (filetype)"); } // set soundfile data format switch (type = Scheme_To_C_Symbol(argv[1], sndTypes)) { case SND_CHAR: s.format |= SF_FORMAT_PCM_S8; break; case SND_SHORT: s.format |= SF_FORMAT_PCM_16; break; case SND_LONG: s.format |= SF_FORMAT_PCM_32; break; case SND_FLOAT: s.format |= SF_FORMAT_FLOAT; break; case SND_DOUBLE: s.format |= SF_FORMAT_DOUBLE; break; case SND_INCREMENTAL: s.format |= SF_FORMAT_FLOAT; break; default: Primitive_Error("soundfile.m: internal inconsistency (format)"); } // set soundfile channels s.channels = Get_Integer(argv[2]); if (s.channels <= 0) { Primitive_Error("illegal channel count: ~a", argv[2]); } // set samplerate s.samplerate = Get_Double(argv[3]); if (s.samplerate <= 0) { Primitive_Error("illegal sampling rate: ~a", argv[3]); } n = Get_String(name); strcpy(buffer, n); if (stat(buffer, &st) == 0) { Primitive_Error("exists already: ~a", MkSt(buffer)); } if (type == SND_INCREMENTAL) { if (mkdir(buffer, dmode) == -1) { Primitive_Error("cannot create directory: ~a", MkSt(buffer)); } strcat(strcat(buffer, "/"), SND_MIX_FILE_NAME); } /* ask libsndfile if type/subtype combination in SF_INFO struct is * valid */ if (! sf_format_check(&s)) { Primitive_Error("parameter combination for file ~a is invalid", MkSt(buffer)); } /* creating a soundfile with header using libsndfile: * simply open a file for write with an appropriate SF_INFO struct */ if (! (sfd = sf_open(buffer, SFM_WRITE, &s))) { Primitive_Error("cannot create ~a", MkSt(buffer)); } if (sf_close(sfd)) { Primitive_Error("error closing ~a", MkSt(buffer)); } // Alloca_End; return True; } static SchemeObject General_Soundfile_Operation (SchemeObject soundfile, int operation) { SchemeObject name = P_Tilde_Expand(Get_File_Name(soundfile)), ret; char *cname, buffer[PATH_MAX + 1]; struct stat st; int incr = 0; id snd; NSString *filename; // Alloca_Begin; cname = Get_String(name); if (stat(cname, &st) == -1) { Primitive_Error("cannot stat: ~a", name); } if (st.st_mode & S_IFDIR) { sprintf(buffer, "%s/%s", cname, SND_MIX_FILE_NAME); cname = buffer; incr = 1; } filename = AUTORELEASE([NSString stringWithCString: cname]); snd = [[FOOSoundFile alloc] initWithContext: nil]; [snd initWithFile: filename]; switch (operation) { case SND_LENGTH: ret = Make_Reduced_Flonum([snd size] / [snd getSamplingRate]); break; case SND_FORMAT: if (incr == 1) { ret = Intern("incremental"); } else { switch ([snd getDataFormat]) { case SF_FORMAT_PCM_S8: ret = Intern("char"); break; case SF_FORMAT_PCM_16: ret = Intern("short"); break; case SF_FORMAT_PCM_32: ret = Intern("long"); break; case SF_FORMAT_FLOAT: ret = Intern("float"); break; case SF_FORMAT_DOUBLE: ret = Intern("double"); break; default: Primitive_Error("unsupported format ~a", Make_Integer([snd getDataFormat])); } } break; case SND_CHANNELS: ret = Make_Integer([snd getChannelCount]); break; case SND_SRATE: ret = Make_Reduced_Flonum([snd getSamplingRate]); break; case SND_FILETYPE: switch ([snd getFileType]) { case SF_FORMAT_WAV: ret = Intern("wav"); break; case SF_FORMAT_AIFF: ret = Intern("aiff"); break; case SF_FORMAT_AU: ret = Intern("snd"); break; case SF_FORMAT_PAF: ret = Intern("paf"); break; case SF_FORMAT_SVX: ret = Intern("svx"); break; case SF_FORMAT_NIST: ret = Intern("nist"); break; case SF_FORMAT_VOC: ret = Intern("voc"); break; case SF_FORMAT_IRCAM: ret = Intern("ircam"); break; case SF_FORMAT_W64: ret = Intern("wav64"); break; case SF_FORMAT_MAT4: ret = Intern("mat4"); break; case SF_FORMAT_MAT5: ret = Intern("mat5"); break; case SF_FORMAT_PVF: ret = Intern("pvf"); break; case SF_FORMAT_XI: ret = Intern("xi"); break; default: Primitive_Error("unsupported filetype ~a", Make_Integer([snd getFileType])); } break; default: Primitive_Error("internal inconsistency"); } // [snd free]; [snd dealloc]; // Alloca_End; return ret; } #define SND_FUNC(name, type) \ static SchemeObject name(soundfile) SchemeObject soundfile; { \ return General_Soundfile_Operation(soundfile, type); } SND_FUNC(P_Soundfile_Srate, SND_SRATE) SND_FUNC(P_Soundfile_Format, SND_FORMAT) SND_FUNC(P_Soundfile_Length, SND_LENGTH) SND_FUNC(P_Soundfile_Channels, SND_CHANNELS) SND_FUNC(P_Soundfile_Filetype, SND_FILETYPE) static void snd_error (int e) { char buffer[PATH_MAX + 1]; sprintf(buffer, "SNDError: %s", sf_error_number(e)); Primitive_Error(buffer); } static int stop_flag; static int play_tag; static void handle_interrupt () { (void) signal (SIGINT, SIG_IGN); /* commented out since not supported on linux */ // SNDStop(play_tag); stop_flag = 1; } static SchemeObject P_Soundfile_Play (int argc, SchemeObject *argv) { /* playing is not yet implemented in this version */ return True; // SchemeObject name = P_Tilde_Expand(Get_File_Name(argv[0])); // char *cname; // double b = 0, e = -1; // int err, n = 1, r, tag = 0; // SNDSoundStruct *s, *os, *cs; // void (*old_signal)(); // Alloca_Begin; // if (argc > 1) { // b = Get_Double(argv[1]); // if (b < 0) // Primitive_Error("begin time out of range: ~a", argv[1]); // } // if (argc > 2) { // e = Get_Double(argv[2]); // if (e <= b && e != -1) // Primitive_Error("end time smaller or equal begin: ~a", argv[2]); // } // if (argc > 3) { // n = Get_Integer(argv[3]); // if (n < 0) // Primitive_Error("repeat count out of range: ~a", argv[3]); // if (n == 0) // return True; // } // if (argc > 4) { // r = Get_Integer(argv[4]); // if (r != SND_RATE_HIGH && r != SND_RATE_LOW) // Primitive_Error ("illegal sampling rate: ~a", argv[4]); // } // Make_C_String(name, cname); // if ((err = SNDReadSoundfile(cname, &os)) != SND_ERR_NONE) // snd_error(err); // if (b != 0 || e != -1) { // int start = b * os->samplingRate; // int end, count, scount = SNDSampleCount(os); // if (e == -1) { // end = scount; // if (start >= end) // Primitive_Error("begin out of range: ~a", argv[1]); // } else { // end = e * os->samplingRate; // if (end > scount) // Primitive_Error("end out of range: ~a", argv[2]); // } // count = end - start; // if ((err = SNDCopySamples(&cs, os, start, count)) != SND_ERR_NONE) // snd_error(err); // s = cs; // } else // s = os; // if (argc > 4) // s->samplingRate = r; // stop_flag = 0; // old_signal = signal (SIGINT, handle_interrupt); // play_tag = 0; // while (n--) { // if (stop_flag == 1) // goto interrupt; // if ((err = SNDStartPlaying(s, ++play_tag, 5, 5, // SND_NULL_FUN, SND_NULL_FUN)) != SND_ERR_NONE) // snd_error(err); // if (stop_flag == 1) // goto interrupt; // SNDWait(play_tag); // } // Alloca_End; // if (stop_flag == 0) // return True; // else // return False; // interrupt: // signal(SIGINT, old_signal); // Alloca_End; // return False; } #define DP Define_Primitive void elk_init_soundfile () { DP(P_Make_Soundfile, "foo:make-soundfile", 3, 5, VARARGS); DP(P_Soundfile_Format, "foo:soundfile-format", 1, 1, EVAL); DP(P_Soundfile_Length, "foo:soundfile-length", 1, 1, EVAL); DP(P_Soundfile_Srate, "foo:soundfile-srate", 1, 1, EVAL); DP(P_Soundfile_Channels, "foo:soundfile-channels", 1, 1, EVAL); DP(P_Soundfile_Filetype, "foo:soundfile-filetype", 1, 1, EVAL); DP(P_Soundfile_Play, "foo:soundfile-play", 1, 5, VARARGS); P_Provide(Intern("soundfile")); } --- NEW FILE: bpf.m --- /* * bpf.m * * breakpoint function interface * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <FOO/FOOBreakpointFunction.h> #define Object SchemeObject /* avoid Obj-C type clash */ // #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> // #else // #include <elk/scheme.h> // #endif #undef Object #include "context.h" #include "pointer.h" #include "bpf.h" int T_Bpf; #define IdOf(bpf) (BPF_T(bpf)->pointer) static SchemeObject P_Bpfp(x) SchemeObject x; { return TYPE(x) == T_Bpf ? True : False; } SchemeObject A_Make_Bpf(object) id object; { SchemeObject bpf; GC_Node; bpf = Alloc_Object(sizeof(struct S_Bpf), T_Bpf, 0); GC_Link(bpf); BPF_T(bpf)->pointer = object; BPF_T(bpf)->type = Null; BPF_T(bpf)->context = Get_Context(); BPF_T(bpf)->type = Intern((char*)[[object class] name]); GC_Unlink; return bpf; } static SchemeObject P_Make_Bpf(points) SchemeObject points; { int i, np = 0; SchemeObject p, pp, bpf; NSZone *zone; lineseg_t *seglist, *sp; double value, lastvalue, firstvalue, begin, time, lasttime, alpha; int first = 1; GC_Node; for (p = points; !Nullp(p); p = Cdr(p)) { Check_Type (p, T_Pair); np++; } if (np < 2) Primitive_Error("at least two break-points expected"); GC_Link(points); bpf = A_Make_Bpf([[FOOBreakpointFunction alloc] init]); GC_Unlink; zone = [IdOf(bpf) zone]; seglist = NSZoneCalloc(zone, np, sizeof(lineseg_t)); for (p = points, sp = seglist, i = 0; i < np; i++) { Check_Type(p, T_Pair); pp = Car(p); Check_Type(pp, T_Pair); time = Get_Double(Car(pp)); pp = Cdr(pp); Check_Type(pp, T_Pair); value = Get_Double(Car(pp)); pp = Cdr(pp); if (!Nullp(pp)) { if (i == 0) Primitive_Error("illegal first alpha value"); Check_Type(pp, T_Pair); alpha = Get_Double(Car(pp)); } else alpha = 1; if (first) { begin = time; firstvalue = value; first = 0; } else { if (time <= lasttime) Primitive_Error("ascending time values expected"); sp->time = time; sp->value = value; sp->alpha = log(alpha); sp->count = -1; sp->delta = 0; sp++; } lasttime = time; lastvalue = value; p = Cdr(p); } sp->value = 0; sp->count = 0; sp->delta = 0; sp->alpha = 0; [IdOf(bpf) setBpf:seglist first:firstvalue begin:begin end:lasttime]; BPF_T(bpf)->offset = [IdOf(bpf) beginT]; BPF_T(bpf)->length = [IdOf(bpf) sizeT]; BPF_T(bpf)->reversed = 0; return bpf; } static SchemeObject P_Bpf_Offset(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return Make_Reduced_Flonum(BPF_T(bpf)->offset); } static SchemeObject P_Bpf_Length(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return Make_Reduced_Flonum(BPF_T(bpf)->length); } static SchemeObject P_Bpf_Reversedp(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return BPF_T(bpf)->reversed == 1 ? True : False; } static SchemeObject P_Bpf_Type(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return BPF_T(bpf)->type; } static SchemeObject P_Bpf_Context(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return BPF_T(bpf)->context; } static SchemeObject P_Bpf_Pointer(bpf) SchemeObject bpf; { Check_Type(bpf, T_Bpf); return A_Make_Pointer(BPF_T(bpf)->pointer, C_ID); } static SchemeObject P_Bpf_Region(bpf, offset, length) SchemeObject bpf, offset, length; { SchemeObject region; double o, l; id p; GC_Node; Check_Type(bpf, T_Bpf); o = Get_Double(offset); l = Get_Double(length); p = BPF_T(bpf)->pointer; if (o < 0 || l < 0 || o + l > BPF_T(bpf)->length) Primitive_Error("offset/length out of range"); GC_Link(bpf); region = A_Make_Bpf([BPF_T(bpf)->pointer copyOffset:o size:l]); BPF_T(region)->offset = BPF_T(bpf)->offset + o; BPF_T(region)->length = l; BPF_T(region)->reversed = BPF_T(bpf)->reversed; GC_Unlink; return region; } static SchemeObject P_Bpf_Reverse(bpf) SchemeObject bpf; { SchemeObject region; double o, l; id p; GC_Node; Check_Type(bpf, T_Bpf); o = BPF_T(bpf)->offset; l = BPF_T(bpf)->length; p = BPF_T(bpf)->pointer; GC_Link(bpf); region = A_Make_Bpf([BPF_T(bpf)->pointer reverse]); BPF_T(region)->offset = BPF_T(bpf)->offset + o; BPF_T(region)->length = l; BPF_T(region)->reversed = !BPF_T(region)->reversed; GC_Unlink; return region; } static int Bpf_Equal(a, b) SchemeObject a, b; { return EQ(a, b); } static int Bpf_Print(x, port, raw, depth, length) SchemeObject x, port; int raw, depth, length; { Printf(port, "#[bpf]"); return 0; } static int Bpf_Visit(x, f) SchemeObject *x; int (*f)(SchemeObject*); { (*f)(&(BPF_T(*x)->context)); (*f)(&(BPF_T(*x)->type)); return 0; } #define DP Define_Primitive void elk_init_bpf() { T_Bpf = Define_Type(0, "bpf", NOFUNC, sizeof(struct S_Bpf), Bpf_Equal, Bpf_Equal, Bpf_Print, Bpf_Visit); DP(P_Bpfp, "foo:bpf?", 1, 1, EVAL); DP(P_Make_Bpf, "foo:make-bpf", 1, 1, EVAL); DP(P_Bpf_Offset, "foo:bpf-offset", 1, 1, EVAL); DP(P_Bpf_Length, "foo:bpf-length", 1, 1, EVAL); DP(P_Bpf_Reversedp, "foo:bpf-reversed?", 1, 1, EVAL); DP(P_Bpf_Type, "foo:bpf-type", 1, 1, EVAL); DP(P_Bpf_Context, "foo:bpf-context", 1, 1, EVAL); DP(P_Bpf_Pointer, "foo:bpf-pointer", 1, 1, EVAL); DP(P_Bpf_Region, "foo:bpf-region", 3, 3, EVAL); DP(P_Bpf_Reverse, "foo:bpf-reverse", 1, 1, EVAL); P_Provide(Intern("bpf")); } --- NEW FILE: snd.m --- /* * snd.m * * * */ /* * foo sound synthesis system * * (C)1993-2004 Gerhard Eckel, Ramon Gonzalez-Arroyo, IRCAM, ZKM * (C)2003-2004 Martin Rumori */ /* * This file is part of foo. * * foo free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * foo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with foo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <FOO/FOOSoundFile.h> #include <FOO/FOORegion.h> #include <FOO/FOOSoundStream.h> #include <sndfile.h> #include <sys/types.h> #include <sys/param.h> #include <sys/stat.h> #define Object SchemeObject /* avoid Obj-C type clash */ #ifdef HAVE_FOOELK_SCHEME_H #include <fooelk/scheme.h> #else #include <elk/scheme.h> #endif #undef Object #include "context.h" #include "pointer.h" #include "snd.h" int T_Snd; SchemeObject General_File_Operation (SchemeObject s, int op); #define IdOf(snd) (SND_T(snd)->pointer) struct symbol sndTypes[] = { {"char", SND_CHAR}, {"short", SND_SHORT}, {"long", SND_LONG}, {"float", SND_FLOAT}, {"double", SND_DOUBLE}, {"incremental", SND_INCREMENTAL}, {0, 0} }; struct symbol sndFileTypes[] = { {"wav", SND_FILETYPE_WAV}, {"aiff", SND_FILETYPE_AIFF}, {"snd", SND_FILETYPE_SND}, {"au", SND_FILETYPE_SND}, {"paf", SND_FILETYPE_PAF}, {"svx", SND_FILETYPE_SVX}, {"nist", SND_FILETYPE_NIST}, {"voc", SND_FILETYPE_VOC}, {"ircam", SND_FILETYPE_IRCAM}, {"wav64", SND_FILETYPE_WAV64}, {"mat4", SND_FILETYPE_MAT4}, {"mat5", SND_FILETYPE_MAT5}, {"pvf", SND_FILETYPE_PVF}, {"xi", SND_FILETYPE_XI}, {0, 0} }; int Scheme_To_C_Symbol (SchemeObject sym, struct symbol *p) { SchemeObject name; char *s; // Alloca_Begin; Check_Type (sym, T_Symbol); name = SYMBOL (sym)->name; s = Get_String(name); for ( ; p->name; p++ ) if (strcmp (p->name, s) == 0) { break; } if (p->name == 0) { Primitive_Error ("unrecognized keyword: ~s", sym); } // Alloca_End; return p->val; } /* Scheme_To_C_Symbol */ SchemeObject A_Make_Snd (id class) { SchemeObject snd; GC_Node; snd = Alloc_Object(sizeof(struct S_Snd), T_Snd, 0); SND_T(snd)->pointer = [[class alloc] init]; /* * for GC: as long as a snd exists it's context will also */ SND_T(snd)->context = Get_Context(); SND_T(snd)->name = Null; SND_T(snd)->format = Null; SND_T(snd)->filetype = Null; SND_T(snd)->type = Null; GC_Link(snd); SND_T(snd)->type = Intern((char*)[class description]); GC_Unlink; return snd; } /* A_Make_Snd */ static SchemeObject P_Sndp (SchemeObject x) { return TYPE(x) == T_Snd ? True : False; } /* P_Sndp */ static SchemeObject P_Open_Snd (SchemeObject name) { SchemeObject n = General_File_Operation(name, 0), s = Null; char *cn, *t, buffer[PATH_MAX + 1]; struct stat st; int incr; NSString *filename; GC_Node2; // Alloca_Begin; if (! Truep(General_File_Operation(n, 1))) { Primitive_Error("does not exist: ~a", n); } cn = Get_String(n); if (stat(cn, &st) == -1) { Primitive_Error("cannot stat: ~a", n); } if (st.st_mode & S_IFDIR) { sprintf(buffer, "%s/%s", cn, SND_MIX_FILE_NAME); cn = buffer; incr = 1; } else { incr = 0; } GC_Link2(n, s); s = A_Make_Snd([FOOSoundFile class]); filename = AUTORELEASE([NSString stringWithCString: cn]); if ([IdOf(s) initWithFile: filename] == nil) { if (incr == 1) { Primitive_Error("cannot open ~a (incremental soundfile corrupted?)", n); } else { Primitive_Error("cannot open ~a", n); } } SND_T(s)->name = Make_String(STRING(n)->data, STRING(n)->size); GC_Unlink; SND_T(s)->channels = [IdOf(s) getChannelCount]; SND_T(s)->samplerate = [IdOf(s) getSamplingRate]; if (SND_T(s)->channels == 1) { SND_T(s)->channel = 1; } else { SND_T(s)->channel = 0; } if (incr == 1) { t = sndTypes[5].name; } else { switch ([IdOf(s) getDataFormat]) { case SF_FORMAT_PCM_S8: t = sndTypes[0].name; break; case SF_FORMAT_PCM_16: t = sndTypes[1].name; break; case SF_FORMAT_PCM_32: t = sndTypes[2].name; break; case SF_FORMAT_FLOAT: t = sndTypes[3].name; break; case SF_FORMAT_DOUBLE: t = sndTypes[4].name; break; default: Primitive_Error("unknown sound file format: ~a", Make_Integer(([IdOf(s) getDataFormat]))); } } switch ([IdOf(s) getFileType]) { case SF_FORMAT_WAV: t = sndFileTypes[0].name; break; case SF_FORMAT_AIFF: t = sndFileTypes[1].name; break; case SF_FORMAT_AU: t = sndFileTypes[2].name; break; case SF_FORMAT_PAF: t = sndFileTypes[3].name; break; case SF_FORMAT_SVX: t = sndFileTypes[4].name; break; case SF_FORMAT_NIST: t = sndFileTypes[5].name; break; case SF_FORMAT_VOC: t = sndFileTypes[6].name; break; case SF_FORMAT_IRCAM: t = sndFileTy... [truncated message content] |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:15:34
|
Update of /cvsroot/foo/foo/elkfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32000/src Log Message: Directory /cvsroot/foo/foo/elkfoo/src added to the repository |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:15:22
|
Update of /cvsroot/foo/foo/elkfoo/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31927 Added Files: Makefile.am bpf.h context.h module.h pointer.h signals.h snd.h task.h tell.h Log Message: initial checkin. WARNING: not yet working --- NEW FILE: signals.h --- #ifndef FOOIFACE_SIGNALS_H_INCLUDED #define FOOIFACE_SIGNALS_H_INCLUDED struct S_Signal { SchemeObject vector; double value; char constant; char terminal; }; #define SIGNAL_T(x) ((struct S_Signal *)POINTER(x)) extern int T_Signal; #define FLONUM_FORMAT "%.15g" SchemeObject A_Make_Terminal_Signal(SchemeObject m, int c, double v); SchemeObject A_Make_Signal_Terminal(SchemeObject signal); SchemeObject Signal_Constantp(SchemeObject signal); #endif /* #ifndef FOOIFACE_SIGNALS_H_INCLUDED */ --- NEW FILE: tell.h --- #ifndef FOOIFACE_TELL_H_INCLUDED #define FOOIFACE_TELL_H_INCLUDED #define MAXFRAMESIZE 1024 typedef union _objc_return { /* 4 bytes on stack */ char c; short s; int i; long l; float f; void *V; char *C; short *S; int *I; long *L; float *F; double *D; /* 8 bytes on stack */ double d; char chars[8]; short shorts[4]; int ints[2]; } objc_return; #endif /* #ifndef FOOIFACE_TELL_H_INCLUDED */ --- NEW FILE: module.h --- #ifndef FOOIFACE_MODULE_H_INCLUDED #define FOOIFACE_MODULE_H_INCLUDED struct S_Module { SchemeObject context; SchemeObject type; id pointer; }; #define MODULE_T(x) ((struct S_Module *)POINTER(x)) extern int T_Module; SchemeObject A_Make_Module(id class); #endif /* #ifndef FOOIFACE_MODULE_H_INCLUDED */ --- NEW FILE: Makefile.am --- # foo/elkfoo/include/Makefile.am # 2004 rumori # $Id: Makefile.am,v 1.1 2004/08/04 07:15:13 rumori Exp $ NULL = extensionsdir = $(pkgincludedir)/extensions # we should have a complete elkfoo.h here extensions_HEADERS = \ $(NULL) noinst_HEADERS = \ bpf.h \ context.h \ module.h \ pointer.h \ signals.h \ snd.h \ task.h \ tell.h \ $(NULL) --- NEW FILE: context.h --- #ifndef FOOIFACE_CONTEXT_H_INCLUDED #define FOOIFACE_CONTEXT_H_INCLUDED struct S_Context { SchemeObject times; int channels; id pointer; }; #define CONTEXT_T(x) ((struct S_Context *)POINTER(x)) extern int T_Context; extern SchemeObject V_Context; extern int Write_Context(); extern int Read_Context(); SchemeObject Get_Context(void); #endif /* #ifndef FOOIFACE_CONTEXT_H_INCLUDED */ --- NEW FILE: snd.h --- #ifndef FOOIFACE_SND_H_INCLUDED #define FOOIFACE_SND_H_INCLUDED struct S_Snd { SchemeObject context; SchemeObject type; SchemeObject name; SchemeObject format; SchemeObject filetype; int channels; int channel; double samplerate; double offset; double length; id pointer; char reversed; }; #define SND_T(x) ((struct S_Snd *)POINTER(x)) extern int T_Snd; #define SND_MIX_FILE_NAME "mixfloat.imx" #define SND_MIX_LOCK_NAME "mixlock" struct symbol { char *name; int val; }; enum { SND_CHAR, SND_SHORT, SND_LONG, SND_FLOAT, SND_DOUBLE, SND_INCREMENTAL }; enum { SND_FILETYPE_WAV, SND_FILETYPE_AIFF, SND_FILETYPE_SND, SND_FILETYPE_PAF, SND_FILETYPE_SVX, SND_FILETYPE_NIST, SND_FILETYPE_VOC, SND_FILETYPE_IRCAM, SND_FILETYPE_WAV64, SND_FILETYPE_MAT4, SND_FILETYPE_MAT5, SND_FILETYPE_PVF, SND_FILETYPE_XI }; extern struct symbol sndTypes[]; extern struct symbol sndFileTypes[]; #endif /* #ifndef FOOIFACE_SND_H_INCLUDED */ --- NEW FILE: bpf.h --- #ifndef FOOIFACE_BPF_H_INCLUDED #define FOOIFACE_BPF_H_INCLUDED struct S_Bpf { SchemeObject context; SchemeObject type; double offset; double length; id pointer; char reversed; }; #define BPF_T(x) ((struct S_Bpf *)POINTER(x)) extern int T_Bpf; #endif /* #ifndef FOOIFACE_BPF_H_INCLUDED */ --- NEW FILE: pointer.h --- #ifndef FOOIFACE_POINTER_H_INCLUDED #define FOOIFACE_POINTER_H_INCLUDED struct S_Pointer { SchemeObject type; void *pointer; }; #define POINTER_T(x) ((struct S_Pointer *)POINTER(x)) extern int T_Pointer; extern SchemeObject A_Make_Pointer(); extern SchemeObject Null_Pointer; #define C_base 0 #define C_char (C_base + 1) #define C_short (C_base + 2) #define C_int (C_base + 3) #define C_long (C_base + 4) #define C_unsigned_char (C_base + 5) #define C_unsigned_short (C_base + 6) #define C_unsigned_int (C_base + 7) #define C_unsigned_long (C_base + 8) #define C_float (C_base + 9) #define C_double (C_base + 10) #define C_pointers (C_double + 1) #define C_VOID (C_pointers + 0) #define C_CHAR (C_pointers + 1) #define C_SHORT (C_pointers + 2) #define C_INT (C_pointers + 3) #define C_LONG (C_pointers + 4) #define C_UNSIGNED_CHAR (C_pointers + 5) #define C_UNSIGNED_SHORT (C_pointers + 6) #define C_UNSIGNED_INT (C_pointers + 7) #define C_UNSIGNED_LONG (C_pointers + 8) #define C_FLOAT (C_pointers + 9) #define C_DOUBLE (C_pointers + 10) #define C_ID (C_pointers + 11) #define C_CLASS (C_pointers + 12) #define C_SEL (C_pointers + 13) #define C_STRUCT (C_pointers + 14) #define C_UNION (C_pointers + 15) #define C_ARRAY (C_pointers + 16) #define C_undef (C_pointers + 17) #define C_CHARPTR (C_pointers + 18) #define C_UNDEF (C_pointers + 19) #define C_last C_UNDEF #endif /* #ifndef FOOIFACE_POINTER_H_INCLUDED */ --- NEW FILE: task.h --- #ifndef FOOIFACE_TASK_H_INCLUDED #define FOOIFACE_TASK_H_INCLUDED struct S_Task { SchemeObject context; SchemeObject output; int reference; int offset; int position; double samplingrate; int buffersize; char incremental; char type; }; #define TASK_T(x) ((struct S_Task *)POINTER(x)) extern int T_Task; #define DEFAULT_SAMPLING_RATE 44100 #define DEFAULT_BLOCK_SIZE 1024 #endif /* #ifndef FOOIFACE_TASK_H_INCLUDED */ |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:14:59
|
Update of /cvsroot/foo/foo/elkfoo/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31817/include Log Message: Directory /cvsroot/foo/foo/elkfoo/include added to the repository |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:14:47
|
Update of /cvsroot/foo/foo/elkfoo/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31759 Added Files: Makefile.am objc-runtime.m4 objc.m4 Log Message: initial checkin. WARNING: not yet working --- NEW FILE: objc.m4 --- # objc.m4 # Based on c.m4 from GNU Autoconf # The Objective C support, added by Landon Fuller <landonf at opendarwin.org> # on March 10th, 2004, is heavily based on Autoconf's existing C++ support. # ########### Copyright and Licensing terms ########## # # This file is part of Autoconf. -*- Autoconf -*- # Programming languages support. # Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the Free Software Foundation gives unlimited # permission to copy, distribute and modify the configure scripts that # are the output of Autoconf. You need not follow the terms of the GNU # General Public License when using or distributing such scripts, even # though portions of the text of Autoconf appear in them. The GNU # General Public License (GPL) does govern all other use of the material # that constitutes the Autoconf program. # # Certain portions of the Autoconf source text are designed to be copied # (in certain cases, depending on the input) into the output of # Autoconf. We call these the "data" portions. The rest of the Autoconf # source text consists of comments plus executable code that decides which # of the data portions to output in any given case. We call these # comments and executable code the "non-data" portions. Autoconf never # copies any of the non-data portions into its output. # # This special exception to the GPL applies to versions of Autoconf # released by the Free Software Foundation. When you make and # distribute a modified version of Autoconf, you may extend this special # exception to the GPL to apply to your modified version as well, *unless* # your modified version has the potential to copy into its output some # of the text that was the non-data portion of the version that you started # with. (In other words, unless your change moves or copies text from # the non-data portions to the data portions.) If your modification has # such potential, you must delete any notice of this special exception # to the GPL from your modified version. # # Written by David MacKenzie, with help from # Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, # Roland McGrath, Noah Friedman, david d zuhn, and many others. # ########## GNU General Public License (GPL), version 2 ########## # # GNU GENERAL PUBLIC LICENSE # Version 2, June 1991 # # Copyright (C) 1989, 1991 Free Software Foundation, Inc. # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Everyone is permitted to copy and distribute verbatim copies # of this license document, but changing it is not allowed. # # Preamble # # The licenses for most software are designed to take away your # freedom to share and change it. By contrast, the GNU General Public # License is intended to guarantee your freedom to share and change free # software--to make sure the software is free for all its users. This # General Public License applies to most of the Free Software # Foundation's software and to any other program whose authors commit to # using it. (Some other Free Software Foundation software is covered by # the GNU Library General Public License instead.) You can apply it to # your programs, too. # # When we speak of free software, we are referring to freedom, not # price. Our General Public Licenses are designed to make sure that you # have the freedom to distribute copies of free software (and charge for # this service if you wish), that you receive source code or can get it # if you want it, that you can change the software or use pieces of it # in new free programs; and that you know you can do these things. # # To protect your rights, we need to make restrictions that forbid # anyone to deny you these rights or to ask you to surrender the rights. # These restrictions translate to certain responsibilities for you if you # distribute copies of the software, or if you modify it. # # For example, if you distribute copies of such a program, whether # gratis or for a fee, you must give the recipients all the rights that # you have. You must make sure that they, too, receive or can get the # source code. And you must show them these terms so they know their # rights. # # We protect your rights with two steps: (1) copyright the software, and # (2) offer you this license which gives you legal permission to copy, # distribute and/or modify the software. # # Also, for each author's protection and ours, we want to make certain # that everyone understands that there is no warranty for this free # software. If the software is modified by someone else and passed on, we # want its recipients to know that what they have is not the original, so # that any problems introduced by others will not reflect on the original # authors' reputations. # # Finally, any free program is threatened constantly by software # patents. We wish to avoid the danger that redistributors of a free # program will individually obtain patent licenses, in effect making the # program proprietary. To prevent this, we have made it clear that any # patent must be licensed for everyone's free use or not licensed at all. # # The precise terms and conditions for copying, distribution and # modification follow. # # GNU GENERAL PUBLIC LICENSE # TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION # # 0. This License applies to any program or other work which contains # a notice placed by the copyright holder saying it may be distributed # under the terms of this General Public License. The "Program", below, # refers to any such program or work, and a "work based on the Program" # means either the Program or any derivative work under copyright law: # that is to say, a work containing the Program or a portion of it, # either verbatim or with modifications and/or translated into another # language. (Hereinafter, translation is included without limitation in # the term "modification".) Each licensee is addressed as "you". # # Activities other than copying, distribution and modification are not # covered by this License; they are outside its scope. The act of # running the Program is not restricted, and the output from the Program # is covered only if its contents constitute a work based on the # Program (independent of having been made by running the Program). # Whether that is true depends on what the Program does. # # 1. You may copy and distribute verbatim copies of the Program's # source code as you receive it, in any medium, provided that you # conspicuously and appropriately publish on each copy an appropriate # copyright notice and disclaimer of warranty; keep intact all the # notices that refer to this License and to the absence of any warranty; # and give any other recipients of the Program a copy of this License # along with the Program. # # You may charge a fee for the physical act of transferring a copy, and # you may at your option offer warranty protection in exchange for a fee. # # 2. You may modify your copy or copies of the Program or any portion # of it, thus forming a work based on the Program, and copy and # distribute such modifications or work under the terms of Section 1 # above, provided that you also meet all of these conditions: # # a) You must cause the modified files to carry prominent notices # stating that you changed the files and the date of any change. # # b) You must cause any work that you distribute or publish, that in # whole or in part contains or is derived from the Program or any # part thereof, to be licensed as a whole at no charge to all third # parties under the terms of this License. # # c) If the modified program normally reads commands interactively # when run, you must cause it, when started running for such # interactive use in the most ordinary way, to print or display an # announcement including an appropriate copyright notice and a # notice that there is no warranty (or else, saying that you provide # a warranty) and that users may redistribute the program under # these conditions, and telling the user how to view a copy of this # License. (Exception: if the Program itself is interactive but # does not normally print such an announcement, your work based on # the Program is not required to print an announcement.) # # These requirements apply to the modified work as a whole. If # identifiable sections of that work are not derived from the Program, # and can be reasonably considered independent and separate works in # themselves, then this License, and its terms, do not apply to those # sections when you distribute them as separate works. But when you # distribute the same sections as part of a whole which is a work based # on the Program, the distribution of the whole must be on the terms of # this License, whose permissions for other licensees extend to the # entire whole, and thus to each and every part regardless of who wrote it. # # Thus, it is not the intent of this section to claim rights or contest # your rights to work written entirely by you; rather, the intent is to # exercise the right to control the distribution of derivative or # collective works based on the Program. # # In addition, mere aggregation of another work not based on the Program # with the Program (or with a work based on the Program) on a volume of # a storage or distribution medium does not bring the other work under # the scope of this License. # # 3. You may copy and distribute the Program (or a work based on it, # under Section 2) in object code or executable form under the terms of # Sections 1 and 2 above provided that you also do one of the following: # # a) Accompany it with the complete corresponding machine-readable # source code, which must be distributed under the terms of Sections # 1 and 2 above on a medium customarily used for software interchange; or, # # b) Accompany it with a written offer, valid for at least three # years, to give any third party, for a charge no more than your # cost of physically performing source distribution, a complete # machine-readable copy of the corresponding source code, to be # distributed under the terms of Sections 1 and 2 above on a medium # customarily used for software interchange; or, # # c) Accompany it with the information you received as to the offer # to distribute corresponding source code. (This alternative is # allowed only for noncommercial distribution and only if you # received the program in object code or executable form with such # an offer, in accord with Subsection b above.) # # The source code for a work means the preferred form of the work for # making modifications to it. For an executable work, complete source # code means all the source code for all modules it contains, plus any # associated interface definition files, plus the scripts used to # control compilation and installation of the executable. However, as a # special exception, the source code distributed need not include # anything that is normally distributed (in either source or binary # form) with the major components (compiler, kernel, and so on) of the # operating system on which the executable runs, unless that component # itself accompanies the executable. # # If distribution of executable or object code is made by offering # access to copy from a designated place, then offering equivalent # access to copy the source code from the same place counts as # distribution of the source code, even though third parties are not # compelled to copy the source along with the object code. # # 4. You may not copy, modify, sublicense, or distribute the Program # except as expressly provided under this License. Any attempt # otherwise to copy, modify, sublicense or distribute the Program is # void, and will automatically terminate your rights under this License. # However, parties who have received copies, or rights, from you under # this License will not have their licenses terminated so long as such # parties remain in full compliance. # # 5. You are not required to accept this License, since you have not # signed it. However, nothing else grants you permission to modify or # distribute the Program or its derivative works. These actions are # prohibited by law if you do not accept this License. Therefore, by # modifying or distributing the Program (or any work based on the # Program), you indicate your acceptance of this License to do so, and # all its terms and conditions for copying, distributing or modifying # the Program or works based on it. # 6. Each time you redistribute the Program (or any work based on the # Program), the recipient automatically receives a license from the # original licensor to copy, distribute or modify the Program subject to # these terms and conditions. You may not impose any further # restrictions on the recipients' exercise of the rights granted herein. # You are not responsible for enforcing compliance by third parties to # this License. # # 7. If, as a consequence of a court judgment or allegation of patent # infringement or for any other reason (not limited to patent issues), # conditions are imposed on you (whether by court order, agreement or # otherwise) that contradict the conditions of this License, they do not # excuse you from the conditions of this License. If you cannot # distribute so as to satisfy simultaneously your obligations under this # License and any other pertinent obligations, then as a consequence you # may not distribute the Program at all. For example, if a patent # license would not permit royalty-free redistribution of the Program by # all those who receive copies directly or indirectly through you, then # the only way you could satisfy both it and this License would be to # refrain entirely from distribution of the Program. # # If any portion of this section is held invalid or unenforceable under # any particular circumstance, the balance of the section is intended to # apply and the section as a whole is intended to apply in other # circumstances. # # It is not the purpose of this section to induce you to infringe any # patents or other property right claims or to contest validity of any # such claims; this section has the sole purpose of protecting the # integrity of the free software distribution system, which is # implemented by public license practices. Many people have made # generous contributions to the wide range of software distributed # through that system in reliance on consistent application of that # system; it is up to the author/donor to decide if he or she is willing # to distribute software through any other system and a licensee cannot # impose that choice. # # This section is intended to make thoroughly clear what is believed to # be a consequence of the rest of this License. # # 8. If the distribution and/or use of the Program is restricted in # certain countries either by patents or by copyrighted interfaces, the # original copyright holder who places the Program under this License # may add an explicit geographical distribution limitation excluding # those countries, so that distribution is permitted only in or among # countries not thus excluded. In such case, this License incorporates # the limitation as if written in the body of this License. # # 9. The Free Software Foundation may publish revised and/or new versions # of the General Public License from time to time. Such new versions will # be similar in spirit to the present version, but may differ in detail to # address new problems or concerns. # # Each version is given a distinguishing version number. If the Program # specifies a version number of this License which applies to it and "any # later version", you have the option of following the terms and conditions # either of that version or of any later version published by the Free # Software Foundation. If the Program does not specify a version number of # this License, you may choose any version ever published by the Free Software # Foundation. # # 10. If you wish to incorporate parts of the Program into other free # programs whose distribution conditions are different, write to the author # to ask for permission. For software which is copyrighted by the Free # Software Foundation, write to the Free Software Foundation; we sometimes # make exceptions for this. Our decision will be guided by the two goals # of preserving the free status of all derivatives of our free software and # of promoting the sharing and reuse of software generally. # # NO WARRANTY # # 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY # FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN # OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES # PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED # OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS # TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE # PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, # REPAIR OR CORRECTION. # # 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING # WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR # REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, # INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING # OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED # TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY # YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER # PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE # POSSIBILITY OF SUCH DAMAGES. # # END OF TERMS AND CONDITIONS # # How to Apply These Terms to Your New Programs # # If you develop a new program, and you want it to be of the greatest # possible use to the public, the best way to achieve this is to make it # free software which everyone can redistribute and change under these terms. # # To do so, attach the following notices to the program. It is safest # to attach them to the start of each source file to most effectively # convey the exclusion of warranty; and each file should have at least # the "copyright" line and a pointer to where the full notice is found. # # <one line to give the program's name and a brief idea of what it does.> # Copyright (C) <year> <name of author> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # Also add information on how to contact you by electronic and paper mail. # # If the program is interactive, make it output a short notice like this # when it starts in an interactive mode: # # Gnomovision version 69, Copyright (C) year name of author # Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. # This is free software, and you are welcome to redistribute it # under certain conditions; type `show c' for details. # # The hypothetical commands `show w' and `show c' should show the appropriate # parts of the General Public License. Of course, the commands you use may # be called something other than `show w' and `show c'; they could even be # mouse-clicks or menu items--whatever suits your program. # # You should also get your employer (if you work as a programmer) or your # school, if any, to sign a "copyright disclaimer" for the program, if # necessary. Here is a sample; alter the names: # # Yoyodyne, Inc., hereby disclaims all copyright interest in the program # `Gnomovision' (which makes passes at compilers) written by James Hacker. # # <signature of Ty Coon>, 1 April 1989 # Ty Coon, President of Vice # # This General Public License does not permit incorporating your program into # proprietary programs. If your program is a subroutine library, you may # consider it more useful to permit linking proprietary applications with the # library. If this is what you want to do, use the GNU Library General # Public License instead of this License. # ########## End of GNU General Public License (GPL), version 2 ########## ## ----------------------- ## ## 1. Language selection. ## ## ----------------------- ## # ------------------------------ # # 1d. The Objective C language. # # ------------------------------ # # AC_LANG(Objective C) # -------------------- # OBJCFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. m4_define([AC_LANG(Objective C)], [ac_ext=m ac_cpp='$OBJCPP $CPPFLAGS' ac_compile='$OBJC -c $OBJCFLAGS $CPPFLAGS conftest.$ac_ext >&AS_MESSAGE_LOG_FD' ac_link='$OBJC -o conftest$ac_exeext $OBJCFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&AS_MESSAGE_LOG_FD' ac_compiler_gnu=$ac_cv_objc_compiler_gnu ]) # AC_LANG_OBJC # ------------------------- AU_DEFUN([AC_LANG_OBJC], [AC_LANG(Objective C)]) # _AC_LANG_ABBREV(Objective C) # ---------------------------- m4_define([_AC_LANG_ABBREV(Objective C)], [objc]) # _AC_LANG_PREFIX(Objective C) # ---------------------------- m4_define([_AC_LANG_PREFIX(Objective C)], [OBJC]) ## ---------------------- ## ## 2.Producing programs. ## ## ---------------------- ## # ------------------------- # # 2d. Objective C sources. # # ------------------------- # # AC_LANG_SOURCE(Objective C)(BODY) # --------------------------------- m4_copy([AC_LANG_SOURCE(C)], [AC_LANG_SOURCE(Objective C)]) # AC_LANG_PROGRAM(Objective C)([PROLOGUE], [BODY]) # ------------------------------------------------ m4_copy([AC_LANG_PROGRAM(C)], [AC_LANG_PROGRAM(Objective C)]) # AC_LANG_CALL(Objective C)(PROLOGUE, FUNCTION) # --------------------------------------------- m4_copy([AC_LANG_CALL(C)], [AC_LANG_CALL(Objective C)]) # AC_LANG_FUNC_LINK_TRY(Objective C)(FUNCTION) # -------------------------------------------- m4_copy([AC_LANG_FUNC_LINK_TRY(C)], [AC_LANG_FUNC_LINK_TRY(Objective C)]) # AC_LANG_BOOL_COMPILE_TRY(Objective C)(PROLOGUE, EXPRESSION) # ----------------------------------------------------------- m4_copy([AC_LANG_BOOL_COMPILE_TRY(C)], [AC_LANG_BOOL_COMPILE_TRY(Objective C)]) # AC_LANG_INT_SAVE(Objective C)(PROLOGUE, EXPRESSION) # --------------------------------------------------- m4_copy([AC_LANG_INT_SAVE(C)], [AC_LANG_INT_SAVE(Objective C)]) ## -------------------------------------------- ## ## 3. Looking for Compilers and Preprocessors. ## ## -------------------------------------------- ## # ------------------------------ # # 3d. The Objective C compiler. # # ------------------------------ # # AC_LANG_PREPROC(Objecitve C) # ---------------------------- # Find the Objective C preprocessor. Must be AC_DEFUN'd to be AC_REQUIRE'able. AC_DEFUN([AC_LANG_PREPROC(Objective C)], [AC_REQUIRE([AC_PROG_OBJCPP])]) # AC_PROG_OBJCPP # -------------- # Find a working Objective C preprocessor. # We shouldn't have to require AC_PROG_CC, but this is due to the concurrency # between the AC_LANG_COMPILER_REQUIRE family and that of AC_PROG_OBJC. AC_DEFUN([AC_PROG_OBJCPP], [AC_REQUIRE([AC_PROG_OBJC])dnl AC_ARG_VAR([OBJCPP], [Objective C preprocessor])dnl _AC_ARG_VAR_CPPFLAGS()dnl AC_LANG_PUSH(Objective C)dnl AC_MSG_CHECKING([how to run the Objective C preprocessor]) if test -z "$OBJCPP"; then AC_CACHE_VAL(ac_cv_prog_OBJCPP, [dnl # Double quotes because OBJCPP needs to be expanded for OBJCPP in "$OBJC -E" "/lib/cpp" do _AC_PROG_PREPROC_WORKS_IFELSE([break]) done ac_cv_prog_OBJCPP=$OBJCPP ])dnl OBJCPP=$ac_cv_prog_OBJCPP else ac_cv_prog_OBJCPP=$OBJCPP fi AC_MSG_RESULT([$OBJCPP]) _AC_PROG_PREPROC_WORKS_IFELSE([], [AC_MSG_FAILURE([Objective C preprocessor "$OBJCPP" fails sanity check])]) AC_SUBST(OBJCPP)dnl AC_LANG_POP(Objective C)dnl ])# AC_PROG_OBJCPP # AC_LANG_COMPILER(Objective C) # ----------------------------- # Find the Objective C compiler. Must be AC_DEFUN'd to be AC_REQUIRE'able. AC_DEFUN([AC_LANG_COMPILER(Objective C)], [AC_REQUIRE([AC_PROG_OBJC])]) # ac_cv_prog_objc # --------------- # We used to name the cache variable this way. AU_DEFUN([ac_cv_prog_objc], [ac_cv_objc_compiler_gnu]) # AC_PROG_OBJC([LIST-OF-COMPILERS]) # --------------------------------- # LIST-OF-COMPILERS is a space separated list of Objective C compilers # to search for (if not specified, a default list is used). This just gives # the user an opportunity to specify an alternative search list for the # Objective C compiler. # cc Native compiler # objc David Stes' Portable Object Compiler AN_MAKEVAR([OBJC], [AC_PROG_OBJC]) AN_PROGRAM([gcc], [AC_PROG_OBJC]) AN_PROGRAM([cc], [AC_PROG_OBJC]) AC_DEFUN([AC_PROG_OBJC], [AC_LANG_PUSH(Objective C)dnl AC_ARG_VAR([OBJC], [Objective C compiler command])dnl AC_ARG_VAR([OBJCFLAGS], [Objective C compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl _AC_ARG_VAR_CPPFLAGS()dnl AC_CHECK_TOOLS(OBJC, [$CCC m4_default([$1], [gcc cc objc])], gcc) # Provide some information about the compiler. echo "$as_me:$LINENO:" \ "checking for _AC_LANG compiler version" >&AS_MESSAGE_LOG_FD ac_compiler=`set X $ac_compile; echo $[2]` _AC_EVAL([$ac_compiler --version </dev/null >&AS_MESSAGE_LOG_FD]) _AC_EVAL([$ac_compiler -v </dev/null >&AS_MESSAGE_LOG_FD]) _AC_EVAL([$ac_compiler -V </dev/null >&AS_MESSAGE_LOG_FD]) m4_expand_once([_AC_COMPILER_EXEEXT])[]dnl m4_expand_once([_AC_COMPILER_OBJEXT])[]dnl _AC_LANG_COMPILER_GNU GOBJC=`test $ac_compiler_gnu = yes && echo yes` _AC_PROG_OBJC_G AC_LANG_POP(Objective C)dnl ])# AC_PROG_OBJC # _AC_PROG_OBJC_G # --------------- # Check whether -g works, even if OBJCFLAGS is set, in case the package # plays around with OBJCFLAGS (such as to build both debugging and # normal versions of a library), tasteless as that idea is. m4_define([_AC_PROG_OBJC_G], [ac_test_OBJCFLAGS=${OBJCFLAGS+set} ac_save_OBJCFLAGS=$OBJCFLAGS OBJCFLAGS="-g" AC_CACHE_CHECK(whether $OBJC accepts -g, ac_cv_prog_objc_g, [_AC_COMPILE_IFELSE([AC_LANG_PROGRAM()], [ac_cv_prog_objc_g=yes], [ac_cv_prog_objc_g=no])]) if test "$ac_test_OBJCFLAGS" = set; then OBJCFLAGS=$ac_save_OBJCFLAGS elif test $ac_cv_prog_objc_g = yes; then if test "$GOBJC" = yes; then OBJCFLAGS="-g -O2" else OBJCFLAGS="-g" fi else if test "$GOBJC" = yes; then OBJCFLAGS="-O2" else OBJCFLAGS= fi fi[]dnl ])# _AC_PROG_OBJC_G ## ------------------------------- ## ## 4. Compilers' characteristics. ## ## ------------------------------- ## # -------------------------------- # # 4b. C compiler characteristics. # # -------------------------------- # # libobjc and objc header tests shere? --- NEW FILE: Makefile.am --- # foo/elkfoo/m4/Makefile.am # 2004 rumori # $Id: Makefile.am,v 1.1 2004/08/04 07:14:37 rumori Exp $ NULL = EXTRA_DIST = \ objc.m4 \ objc-runtime.m4 \ $(NULL) --- NEW FILE: objc-runtime.m4 --- #------------------------------------------------------------------------ # OD_OBJC_RUNTIME -- # # Determine the default, working Objective C runtime # # Arguments: # None. # # Requires: # none # # Depends: # AC_PROG_OBJC from objc.m4 # # Results: # # Adds a --with-objc-runtime switch to configure. # Result is cached. # # Defines one of the following preprocessor macros: # NeXT_RUNTIME GNU_RUNTIME #------------------------------------------------------------------------ AC_DEFUN([OD_OBJC_RUNTIME],[ AC_REQUIRE([AC_PROG_OBJC]) AC_ARG_WITH(objc-runtime, [ --with-objc-runtime Specify either "GNU" or "NeXT"], [with_objc_runtime=${withval}]) if test x"${with_objc_runtime}" != x; then case "${with_objc_runtime}" in GNU) ;; NeXT) ;; *) AC_MSG_ERROR([${with_objc_runtime} is not a valid argument to --with-objc-runtime. Please specify either "GNU" or "NeXT"]) ;; esac fi AC_LANG_PUSH([Objective C]) # Check for common header, objc/objc.h AC_CHECK_HEADERS([objc/objc.h], ,[AC_MSG_ERROR([Can't locate Objective C runtime headers])]) # Add -lobjc. The following tests will ensure that the library exists and functions with the detected Objective C compiler # If the tests fail, AC_MSG_FAILURE is called, and $LIBS does not need to be restored LIBS="${LIBS} -lobjc" if test x"${with_objc_runtime}" == x || test x"${with_objc_runtime}" == x"NeXT"; then AC_MSG_CHECKING([for NeXT Objective C runtime]) AC_CACHE_VAL(ac_cv_objc_runtime_next, [ # The following uses quadrigraphs # '@<:@' = '[' # '@:>@' = ']' AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include <objc/objc.h> #include <objc/objc-api.h> ], [ id class = objc_lookUpClass("Object"); id obj = @<:@class alloc@:>@; puts(@<:@obj name@:>@); ]) ], [ ac_cv_objc_runtime_next="yes" ], [ ac_cv_objc_runtime_next="no" ] ) ]) AC_MSG_RESULT(${ac_cv_objc_runtime_next}) else ac_cv_objc_runtime_next="no" fi if test x"${with_objc_runtime}" == x || test x"${with_objc_runtime}" == x"GNU"; then AC_MSG_CHECKING([for GNU Objective C runtime]) AC_CACHE_VAL(ac_cv_objc_runtime_gnu, [ # The following uses quadrigraphs # '@<:@' = '[' # '@:>@' = ']' AC_LINK_IFELSE([ AC_LANG_PROGRAM([ #include <objc/objc.h> #include <objc/objc-api.h> ], [ id class = objc_lookup_class("Object"); id obj = @<:@class alloc@:>@; puts(@<:@obj name@:>@); ]) ], [ ac_cv_objc_runtime_gnu="yes" ], [ ac_cv_objc_runtime_gnu="no" ] ) ]) AC_MSG_RESULT(${ac_cv_objc_runtime_gnu}) else ac_cv_objc_runtime_gnu="no" fi # NeXT runtime is prefered if test x"${ac_cv_objc_runtime_next}" == x"yes"; then OBJC_RUNTIME="NeXT" OBJC_RUNTIME_FLAGS="-fnext-runtime" AC_MSG_NOTICE([Using NeXT Objective C runtime]) AC_DEFINE([NeXT_RUNTIME], 1, [Define if using the NeXT Objective C runtime and compiler.]) elif test x"${ac_cv_objc_runtime_gnu}" == x"yes"; then OBJC_RUNTIME="GNU" OBJC_RUNTIME_FLAGS="-fgnu-runtime" AC_MSG_NOTICE([Using GNU Objective C runtime]) AC_DEFINE([GNU_RUNTIME], 1, [Define if using the GNU Objective C runtime and compiler.]) else AC_MSG_FAILURE([Could not locate a working Objective C runtime.]) fi AC_LANG_POP([Objective C]) ]) |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:14:13
|
Update of /cvsroot/foo/foo/elkfoo/m4 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31710/m4 Log Message: Directory /cvsroot/foo/foo/elkfoo/m4 added to the repository |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:13:58
|
Update of /cvsroot/foo/foo/elkfoo/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31641 Added Files: Makefile.am Log Message: initial checkin. WARNING: not yet working --- NEW FILE: Makefile.am --- # foo/elkfoo/autotools/Makefile.am # 2004 rumori # $Id: Makefile.am,v 1.1 2004/08/04 07:13:50 rumori Exp $ |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:13:36
|
Update of /cvsroot/foo/foo/elkfoo/autotools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31596/autotools Log Message: Directory /cvsroot/foo/foo/elkfoo/autotools added to the repository |
|
From: Martin R. <ru...@us...> - 2004-08-04 07:13:18
|
Update of /cvsroot/foo/foo/elkfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31551 Added Files: AUTHORS COPYING ChangeLog Makefile.am NEWS README acinclude.m4 bootstrap configure.ac Log Message: initial checkin. WARNING: not yet working --- NEW FILE: acinclude.m4 --- # acinclude.m4 # 2004 rumori # $Id: acinclude.m4,v 1.1 2004/08/04 07:13:08 rumori Exp $ builtin(include,m4/objc.m4) builtin(include,m4/objc-runtime.m4) --- NEW FILE: configure.ac --- # configure.ac for elkfoo # Process this file with autoconf to produce a configure script. # # 2004 martin rumori # $Id: configure.ac,v 1.1 2004/08/04 07:13:08 rumori Exp $ AC_INIT(elkfoo,0.1.0pre1,foo...@li...) AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/main.c]) AC_CONFIG_AUX_DIR(autotools) AC_CANONICAL_TARGET([]) AM_INIT_AUTOMAKE($PACKAGE_NAME,$PACKAGE_VERSION) AM_CONFIG_HEADER(src/config.h) AC_CHECK_PROG(autogen, autogen, yes, no) # Find the compiler AC_PROG_CC AC_PROG_CPP AC_PROG_OBJC AC_PROG_OBJCPP AC_PROG_LIBTOOL # objc workaround due to missing objc support in autoconf _AM_DEPENDENCIES([OBJC]) # Check whether we are doing a native build AM_CONDITIONAL(NATIVE_BUILD, test "${cross_compiling}" = "no") # Check for ObjC-runtime OD_OBJC_RUNTIME # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T # Checks for header files. AC_STDC_HEADERS AC_HEADER_SYS_WAIT AC_CHECK_HEADERS([limits.h stdlib.h string.h strings.h sys/param.h sys/timeb.h unistd.h signal.h]) # Checks for library functions. AC_FUNC_FORK AC_FUNC_MALLOC AC_FUNC_REALLOC AC_TYPE_SIGNAL AC_FUNC_STAT AC_CHECK_FUNCS([bzero ftime getcwd memset mkdir pow rint rmdir sqrt strdup sigaction]) # check for foundation library to use # os dependent check case "${target_os}" in *darwin*) AC_DEFINE(SYS_DARWIN, 1, Define if the system is Darwin) enable_gnustep=no; ;; *linux*) AC_DEFINE(SYS_LINUX, 1, Define if the system is Linux) enable_gnustep=yes; ;; *) AC_MSG_WARN([Foo was not ported yet to another platform than linux or darwin!]) esac # check for OpenStep compatible foundation use_gnustep_base=no FOO_GNUSTEP_OBJCFLAGS="" FOO_GNUSTEP_LDFLAGS="" if test ${enable_gnustep} = yes; then # check for gnustep AC_MSG_CHECKING([for GNUstep installation]) # check for GNUSTEP_SYSTEM_ROOT if test -z "$GNUSTEP_SYSTEM_ROOT"; then AC_MSG_RESULT([no]) AC_MSG_ERROR([GNUSTEP_SYSTEM_ROOT not defined. Probably you forgot to run the GNUstep initialization script first.]) else AC_MSG_RESULT([yes]) fi # check for base.make in order to obtain compile flags AC_CHECK_FILE([${GNUSTEP_MAKEFILES}/Additional/base.make], [use_gnustep_base=yes], [AC_MSG_ERROR(gnustep-base package not found)]) # target specific stuff case "$target_os" in freebsd* | openbsd* ) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib";; netbsd*) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" LDFLAGS="$LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; esac use_foundation="GNUstep" AC_DEFINE(FOO_GNUSTEP, 1, Define if we are using GNUstep) FOO_GNUSTEP_OBJCFLAGS="\$(GNUSTEP_HEADERS_FLAGS) \$(AUXILIARY_OBJCFLAGS)" FOO_GNUSTEP_LDFLAGS="\$(GNUSTEP_LIBRARIES_FLAGS)" else # set flags for cocoa framework ELKFOO_LIBS="${ELKFOO_LIBS} -framework Cocoa" use_foundation="Cocoa" AC_DEFINE(FOO_COCOA, 1, Define if we are using Cocoa) fi AM_CONDITIONAL(USE_GNUSTEP_BASE, test "$use_gnustep_base" = yes) # check for libelk AC_ARG_WITH(elk_library, AC_HELP_STRING([--with-elk-library=DIR], [elk scheme library file DIR]), , with_elk_library=) AC_ARG_WITH(elk_include, AC_HELP_STRING([--with-elk-include=DIR], [elk scheme include files DIR]), , with_elk_include=) if test -n "${with_elk_library}"; then with_elk_library="-L${with_elk_library}" fi if test -n "${with_elk_include}"; then with_elk_include="-I${with_elk_include}" fi CPPFLAGS="${CPPFLAGS} ${with_elk_include}" LDFLAGS="${LDFLAGS} ${with_elk_library}" AC_CHECK_HEADERS(fooelk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([fooelk], [Elk_Init]) if test "${ac_cv_lib_fooelk_Elk_Init}" = yes; then INCLUDES="${INCLUDES} ${with_elk_include}" ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lfooelk" ELK_LIBRARY="fooelk" else have_elk=no fi fi if test "${have_elk}" = no; then AC_CHECK_HEADERS(elk/scheme.h, have_elk=yes, have_elk=no) if test "${have_elk}" = yes; then AC_CHECK_LIB([elk], [Elk_Init]) if test "${ac_cv_lib_elk_Elk_Init}" = yes; then INCLUDES="${INCLUDES} ${with_elk_include}" ELKFOO_LIBS="${ELKFOO_LIBS} ${with_elk_library} -lelk" ELK_LIBRARY="elk" else have_elk=no fi fi fi if test "${have_elk}" = no; then AC_MSG_WARN(Cannot find elk scheme header and/or library) echo "* elkfoo requires the elk scheme interpreter" echo "* Use --with-elk-library to specify the elk library" echo "* Use --with-elk-include to specify the elk header" echo "* directories if they are not in the usual place(s)" AC_MSG_ERROR([elkfoo will not compile without elk]) fi # include dir INCLUDES="${INCLUDES} -I\$(top_srcdir)/include -I\$(top_builddir)/include" AC_SUBST(INCLUDES) # workaround for automake <= 1.6 AC_SUBST(OBJC) # Export variables AC_SUBST(ELKFOO_CFLAGS) AC_SUBST(ELKFOO_OBJCFLAGS) AC_SUBST(ELKFOO_LDFLAGS) AC_SUBST(ELKFOO_LIBS) AC_SUBST(GNUSTEP_MAKEFILES) AC_SUBST(FOO_GNUSTEP_OBJCFLAGS) AC_SUBST(FOO_GNUSTEP_LDFLAGS) AC_OUTPUT([ Makefile autotools/Makefile m4/Makefile include/Makefile src/Makefile ]) cat << EOF elkfoo configuration summary ---------------------------- elkfoo version: ${VERSION} elk library used: ${ELK_LIBRARY} objective-c runtime: ${OBJC_RUNTIME} foundation framework: ${use_foundation} EOF # EOF --- NEW FILE: Makefile.am --- # foo/elkfoo/Makefile.am # 2004 rumori # $Id: Makefile.am,v 1.1 2004/08/04 07:13:08 rumori Exp $ NULL = SUBDIRS = include src # scm DIST_SUBDIRS = $(SUBDIRS) autotools m4 EXTRA_DIST = \ bootstrap \ AUTHORS \ COPYING \ ChangeLog \ NEWS \ README \ $(NULL) --- NEW FILE: COPYING --- GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. <one line to give the library's name and a brief idea of what it does.> Copyright (C) <year> <name of author> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. <signature of Ty Coon>, 1 April 1990 Ty Coon, President of Vice That's all there is to it! --- NEW FILE: ChangeLog --- $Id: ChangeLog,v 1.1 2004/08/04 07:13:08 rumori Exp $ 2004-07-29 rumori - autotools build system for ng foo --- NEW FILE: README --- $Id: README,v 1.1 2004/08/04 07:13:08 rumori Exp $ foo sound synthesis readme -------------------------- last edited 2004-07-29 rumori this readme contains information about the requirements, installation and yet undocumented features of foo. requirements ------------ - libsndfile >= 1.0.10 (!) IMPORTANT: libsndfile prior to 1.0.10 has severe bugs in AIFF | FLOAT file support (which could be used for incremental mixing in foo) and in soundfile read/write mode, which is heavily used in foo. the version of libsndfile coming with your distribution might be an older one and therefore *TOO OLD*. - pkgconfig (for detection of libsndfile) - fooelk >= 0.0.3 or recent "ordinary" elk (however, toplevel.foo relies on the readline-patch in elk, but there is the --no-rl option now) - gnustep-make, gnustep-base installation ------------ compiling from cvs ------------------ if you checked out from cvs, call ./bootstrap you'll need autoconf >= 2.50 to build the configure script. after that, you can continue like compiling from a release tarball. compiling from release tarball ------------------------------ ./configure as usual, you may set the install-prefix/paths with ./configure --prefix=/usr/local/anywhere etc. configure looks for an installation of fooelk first, after that it tries to find an "ordinary" elk installation. if elk is not found, foo refuses to build. you may specify the location of elk/fooelk with ./configure --with-elk-include=/path/to/elk/headers \ --with-elk-library=/path/to/elk/lib make make install should build and install foo. depending on the target directory, you may have to call 'make install' as root. configure should set the install paths to toplevel.scm and to the binary foo, so that you should be able to run the binary 'foo' from everywhere. depending on your installation, you might add the path to libsndfile and libfooelk/libelk to LD_LIBRARY_PATH: export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/path/to/libs (sh-compatible shell) yet undocumented (new) features ------------------------------- while porting and developing foo it's undergoing several changes, which can't be documented right now: scripting foo via the #! directive ---------------------------------- *** DOCUMENT_ME *** for a simple example, see Examples/scripts/sine.foo user-accessible play command ---------------------------- the variable 'foo-default-play-command' may contain the play command being used with (play) along with additional initial arguments: (set! foo-default-play-command "alsaplayer -q -i text") customization with foo files ---------------------------- historically foo tries to evaluate the files '~/.initfoo' and './.initfoo' (in this order) on startup. these files may contain normal foo code to customize the behavior of foo. from foo-0.0.4 on, the following files are evaluated for customization: /etc/foo/init.foo (system wide settings) ~/.foo/init.foo (user's settings) ./.init.foo (working dir settings) backwards compatability to the behavior of foo-2.1 is still retained. it should not be used for new projects. start option to disable readline support ---------------------------------------- if foo is started with the '--no-rl'-option, a different toplevel file will be used which doesn't rely on fooelk's readline extension. as a side effect, the symbol completer is disabled, too, which avoids problems which sourcecode containing tabs at stdin (script or in emacs' inferior mode). fractional tone custom reader ----------------------------- the foo-(NeXT)-2.1-semitone reader is not longer supported. the new syntax for fractional tones is: #s1 ; half tone 1.05946309435929530984310531494 #s12 ; twelve half tones = 1 octave 2 #s1/2 ; half half tone = 1 quarter tone 1.029302236643492074463779317739 #q1 ; quarter tone 1.029302236643492074463779317739 libsndfile support (since foo-0.0.2) ------------------------------------ foo can read and write every sound format supported by libsndfile. in constrast to the foo-2.1-(NeXT)-documentation, the following functions/macros where adopted to reflect this feature: (make-soundfile "name" fileformat channels samplingrate . filetype) (create-soundfile "name" fileformat channels samplingrate . filetype) (synt channels duration samplingrate "name" fileformat filetype) where filetype is one of: 'wav 'aiff 'snd 'paf 'svx 'nist 'voc 'ircam 'wav64 'mat4 'mat5 'pvf 'xi note: there is no special 'au type, but 'snd is the same format (Sun/NeXT). the default filetype is 'aiff. --- NEW FILE: NEWS --- ------------------------------------------------------------------------ foo-0.0.7 ------------------------------------------------------------------------ * fixed lvalue cast warning in fof.m * reenabled (edit) function in kernel.foo (default editor is specified in foo-default-edit-command) ------------------------------------------------------------------------ foo-0.0.6 ------------------------------------------------------------------------ * added some examples to Examples/script * started to add examples from KernelReference to Examples/kernel * removed banner printed on startup * added (about) function to print banner * added (version) function to get a list of (major minor subminor) version numbers * nearly rewrote SoundFile.m again (oh well) * discovered some bugs in libsndfile * changed to libsndfile 1.0.10 as minimum requirement * fixed prompt displaying issue in non-readline mode * BandlimittedNoise: added random seed to archiving methods * disabled SoundFile flushing from within Context (SoundFile's responsability) * caught probably long-term bug in task.m related to <offset> parameter in (make-task) ------------------------------------------------------------------------ foo-0.0.5 ------------------------------------------------------------------------ * reimplemented SoundFile caching * reintroduced scripting support * added Examples directory and a simple sine wave scripting example ------------------------------------------------------------------------ foo-0.0.4 ------------------------------------------------------------------------ * fixed bug in ./bootstrap (INSTALL removal) * include GSConfig.h for support of GNUStep fakemain hack on some systems * added --no-rl option and toplevel-no-rl.foo for non-readline operation * read user defaults now from (in this order): - /etc/foo/init.foo - ~/.foo/init.foo - ./.init.foo (retained backwards compatability for ~/.initfoo and ./.initfoo) * added user-accessible (foo-default-play-command) ------------------------------------------------------------------------ foo-0.0.3 ------------------------------------------------------------------------ * adopted to fooelk-0.0.2 * switch on case-sensitive mode of elk (off by default now in elk) * added custom reader for fractional tones (replaces old semitone reader from customized elk) * readline reader extension/readrationals now in fooelk-0.0.2 * restructured source tree * reviewed gnustep-make support * introduced autoconf to guess/set location of fooelk/elk and foo * replaced foo.sh startup script by foo binary ------------------------------------------------------------------------ foo-0.0.2 ------------------------------------------------------------------------ * libsndfile support for creating/writing of soundfiles * license changed to LGPL * minor bugfixes ------------------------------------------------------------------------ foo-0.0.1 ------------------------------------------------------------------------ this is the first port of foo to linux. it is mostly compatible to foo-2.1 for NeXTStep\x{00AE}. * no (play~) support * no support for writing/reading comments in soundfiles * some obvious performance lacks due to unclean implementation * libsndfile support for reading files --- NEW FILE: bootstrap --- #! /bin/sh ## bootstrap file for libfoo # 2004 martin rumori (fo...@ru...) ## $Id: bootstrap,v 1.1 2004/08/04 07:13:08 rumori Exp $ # Get a sane environment, just in case LANG=C export LANG # Check for automake if test -z $1; then amvers="no" # if automake-1.8 --version >/dev/null 2>&1; then # amvers="-1.8" # elif automake-1.7 --version >/dev/null 2>&1; then if automake-1.7 --version >/dev/null 2>&1; then amvers="-1.7" elif automake-1.6 --version >/dev/null 2>&1; then amvers="-1.6" elif automake-1.5 --version >/dev/null 2>&1; then amvers="-1.5" elif automake --version > /dev/null 2>&1; then amvers="`automake --version | sed -e '1s/[^0-9]*//' -e q`" if expr "$amvers" "<" "1.5" > /dev/null 2>&1; then amvers="no" else amvers="" fi fi if test "$amvers" = "no"; then set +x echo "$0: you need automake version 1.5 or later" exit 1 fi else amvers=$1 fi set -x set -e # Check for libtool libtoolize="no" if libtoolize --version >/dev/null 2>&1; then libtoolize="libtoolize" elif glibtoolize --version >/dev/null 2>&1; then libtoolize="glibtoolize" fi if test "$libtoolize" = "no"; then set +x echo "$0: you need libtool" exit 1 fi # Remove old cruft rm -f aclocal.m4 configure config.guess config.log config.sub config.cache config.h.in config.h compile ltmain.sh libtool ltconfig missing mkinstalldirs depcomp install-sh INSTALL rm -Rf autom4te.cache (cd autotools && rm -f config.guess config.sub missing mkinstalldirs compile ltmain.sh depcomp install-sh) aclocal${amvers} ${libtoolize} --copy --force if test -f "ltmain.sh"; then echo "$0: working around a minor libtool issue" mv ltmain.sh autotools/ fi autoconf autoheader automake${amvers} --add-missing --copy --- NEW FILE: AUTHORS --- $Id: AUTHORS,v 1.1 2004/08/04 07:13:08 rumori Exp $ (C) 1993-2004 gerhard eckel, ramon gonzalez-arroyo, ircam, zkm (C) 2003-2004 martin rumori |
|
From: Martin R. <ru...@us...> - 2004-08-04 06:44:27
|
Update of /cvsroot/foo/foo/libfoo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27601 Modified Files: configure.ac Log Message: minor changes Index: configure.ac =================================================================== RCS file: /cvsroot/foo/foo/libfoo/configure.ac,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** configure.ac 4 Aug 2004 05:23:02 -0000 1.10 --- configure.ac 4 Aug 2004 06:44:19 -0000 1.11 *************** *** 8,12 **** AC_INIT(libfoo,0.1.0pre1,foo...@li...) ! AC_PREREQ(2.53) AC_CONFIG_SRCDIR([src/FOOObject.m]) AC_CONFIG_AUX_DIR(autotools) --- 8,12 ---- AC_INIT(libfoo,0.1.0pre1,foo...@li...) ! AC_PREREQ(2.57) AC_CONFIG_SRCDIR([src/FOOObject.m]) AC_CONFIG_AUX_DIR(autotools) *************** *** 157,161 **** FOO_LIBS="${FOO_LIBS} ${SNDFILE_LIBS}" ! INCLUDES="${INCLUDES} -I\$(top_srcdir)/FOO -I\$(top_builddir)/FOO" AC_SUBST(INCLUDES) --- 157,161 ---- FOO_LIBS="${FOO_LIBS} ${SNDFILE_LIBS}" ! INCLUDES="${INCLUDES} -I\$(top_srcdir) -I\$(top_builddir)" AC_SUBST(INCLUDES) |
|
From: Martin R. <ru...@us...> - 2004-08-04 06:44:03
|
Update of /cvsroot/foo/foo/libfoo/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27520 Modified Files: FOOGlobalsManager.m Log Message: added +getVersion Index: FOOGlobalsManager.m =================================================================== RCS file: /cvsroot/foo/foo/libfoo/src/FOOGlobalsManager.m,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** FOOGlobalsManager.m 4 Aug 2004 06:16:41 -0000 1.2 --- FOOGlobalsManager.m 4 Aug 2004 06:43:55 -0000 1.3 *************** *** 35,38 **** --- 35,42 ---- /* $Id$ */ + #ifdef HAVE_CONFIG_H + #include "config.h" + #endif + #include <math.h> #include <stdio.h> *************** *** 90,93 **** --- 94,107 ---- + + (NSString *) getVersion + { + #ifdef VERSION + return @VERSION; + #elif + return @"unknown"; + #endif + } + + + (BOOL) trace { |