Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

agl_ios.h

Go to the documentation of this file.
00001 
00002 /*
00003      ______     __                     ___     __
00004     /\  _  \   /\ \                   /\_ \   /\_\
00005     \ \ \_\ \  \ \ \      __     ___  \//\ \  \/_/_
00006      \ \  __ \ `/__ \   /'__`\  / __`\  \ \ \   /\ \
00007       \ \ \/\ \/\\_\ \_/\ \_\ \/\ \_\ \_ \_\ \_ \_\ \_
00008        \ \_\ \_\ \_____\ \___\ \ \______\/\____\/\____\
00009         \/_/\/_/\/_____/\/___L\ \/______/\/____/\/____/
00010                           /\____/
00011                           \_/__/
00012 
00013 
00014 
00015 
00016                   An advanced game library
00017 
00018                  (c) Stephane APIOU 2003
00019 
00020 
00021     This program is free software; you can redistribute it and/or modify
00022     it under the terms of the GNU General Public License as published by
00023     the Free Software Foundation; either version 2 of the License, or
00024     (at your option) any later version.
00025 
00026     This program is distributed in the hope that it will be useful,
00027     but WITHOUT ANY WARRANTY; without even the implied warranty of
00028     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00029     GNU General Public License for more details.
00030 
00031     You should have received a copy of the GNU General Public License
00032     along with this program; if not, write to the Free Software
00033     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00034 
00035 
00036 
00037 */
00038 
00040 
00049 #ifndef _adgali_ios_h
00050 #define _adgali_ios_h
00051 
00052 #include <stdio.h>
00053 
00055 
00056 struct _agl_iosio;
00057 
00059 
00063 typedef struct agl_ios
00064 {
00065         agl_handle handle;
00066         struct _agl_iosio *pio;
00067         char *filename;         
00068         void *priv;
00069 } agl_ios;
00070 
00071 typedef struct _agl_iosio
00072 {
00073         char *desc;             
00074         int (*is) (agl_module *, char *, agl_ios *);
00075         agl_ios *(*open) (agl_module *, char *, agl_ios *);
00076         long (*seek) (agl_ios *, long, int);    
00077         long (*read) (agl_ios *, void *, long, long, void *);   
00078         long (*write) (agl_ios *, void *, long, long, void *);  
00079         int (*close) (agl_ios *);       
00080 } agl_iosio;
00081 
00082 
00083 extern agl_ios *agl_ios_open(agl_handle handle, char *address);
00084 
00086 
00099 #define agl_ios_seek(ios, offset, whence) (agl_assert(ios != NULL), \
00100         ((ios)->pio->seek(ios, offset, whence)))
00101 
00103 
00109 #define agl_ios_tell(ios) (agl_assert(ios != NULL), \
00110         ((ios)->pio->seek(ios, 0, SEEK_CUR)))
00111 
00113 
00124 #define agl_ios_read(ios, buf, size, maxnum, supp) (agl_assert(ios != NULL), \
00125         ((ios)->pio->read(ios, buf, size, maxnum ,supp)))
00126 
00128 
00139 #define agl_ios_write(ios, buf, size, maxnum, supp) (agl_assert(ios != NULL), \
00140         ((ios)->pio->write(ios, buf, size, maxnum ,supp)))
00141 
00143 
00150 #define agl_ios_close(ios) (agl_assert(ios != NULL), \
00151         ((ios)->pio->close(ios)))
00152 
00153 
00154 #endif /* _agl_ios_h */

Doc generated at 1 Jul 2003 for, adgali 0.2.3 written by Stephane APIOU, © 2001 Generated by doxygen 1.3.2 ,