io.h

Go to the documentation of this file.
00001 #ifndef _IO_H_
00002 #define _IO_H_
00003 
00004 /*
00005  * Copyright (C) 2001-2004 by egnite Software GmbH. All rights reserved.
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
00024  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  */
00035 
00036 /*
00037  * $Log: io.h,v $
00038  * Revision 1.7  2007/05/02 11:30:33  haraldkipp
00039  * Mapped _write_P to _write for non Harvard architectures.
00040  *
00041  * Revision 1.6  2006/10/08 16:48:09  haraldkipp
00042  * Documentation fixed
00043  *
00044  * Revision 1.5  2005/08/05 11:18:00  olereinhardt
00045  * Added support for _seek, _tell, fseek, ftell functions
00046  *
00047  * Revision 1.4  2005/08/02 17:46:47  haraldkipp
00048  * Major API documentation update.
00049  *
00050  * Revision 1.3  2004/07/30 19:10:42  drsung
00051  * First proposal to define some global ioctl commands.
00052  *
00053  */
00054 
00055 #include <sys/types.h>
00056 
00061 
00062 /* 
00063  * Some global definitions for ioctl commands.
00064  */
00065 #define IOCTL_GETSTATUS                 0x0001
00066 #define IOCTL_SETSTATUS                 0x0002
00067 #define IOCTL_SETBUFFERMODE             0x0003
00068 #define IOCTL_GETBUFFERMODE             0x0004
00069 #define IOCTL_GETOUTBUFSIZE             0x0005
00070 #define IOCTL_SETOUTBUFSIZE             0x0006
00071 #define IOCTL_GETINBUFSIZE              0x0007
00072 #define IOCTL_SETINBUFSIZE              0x0008
00073 
00077 #define IOCTL_FLUSHOUTBUF               0x0009
00078 
00080 #define IOCTL_GETFILESIZE               0x000A
00081 
00083 #define IOCTL_GETOUTBUFCOUNT            0x000B
00084 
00086 #define IOCTL_GETINBUFCOUNT             0x000C
00087 
00090 extern int _close(int fd);
00091 extern int _open(CONST char *name, int mode);
00092 extern int _read(int fd, void *buffer, size_t count);
00093 extern int _write(int fd, CONST void *buffer, size_t count);
00094 #ifdef __HARVARD_ARCH__
00095 extern int _write_P(int fd, PGM_P buffer, size_t count);
00096 #else
00097 #define _write_P(fd, buffer, count) _write(fd, buffer, count)
00098 #endif
00099 extern int _seek(int fd, long offset, int origin);
00100 extern long _tell(int fd);
00101 
00102 extern int _ioctl(int fd, int cmd, void *buffer);
00103 extern long _filelength(int fd);
00104 
00105 #endif

© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/