[2826] | 1 | /* $Id: kRdr.h 3578 2007-09-02 20:55:51Z bird $ */
|
---|
[2821] | 2 | /** @file
|
---|
[3542] | 3 | * kRdr - The File Provider.
|
---|
| 4 | */
|
---|
| 5 |
|
---|
| 6 | /*
|
---|
| 7 | * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net>
|
---|
[2821] | 8 | *
|
---|
[3542] | 9 | * This file is part of kStuff.
|
---|
[2821] | 10 | *
|
---|
[3542] | 11 | * kStuff is free software; you can redistribute it and/or modify
|
---|
| 12 | * it under the terms of the GNU Lesser General Public License as published
|
---|
| 13 | * by the Free Software Foundation; either version 2 of the License, or
|
---|
[2821] | 14 | * (at your option) any later version.
|
---|
| 15 | *
|
---|
[3542] | 16 | * kStuff is distributed in the hope that it will be useful,
|
---|
[2821] | 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
[3542] | 19 | * GNU Lesser General Public License for more details.
|
---|
[2821] | 20 | *
|
---|
[3542] | 21 | * You should have received a copy of the GNU Lesser General Public License
|
---|
| 22 | * along with kStuff; if not, write to the Free Software
|
---|
[2821] | 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
| 24 | *
|
---|
| 25 | */
|
---|
| 26 |
|
---|
[3542] | 27 | #ifndef ___kRdr_h___
|
---|
| 28 | #define ___kRdr_h___
|
---|
[2821] | 29 |
|
---|
[3542] | 30 | #include <k/kDefs.h>
|
---|
[3543] | 31 | #include <k/kTypes.h>
|
---|
[3542] | 32 |
|
---|
| 33 | /** @defgroup grp_kRdr kRdr - The File Provider
|
---|
[2825] | 34 | * @{ */
|
---|
[2821] | 35 |
|
---|
[3548] | 36 | /** @def KRDR_DECL
|
---|
| 37 | * Declares a kRdr function according to build context.
|
---|
| 38 | * @param type The return type.
|
---|
| 39 | */
|
---|
| 40 | #if defined(KRDR_BUILDING_DYNAMIC)
|
---|
| 41 | # define KRDR_DECL(type) K_DECL_EXPORT(type)
|
---|
| 42 | #elif defined(KRDR_BUILT_DYNAMIC)
|
---|
| 43 | # define KRDR_DECL(type) K_DECL_IMPORT(type)
|
---|
| 44 | #else
|
---|
| 45 | # define KRDR_DECL(type) type
|
---|
| 46 | #endif
|
---|
| 47 |
|
---|
[3546] | 48 | #ifdef __cplusplus
|
---|
| 49 | extern "C" {
|
---|
| 50 | #endif
|
---|
| 51 |
|
---|
[3548] | 52 | KRDR_DECL(int) kRdrOpen( PPKRDR ppRdr, const char *pszFilename);
|
---|
| 53 | KRDR_DECL(int) kRdrClose( PKRDR pRdr);
|
---|
| 54 | KRDR_DECL(int) kRdrRead( PKRDR pRdr, void *pvBuf, KSIZE cb, KFOFF off);
|
---|
| 55 | KRDR_DECL(int) kRdrAllMap( PKRDR pRdr, const void **ppvBits);
|
---|
| 56 | KRDR_DECL(int) kRdrAllUnmap( PKRDR pRdr, const void *pvBits);
|
---|
| 57 | KRDR_DECL(KFOFF) kRdrSize( PKRDR pRdr);
|
---|
| 58 | KRDR_DECL(KFOFF) kRdrTell( PKRDR pRdr);
|
---|
| 59 | KRDR_DECL(const char *) kRdrName( PKRDR pRdr);
|
---|
| 60 | KRDR_DECL(KIPTR) kRdrNativeFH( PKRDR pRdr);
|
---|
| 61 | KRDR_DECL(KSIZE) kRdrPageSize( PKRDR pRdr);
|
---|
| 62 | KRDR_DECL(int) kRdrMap( PKRDR pRdr, void **ppvBase, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fFixed);
|
---|
| 63 | KRDR_DECL(int) kRdrRefresh( PKRDR pRdr, void *pvBase, KU32 cSegments, PCKLDRSEG paSegments);
|
---|
| 64 | KRDR_DECL(int) kRdrProtect( PKRDR pRdr, void *pvBase, KU32 cSegments, PCKLDRSEG paSegments, KBOOL fUnprotectOrProtect);
|
---|
| 65 | KRDR_DECL(int) kRdrUnmap( PKRDR pRdr, void *pvBase, KU32 cSegments, PCKLDRSEG paSegments);
|
---|
[3550] | 66 | KRDR_DECL(void) kRdrDone( PKRDR pRdr);
|
---|
[2825] | 67 |
|
---|
[3548] | 68 | KRDR_DECL(int) kRdrBufOpen(PPKRDR ppRdr, const char *pszFilename);
|
---|
[3550] | 69 | KRDR_DECL(int) kRdrBufWrap(PPKRDR ppRdr, PKRDR pRdr, KBOOL fCloseIt);
|
---|
| 70 | KRDR_DECL(KBOOL) kRdrBufIsBuffered(PKRDR pRdr);
|
---|
| 71 | KRDR_DECL(int) kRdrBufLine(PKRDR pRdr, char *pszLine, KSIZE cbLine);
|
---|
[3548] | 72 | KRDR_DECL(int) kRdrBufLineEx(PKRDR pRdr, char *pszLine, KSIZE *pcbLine);
|
---|
| 73 | KRDR_DECL(const char *) kRdrBufLineQ(PKRDR pRdr);
|
---|
| 74 |
|
---|
[2821] | 75 | #ifdef __cplusplus
|
---|
| 76 | }
|
---|
| 77 | #endif
|
---|
| 78 |
|
---|
[3546] | 79 | /** @} */
|
---|
| 80 |
|
---|
[2821] | 81 | #endif
|
---|
| 82 |
|
---|