| 1 | /* $Id: kRdr.h 3578 2007-09-02 20:55:51Z bird $ */ | 
|---|
| 2 | /** @file | 
|---|
| 3 | * kRdr - The File Provider. | 
|---|
| 4 | */ | 
|---|
| 5 |  | 
|---|
| 6 | /* | 
|---|
| 7 | * Copyright (c) 2006-2007 knut st. osmundsen <bird-src-spam@anduin.net> | 
|---|
| 8 | * | 
|---|
| 9 | * This file is part of kStuff. | 
|---|
| 10 | * | 
|---|
| 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 | 
|---|
| 14 | * (at your option) any later version. | 
|---|
| 15 | * | 
|---|
| 16 | * kStuff is distributed in the hope that it will be useful, | 
|---|
| 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 19 | * GNU Lesser General Public License for more details. | 
|---|
| 20 | * | 
|---|
| 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 | 
|---|
| 23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA | 
|---|
| 24 | * | 
|---|
| 25 | */ | 
|---|
| 26 |  | 
|---|
| 27 | #ifndef ___kRdr_h___ | 
|---|
| 28 | #define ___kRdr_h___ | 
|---|
| 29 |  | 
|---|
| 30 | #include <k/kDefs.h> | 
|---|
| 31 | #include <k/kTypes.h> | 
|---|
| 32 |  | 
|---|
| 33 | /** @defgroup grp_kRdr      kRdr - The File Provider | 
|---|
| 34 | * @{ */ | 
|---|
| 35 |  | 
|---|
| 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 |  | 
|---|
| 48 | #ifdef __cplusplus | 
|---|
| 49 | extern "C" { | 
|---|
| 50 | #endif | 
|---|
| 51 |  | 
|---|
| 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); | 
|---|
| 66 | KRDR_DECL(void)     kRdrDone(     PKRDR pRdr); | 
|---|
| 67 |  | 
|---|
| 68 | KRDR_DECL(int)      kRdrBufOpen(PPKRDR ppRdr, const char *pszFilename); | 
|---|
| 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); | 
|---|
| 72 | KRDR_DECL(int)      kRdrBufLineEx(PKRDR pRdr, char *pszLine, KSIZE *pcbLine); | 
|---|
| 73 | KRDR_DECL(const char *) kRdrBufLineQ(PKRDR pRdr); | 
|---|
| 74 |  | 
|---|
| 75 | #ifdef __cplusplus | 
|---|
| 76 | } | 
|---|
| 77 | #endif | 
|---|
| 78 |  | 
|---|
| 79 | /** @} */ | 
|---|
| 80 |  | 
|---|
| 81 | #endif | 
|---|
| 82 |  | 
|---|