Jun Inoue
jun.l****@gmail*****
2005年 9月 1日 (木) 06:03:50 JST
On Thu, 1 Sep 2005 05:16:57 +0900 Kazuki Ohta <mover****@hct*****> wrote: > 太田です。 > > またまたパッチ、有難う御座います。ただ、operations-srfi38.cが抜けている模様 > なので、もう一度確認してもらえまでしょうか? あ、すいません。shadow directory で作業してるのを忘れてました。 ;; ほとんど Scm_write() のコピペですけどね。 -- Jun Inoue jun.l****@gmail***** -------------- next part -------------- --- sigscheme/operations-srfi38.c 1969-12-31 16:00:00.000000000 -0800 +++ ../r5rs/sigscheme/operations-srfi38.c 2005-08-31 02:22:13.000000000 -0700 @@ -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; +}