[uim-commit] r1374 - branches/r5rs/sigscheme

tkng at freedesktop.org tkng at freedesktop.org
Wed Aug 31 17:55:15 PDT 2005


Author: tkng
Date: 2005-08-31 17:55:07 -0700 (Wed, 31 Aug 2005)
New Revision: 1374

Added:
   branches/r5rs/sigscheme/operations-srfi38.c
Log:
* sigscheme/operations-srfi38.c: New file for SRFI-38.


Added: branches/r5rs/sigscheme/operations-srfi38.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi38.c	2005-09-01 00:39:58 UTC (rev 1373)
+++ branches/r5rs/sigscheme/operations-srfi38.c	2005-09-01 00:55:07 UTC (rev 1374)
@@ -0,0 +1,86 @@
+/*===========================================================================
+ *  FileName : operations-srfi38.c
+ *  About    : srfi38 shared structure I/O (currently only write/ss)
+ *
+ *  Copyright (C) 2005      by Jun Inoue
+ *
+ *  All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *  1. Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ *  2. Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ *  3. Neither the name of authors nor the names of its contributors
+ *     may be used to endorse or promote products derived from this software
+ *     without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
+ *  IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ *  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ *  PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
+ *  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ *  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ *  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ *  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ *  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ *  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ *  ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *  =========================================================================*/
+/*=======================================
+  System Include
+=======================================*/
+
+/*=======================================
+  Local Include
+=======================================*/
+#include "sigscheme.h"
+
+/*=======================================
+  File Local Struct Declarations
+=======================================*/
+
+/*=======================================
+  File Local Macro Declarations
+=======================================*/
+
+/*=======================================
+  Variable Declarations
+=======================================*/
+
+/*=======================================
+  File Local Function Declarations
+=======================================*/
+
+/*=======================================
+  Function Implementations
+=======================================*/
+
+/*=============================================================================
+  SRFI38 : External Representation for Data With Shared Structure
+=============================================================================*/
+
+ScmObj ScmOp_SRFI38_write_with_shared_structure(ScmObj arg, ScmObj env)
+{
+    ScmObj obj  = SCM_NULL;
+    ScmObj port = SCM_NULL;
+
+    if CHECK_1_ARG(arg)
+        SigScm_Error("write : invalid parameter\n");
+
+    /* get obj */
+    obj = CAR(arg);
+    arg = CDR(arg);
+
+    /* get port */
+    port = scm_current_output_port;
+    if (!NULLP(arg) && !NULLP(CAR(arg)) && PORTP(CAR(arg)))
+        port = CAR(arg);
+
+    SigScm_WriteToPortWithSharedStructure(port, obj);
+    return SCM_UNDEF;
+}



More information about the uim-commit mailing list