vio.h File Reference

Class Vio: virtual <SDIO/FILE/BUFF/UNIX/INET> I/O layer. More...

#include <maloc/maloc_base.h>
#include <maloc/vnm.h>

Include dependency graph for vio.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sVio
 Contains public data members for Vio class. More...

Defines

#define VPORTNUMBER   14916
 our portbase; 5000 < VPORTNUMBER < 49152
#define VIO_MAXBUF   10
 number of internal buffers (BUFF datatype)

Typedefs

typedef struct sVio Vio
 Declaration of the Vio class as the Vio structure.

Enumerations

enum  VIOtype {
  VIO_NO_TYPE, VIO_SDIO, VIO_BUFF, VIO_FILE,
  VIO_UNIX, VIO_INET
}
 Parameter for I/O type (sdio,buff,file,unix,inet). More...
enum  VIOfrmt { VIO_NO_FRMT, VIO_XDR, VIO_ASC }
 Parameter for compression type (XDR,ASC). More...
enum  VIOrwkey { VIO_NO_RW, VIO_R, VIO_W }
 Parameter for rw type (R,RW). More...

Functions

void Vio_start (void)
 Start Vio communication layer (init internal variables/buffers).
void Vio_stop (void)
 Shutdown Vio communication layer.
VioVio_ctor (const char *socktype, const char *datafrmt, const char *hostname, const char *filename, const char *rwkey)
 Construct the Vio object.
int Vio_ctor2 (Vio *thee, const char *socktype, const char *datafrmt, const char *hostname, const char *filename, const char *rwkey)
 Work routine that Vio_ctor calls to do most of the construction.
void Vio_dtor (Vio **thee)
 Destruct the Vio object.
void Vio_dtor2 (Vio *thee)
 Work routine that Vio_dtor calls to do most of the destruction.
void Vio_setWhiteChars (Vio *thee, char *whiteChars)
 Set the white character set for I/O stream.
void Vio_setCommChars (Vio *thee, char *commChars)
 Set the comment character set for I/O stream.
int Vio_accept (Vio *thee, int nonblock)
 Accept any waiting connect attempt to our socket on our machine.
void Vio_acceptFree (Vio *thee)
 Free the socket child that was used for the last accept.
int Vio_connect (Vio *thee, int nonblock)
 Connect to some socket on a remote machine (or on our machine).
void Vio_connectFree (Vio *thee)
 Purge any output buffers (for <UNIX/INET>, else a no-op).
int Vio_scanf (Vio *thee, char *parms,...)
 Mimic "scanf" from an arbitrary Vio device.
int Vio_printf (Vio *thee, char *parms,...)
 Mimic "printf" from an arbitrary Vio device.
int Vio_read (Vio *thee, char *buf, int bufsize)
 Read (up to) bufsize characters into buf from input device.
int Vio_write (Vio *thee, char *buf, int bufsize)
 Write bufsize characters from buf to output device.
void Vio_bufTake (Vio *thee, char *buf, int bufsize)
 Set the pointer to the internal buffer.
char * Vio_bufGive (Vio *thee)
 Return the pointer to the internal buffer.
int Vio_bufSize (Vio *thee)
 Return the length to the internal buffer.
VioVio_socketOpen (char *key, const char *iodev, const char *iofmt, const char *iohost, const char *iofile)
 Socket open for read or write.
void Vio_socketClose (Vio **sock)
 Socket close from read or write.


Detailed Description

Class Vio: virtual <SDIO/FILE/BUFF/UNIX/INET> I/O layer.

Version:
Id
vio.h,v 1.27 2009/04/24 22:53:49 fetk Exp
Author:
Michael Holst
Attention:
 *
 * MALOC = < Minimal Abstraction Layer for Object-oriented C >
 * Copyright (C) 1994--2008 Michael Holst
 *
 * 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
 * 
 * 

Define Documentation

#define VIO_MAXBUF   10

number of internal buffers (BUFF datatype)

#define VPORTNUMBER   14916

our portbase; 5000 < VPORTNUMBER < 49152


Generated on Mon Aug 9 11:08:01 2010 for MALOC by  doxygen 1.5.6