9.0
general documentation
Loading...
Searching...
No Matches
cs_base.h File Reference
#include "base/cs_defs.h"
#include <stdio.h>
Include dependency graph for cs_base.h:

Go to the source code of this file.

Macros

#define CS_APP_NAME   "code_saturne"
#define CS_APP_VERSION   PACKAGE_VERSION /* PACKAGE_VERSION from autoconf */
#define CS_MEM_ALIGN   0
#define CS_BASE_STRING_LEN   80

Typedefs

typedef void cs_base_atexit_t(void)
typedef void cs_base_sigint_handler_t(int signum)

Functions

static const char * cs_base_strtf (bool boolean)
 Return a string "true" or "false" according to the boolean.
char * cs_base_get_app_name (int argc, const char *argv[])
void cs_base_logfile_head (int argc, char *argv[])
void cs_exit (int status)
void cs_base_error_init (bool signal_defaults)
void cs_base_mem_init (void)
void cs_base_mem_finalize (void)
void cs_base_signal_restore (void)
void cs_base_time_summary (void)
void cs_base_update_status (const char *format,...)
 Update status file.
void cs_base_trace_set (bool trace)
void cs_base_bft_printf_init (const char *log_name, bool rn_log_flag)
void cs_base_bft_printf_set (const char *log_name, bool rn_log_flag)
const char * cs_base_bft_printf_name (void)
bool cs_base_bft_printf_suppressed (void)
void cs_base_warn (const char *file_name, int line_num)
void cs_base_atexit_set (cs_base_atexit_t *const fct)
void cs_base_sigint_handler_set (cs_base_sigint_handler_t *const h)
void cs_base_option_string_clean (char *s)
const char * cs_base_get_localedir (void)
const char * cs_base_get_pkgdatadir (void)
const char * cs_base_get_pkglibdir (void)
void cs_base_check_bool (bool *b)
FILE * cs_base_open_properties_data_file (const char *base_name)
void cs_base_backtrace_dump (FILE *f, int lv_start)
 Dump a stack trace to a file.
void cs_base_at_finalize (cs_base_atexit_t *func)
 Register a function to be called at the finalization stage.
void cs_base_finalize_sequence (void)
 Call sequence of finalization functions.
void cs_base_get_run_identity (char **run_id, char **case_name, char **study_name)
 Query run-time directory info, using working directory names.

Macro Definition Documentation

◆ CS_APP_NAME

#define CS_APP_NAME   "code_saturne"

◆ CS_APP_VERSION

#define CS_APP_VERSION   PACKAGE_VERSION /* PACKAGE_VERSION from autoconf */

◆ CS_BASE_STRING_LEN

#define CS_BASE_STRING_LEN   80

◆ CS_MEM_ALIGN

#define CS_MEM_ALIGN   0

Typedef Documentation

◆ cs_base_atexit_t

typedef void cs_base_atexit_t(void)

◆ cs_base_sigint_handler_t

typedef void cs_base_sigint_handler_t(int signum)

Function Documentation

◆ cs_base_at_finalize()

void cs_base_at_finalize ( cs_base_atexit_t * func)

Register a function to be called at the finalization stage.

The finalization is done in the reverse (first in, last out) sequence relative to calls of cs_base_at_finalize.

Parameters
[in]funcfinalization function to call.

◆ cs_base_atexit_set()

void cs_base_atexit_set ( cs_base_atexit_t *const fct)

◆ cs_base_backtrace_dump()

void cs_base_backtrace_dump ( FILE * f,
int lv_start )

Dump a stack trace to a file.

Parameters
[in]fpointer to file in which to dump trace
[in]lv_startstart level in stack trace

◆ cs_base_bft_printf_init()

void cs_base_bft_printf_init ( const char * log_name,
bool rn_log_flag )

◆ cs_base_bft_printf_name()

const char * cs_base_bft_printf_name ( void )

◆ cs_base_bft_printf_set()

void cs_base_bft_printf_set ( const char * log_name,
bool rn_log_flag )

◆ cs_base_bft_printf_suppressed()

bool cs_base_bft_printf_suppressed ( void )

◆ cs_base_check_bool()

void cs_base_check_bool ( bool * b)

◆ cs_base_error_init()

void cs_base_error_init ( bool signal_defaults)

◆ cs_base_finalize_sequence()

void cs_base_finalize_sequence ( void )

Call sequence of finalization functions.

The finalization is done in the reverse (first in, last out) sequence relative to calls of cs_base_at_finalize.

◆ cs_base_get_app_name()

char * cs_base_get_app_name ( int argc,
const char * argv[] )

◆ cs_base_get_localedir()

const char * cs_base_get_localedir ( void )

◆ cs_base_get_pkgdatadir()

const char * cs_base_get_pkgdatadir ( void )

◆ cs_base_get_pkglibdir()

const char * cs_base_get_pkglibdir ( void )

◆ cs_base_get_run_identity()

void cs_base_get_run_identity ( char ** run_id,
char ** case_name,
char ** study_name )

Query run-time directory info, using working directory names.

Returned names are allocated if non-null, so should be deallocated by the caller when no longer needed.

Names are extracted from the working directory structure, which is expected to be of the form: <prefix>/study_name/case_name/RESU/run_id

or, in the case of a coupled run: <prefix>/study_name/RESU_COUPLING/run_id/case_name

If some names cannot be queried, nullptr is returned.

Parameters
[out]run_idrun_id, or nullptr
[out]case_namecase name, or nullptr
[out]study_namestudy name, or nullptr

◆ cs_base_logfile_head()

void cs_base_logfile_head ( int argc,
char * argv[] )

◆ cs_base_mem_finalize()

void cs_base_mem_finalize ( void )

◆ cs_base_mem_init()

void cs_base_mem_init ( void )

◆ cs_base_open_properties_data_file()

FILE * cs_base_open_properties_data_file ( const char * base_name)

◆ cs_base_option_string_clean()

void cs_base_option_string_clean ( char * s)

◆ cs_base_sigint_handler_set()

void cs_base_sigint_handler_set ( cs_base_sigint_handler_t *const h)

◆ cs_base_signal_restore()

void cs_base_signal_restore ( void )

◆ cs_base_strtf()

const char * cs_base_strtf ( bool boolean)
inlinestatic

Return a string "true" or "false" according to the boolean.

Parameters
[in]booleanbool type
Returns
a string "true" or "false"

◆ cs_base_time_summary()

void cs_base_time_summary ( void )

◆ cs_base_trace_set()

void cs_base_trace_set ( bool trace)

◆ cs_base_update_status()

void cs_base_update_status ( const char * format,
... )

Update status file.

If the format string is null, the file is removed.

Parameters
[in]formatformat string, or nullptr
[in]...format arguments

◆ cs_base_warn()

void cs_base_warn ( const char * file_name,
int line_num )

◆ cs_exit()

void cs_exit ( int status)