1 | /* $Id: $ */
|
---|
2 | /** @file
|
---|
3 | *
|
---|
4 | * kLdr - The Dynamic Loader, Helper Functions.
|
---|
5 | *
|
---|
6 | * Copyright (c) 2006 knut st. osmundsen <bird@anduin.net>
|
---|
7 | *
|
---|
8 | *
|
---|
9 | * This file is part of kLdr.
|
---|
10 | *
|
---|
11 | * kLdr is free software; you can redistribute it and/or modify
|
---|
12 | * it under the terms of the GNU General Public License as published by
|
---|
13 | * the Free Software Foundation; either version 2 of the License, or
|
---|
14 | * (at your option) any later version.
|
---|
15 | *
|
---|
16 | * kLdr 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 General Public License for more details.
|
---|
20 | *
|
---|
21 | * You should have received a copy of the GNU General Public License
|
---|
22 | * along with kLdr; if not, write to the Free Software
|
---|
23 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
24 | *
|
---|
25 | */
|
---|
26 |
|
---|
27 |
|
---|
28 | #ifndef __kLdrHlp_h__
|
---|
29 | #define __kLdrHlp_h__
|
---|
30 |
|
---|
31 | #ifdef __OS2__
|
---|
32 |
|
---|
33 | int kldrSemInit(void);
|
---|
34 | int kldrSemTerm(void);
|
---|
35 | int kldrSemRequest(void);
|
---|
36 | int kldrSemRelease(void);
|
---|
37 | int kldrSemGlobalRequest(void);
|
---|
38 | int kldrSemGlobalRelease(void);
|
---|
39 |
|
---|
40 | /** Loader file handle. */
|
---|
41 | typedef unsigned long KLDRFILE;
|
---|
42 | /** Pointer to a loader file handle. */
|
---|
43 | typedef KLDRFILE *PKLDRFILE;
|
---|
44 |
|
---|
45 | int kldrFileOpen(const char *pszFilename, PKLDRFILE pFile);
|
---|
46 | int kldrFileClose(KLDRFILE File);
|
---|
47 | int kldrFileRead(KLDRFILE File, off_t off, void *pv, size_t cb);
|
---|
48 |
|
---|
49 | int kldrGetEnv(const char *pszVar, char *pszVar, size_t *pcchVar)
|
---|
50 |
|
---|
51 | void *kldrAlloc(size_t cb);
|
---|
52 | void kldrFree(void *pv);
|
---|
53 |
|
---|
54 | int kldrPrivateAlloc(void *pv, size_t cb, unsigned fFlags, void **ppv);
|
---|
55 | int kldrPrivateFree(void *pv, size_t cb);
|
---|
56 | int kldrSharedAlloc(void *pv, size_t cb, unsigned fFlags, const char *pszFilename, KLDRFILE File, void **ppv);
|
---|
57 | int kldrSharedFree(void *pv, size_t cb);
|
---|
58 |
|
---|
59 | void kldrExit(int rc);
|
---|
60 |
|
---|
61 | /* #elif __WIN__ */
|
---|
62 |
|
---|
63 | #else
|
---|
64 |
|
---|
65 |
|
---|
66 |
|
---|
67 | #endif
|
---|
68 |
|
---|
69 |
|
---|
70 | #endif /* __kLdrHlp_h__ */
|
---|