comparison src/util.h @ 0:147b08bc7d64

Initial commit of a basic Application framework.
author Andre Heinecke <andre.heinecke@intevation.de>
date Mon, 23 Mar 2015 12:41:52 +0100
parents
children 098a10fc2e83
comparison
equal deleted inserted replaced
-1:000000000000 0:147b08bc7d64
1 /* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik
2 * Software engineering by Intevation GmbH
3 *
4 * This file is Free Software under the GNU GPL (v>=2)
5 * and comes with ABSOLUTELY NO WARRANTY!
6 * See LICENSE.txt for details.
7 */
8 #ifndef COMMON_UTIL_H
9 #define COMMON_UTIL_H
10 /* @file util.h
11 * @brief The usual useful stuff that fit nowhere else
12 */
13 #include <stdbool.h>
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
19 /**@brief Get the directory in which the current process resides in
20 *
21 * Look up the directory in which the current process is placed.
22 * If the path is longer then MAX_PATH NULL is returned.
23 *
24 * Returns a utf-8 encoded string that has to be freed by the caller
25 * on linux the path is returned as is including the last /.
26 *
27 * @returns The directory of the current process
28 */
29 char * get_install_dir();
30
31 #ifndef WIN32
32 /**@def Some value to use as equivalent as MAX_PATH on windows */
33 #define MAX_PATH_LINUX 4000
34
35 /**@brief Get the directory in which the process proc resides in
36 *
37 * Look up the directory in which the process proc is placed.
38 * If the path is longer then MAX_PATH NULL is returned.
39 *
40 * Returns a utf-8 encoded string that has to be freed by the caller
41 * on linux the path is returned as is including the last /.
42 *
43 * @param[in] A process id or special name from the proc file system.
44 *
45 * @returns The directory of the process
46 */
47 char * get_proc_install_dir(const char *proc);
48 #endif
49
50 #ifdef __cplusplus
51 }
52 #endif
53
54 #endif // COMMON_UTIL_H
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)