forked from ElektraInitiative/libelektra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgopts_osx.h
More file actions
51 lines (40 loc) · 732 Bytes
/
gopts_osx.h
File metadata and controls
51 lines (40 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/**
* @file
*
* @brief Source for opts plugin
*
* @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
*
*/
#ifndef ELEKTRA_GOPTS_SYSCTL_H
#define ELEKTRA_GOPTS_SYSCTL_H
#include <crt_externs.h>
#include <string.h>
#include <kdbhelper.h>
extern char ** environ;
static int loadArgs (char *** argvp)
{
const int * argcp = _NSGetArgc ();
if (!argcp)
{
return 0;
}
char *** argvp1 = _NSGetArgv ();
if (!argvp1)
{
return 0;
}
*argvp = *argvp1;
return *argcp;
}
static char ** loadEnvp (void)
{
return environ;
}
static void cleanupArgs (int argc ELEKTRA_UNUSED, char ** argv ELEKTRA_UNUSED)
{
}
static void cleanupEnvp (char ** envp ELEKTRA_UNUSED)
{
}
#endif // ELEKTRA_GOPTS_SYSCTL_H