File IO module

Instructions manual





OKit: Object Tree, RPL Virtual Machine and compiler shared library

Copyright (C) 2000 Yann LANDRIN-SCHWEITZER


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


Author: Yann LANDRIN-SCHWEITZER
Contact: varkhan@free.fr
Homepage: http://varkhan.free.fr/





USES ErrLog.h





OKit_Objects File-descriptor Printing






Function OKit_ObjectPrint

unsigned long OKit_ObjectPrint(OKit_Object obj, int fd) ;
Prints an OKit_Object into a file descriptor.


Args
_obj:OKit_Object to print
_fd:output file descriptor


Returns
_-1:if some error occurred
else the total number of characters printed


Errors
_EINVAL:if a NULL OKit_Object was passed as argument
or any error generated by the 'write' system call on file descriptor 'fd'



Function OKit_VoidPrint

unsigned long OKit_VoidPrint(OKit_Void vd, int fd) ;


Args
_vd:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_IntgPrint

unsigned long OKit_IntgPrint(OKit_Intg in, int fd) ;


Args
_in:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_FltpPrint

unsigned long OKit_FltpPrint(OKit_Fltp fp, int fd) ;


Args
_fp:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_StrgPrint

unsigned long OKit_StrgPrint(OKit_Strg str, int fd) ;


Args
_str:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_ListPrint

unsigned long OKit_ListPrint(OKit_List lst, int fd) ;


Args
_lst:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_CodePrint

unsigned long OKit_CodePrint(OKit_Code cod, int fd) ;


Args
_cod:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available



Function OKit_BltnPrint

unsigned long OKit_BltnPrint(OKit_Bltn blt, int fd) ;


Args
_blt:
_fd:


Returns
_NULL:if no memory was available


Errors
_EINVAL:if a NULL was passed as argument
_ENOMEM:if no memory was available




OKit_Stack and OKit_NameSpace File-descriptor Printing






Function OKit_StackFPrint

unsigned long OKit_StackFPrint(OKit_Stack stk, int fd, char * head, char * rowfmt, char * tail, unsigned long rows) ;
Prints the contents of a OKit_Stack in a file descriptor, following the given formats.


Args
_stk:OKit_Stack
_fd:file descriptor
_head:head string
_rowfmt:row printing format
_tail:tail string
_rows:number of rows (height in chars)


Returns
_-1:if some error occurred
else the number of characters printed.


Errors
_EINVAL:if a NULL was passed as argument



Function OKit_NameSpaceFPrint

unsigned long OKit_NameSpaceFPrint(OKit_NameSpace nms, int fd, char * head, char * rowfmt, char * tail) ;
Prints the contents of a OKit_NameSpace in a file descriptor, following the given formats.


Args
_nms:OKit_NameSpace
_fd:file descriptor
_head:head string
_rowfmt:row printing format
_tail:tail string
_rows:number of rows (height in chars)


Returns
_-1:if some error occurred
else the number of characters printed.


Errors
_EINVAL:if a NULL was passed as argument