Commit f9cd4193 authored by John P. Willis's avatar John P. Willis
Browse files

Add LIBFREEM_API_VERSION macro and make repeated freem_init calls idempotent

parent e35735b6
Pipeline #739 failed with stage
in 24 seconds
......@@ -114,11 +114,13 @@ typedef struct freem_ent_t {
# define FALSE 0
#endif
#define LIBFREEM_API_VERSION 2
#ifdef __cplusplus
extern "C" {
#endif
extern pid_t freem_init(char *namespace_name);
extern pid_t freem_init(char *environment_name, char *namespace_name);
extern short freem_version(char *result);
extern short freem_set(freem_ref_t *ref);
extern short freem_get(freem_ref_t *ref);
......
......@@ -98,11 +98,14 @@ void mref2str(freem_ref_t *ref, char *key)
}
pid_t freem_init(char *namespace_name)
pid_t freem_init(char *environment_name, char *namespace_name)
{
static short mlib_initialized = FALSE;
int ierr_sav;
int errno_sav;
if (mlib_initialized == TRUE) return pid;
noclear = TRUE;
filter = TRUE;
direct_mode = FALSE;
......@@ -114,7 +117,8 @@ pid_t freem_init(char *namespace_name)
freem_release_io ();
mlib_initialize = TRUE;
if (ierr_sav > OK || errno_sav != 0) {
return -1;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment