Mercurial > retraceit
view src/util.h @ 113:20ec21924338 tip
Added tag 1.4 for changeset 9daf778feaf1
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Thu, 08 Dec 2016 15:34:30 +0100 |
parents | 9daf778feaf1 |
children |
line wrap: on
line source
/* Copyright (C) 2014 by Bundesamt für Sicherheit in der Informationstechnik * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=2) * and comes with ABSOLUTELY NO WARRANTY! * See LICENSE.txt for details. */ #ifndef COMMON_UTIL_H #define COMMON_UTIL_H /** @file util.h * @brief The usual useful stuff that fit nowhere else */ #include <stdbool.h> #ifdef __cplusplus extern "C" { #endif /**@brief Get the directory in which the current process resides in * * Look up the directory in which the current process is placed. * If the path is longer then MAX_PATH NULL is returned. * * Returns a utf-8 encoded string that has to be freed by the caller * on linux the path is returned as is including the last /. * * @returns The directory of the current process */ char * get_install_dir(); #ifndef _WIN32 /**@def Some value to use as equivalent as MAX_PATH on windows */ #define MAX_PATH_LINUX 4000 /**@brief Get the directory in which the process proc resides in * * Look up the directory in which the process proc is placed. * If the path is longer then MAX_PATH NULL is returned. * * Returns a utf-8 encoded string that has to be freed by the caller * on linux the path is returned as is including the last /. * * @param[in] A process id or special name from the proc file system. * * @returns The directory of the process */ char * get_proc_install_dir(const char *proc); #endif #ifdef __cplusplus } #endif #endif // COMMON_UTIL_H