Update of /cvsroot/foo/foo/elkfoo/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19529/src
Modified Files:
context.m task.m
Log Message:
adopted to new archiving interface in libfoo
Index: task.m
===================================================================
RCS file: /cvsroot/foo/foo/elkfoo/src/task.m,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** task.m 13 Aug 2004 21:34:39 -0000 1.4
--- task.m 15 Aug 2004 20:30:48 -0000 1.5
***************
*** 280,295 ****
fclose(fp);
sprintf(buffer, "%s/mix%04dc", dir, count);
! if ((fp = fopen(buffer, "w+")) == NULL)
! {
! Primitive_Error("cannot create ~a",
! Make_String(buffer, strlen(buffer)));
! }
! if (Write_Context(fp, CONTEXT_T(TASK_T(task)->context)->pointer) != 1)
{
! fclose(fp);
Primitive_Error("cannot write context to ~a",
Make_String(buffer, strlen(buffer)));
}
! fclose(fp);
sprintf(buffer, "%s/mixcount", dir);
if ((fp = fopen(buffer, "w+")) == NULL)
--- 280,296 ----
fclose(fp);
sprintf(buffer, "%s/mix%04dc", dir, count);
! // if ((fp = fopen(buffer, "w+")) == NULL)
! // {
! // Primitive_Error("cannot create ~a",
! // Make_String(buffer, strlen(buffer)));
! // }
! // if (Write_Context(fp, CONTEXT_T(TASK_T(task)->context)->pointer, NO) != 1)
! if (Write_Context(buffer, CONTEXT_T(TASK_T(task)->context)->pointer, NO) != 1)
{
! // fclose(fp);
Primitive_Error("cannot write context to ~a",
Make_String(buffer, strlen(buffer)));
}
! // fclose(fp);
sprintf(buffer, "%s/mixcount", dir);
if ((fp = fopen(buffer, "w+")) == NULL)
Index: context.m
===================================================================
RCS file: /cvsroot/foo/foo/elkfoo/src/context.m,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** context.m 14 Aug 2004 06:13:35 -0000 1.8
--- context.m 15 Aug 2004 20:30:48 -0000 1.9
***************
*** 267,271 ****
int
Write_Context (const char *path,
! FOOContext *context)
{
/* we have to implement the exception handler here macros are
--- 267,272 ----
int
Write_Context (const char *path,
! FOOContext *context,
! BOOL xml)
{
/* we have to implement the exception handler here macros are
***************
*** 275,279 ****
// NS_DURING
! [context archiveToFile: [NSString stringWithCString: path]];
// NS_HANDLER
// yet to implement
--- 276,280 ----
// NS_DURING
! [context archiveToFile: [NSString stringWithCString: path] xmlFormat: xml];
// NS_HANDLER
// yet to implement
***************
*** 290,293 ****
--- 291,295 ----
SchemeObject context = argv[0], port = Null;
const char *path;
+ BOOL xml = NO;
Check_Context(context);
***************
*** 323,327 ****
}
! switch (Write_Context(path, CONTEXT_T(context)->pointer))
{
case -1:
--- 325,339 ----
}
! if (argc > 2)
! {
! Check_Type(argv[2], T_Boolean);
!
! if (Truep(argv[2]))
! {
! xml = YES;
! }
! }
!
! switch (Write_Context(path, CONTEXT_T(context)->pointer, xml))
{
case -1:
***************
*** 531,535 ****
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);
--- 543,547 ----
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, 3, VARARGS);
DP(P_Context_Read, "foo:read-context", 0, 1, VARARGS);
DP(P_Context_Copy, "foo:copy-context", 1, 1, EVAL);
|