view src/util.h @ 83:11aaa9214cfb

Add back to folder selection button
author Andre Heinecke <andre.heinecke@intevation.de>
date Thu, 18 Jun 2015 18:55:00 +0200
parents 098a10fc2e83
children 9daf778feaf1
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
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)