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





Objects File-descriptor Printing






Function ObjectPrint

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


Args
_obj: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 Object was passed as argument
or any error generated by the 'write' system call on file descriptor 'fd'



Function VoidPrint

unsigned long VoidPrint(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 IntgPrint

unsigned long IntgPrint(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 FltpPrint

unsigned long FltpPrint(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 StrgPrint

unsigned long StrgPrint(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 ListPrint

unsigned long ListPrint(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 CodePrint

unsigned long CodePrint(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 BltnPrint

unsigned long BltnPrint(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




Stack and NameSpace File-descriptor Printing






Function StackFPrint

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


Args
_stk: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 NameSpaceFPrint

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


Args
_nms: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