GNU Octave
9.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
pwd-wrappers.h
Go to the documentation of this file.
1
////////////////////////////////////////////////////////////////////////
2
//
3
// Copyright (C) 2023-2024 The Octave Project Developers
4
//
5
// See the file COPYRIGHT.md in the top-level directory of this
6
// distribution or <https://octave.org/copyright/>.
7
//
8
// This file is part of Octave.
9
//
10
// Octave is free software: you can redistribute it and/or modify it
11
// under the terms of the GNU General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
14
//
15
// Octave is distributed in the hope that it will be useful, but
16
// WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU General Public License for more details.
19
//
20
// You should have received a copy of the GNU General Public License
21
// along with Octave; see the file COPYING. If not, see
22
// <https://www.gnu.org/licenses/>.
23
//
24
////////////////////////////////////////////////////////////////////////
25
26
#if ! defined (octave_pwd_wrappers_h)
27
#define octave_pwd_wrappers_h 1
28
29
#include <sys/types.h>
30
31
#if defined __cplusplus
32
extern
"C"
{
33
#endif
34
35
struct
passwd;
36
37
// We can't include <pwd.h> without the risk of overwriting function names
38
// with preprocessor deinitions. Define a struct that can hold the needed
39
// fields, and use a function to convert from struct passwd to it.
40
struct
octave_passwd_wrapper
41
{
42
char
*
pw_name
;
43
char
*
pw_passwd
;
44
uid_t
pw_uid
;
45
gid_t
pw_gid
;
46
char
*
pw_gecos
;
47
char
*
pw_dir
;
48
char
*
pw_shell
;
49
};
50
51
extern
OCTAVE_API
struct
passwd *
octave_getpwent_wrapper
(
void
);
52
53
extern
OCTAVE_API
struct
passwd *
octave_getpwuid_wrapper
(uid_t uid);
54
55
extern
OCTAVE_API
struct
passwd *
octave_getpwnam_wrapper
(
const
char
*nam);
56
57
extern
OCTAVE_API
void
octave_setpwent_wrapper
(
void
);
58
59
extern
OCTAVE_API
void
octave_endpwent_wrapper
(
void
);
60
61
extern
OCTAVE_API
void
octave_endpwent_wrapper
(
void
);
62
63
extern
OCTAVE_API
void
64
octave_from_passwd
(
const
struct
passwd *pw,
65
struct
octave_passwd_wrapper
*oct_pw);
66
67
#if defined __cplusplus
68
}
69
#endif
70
71
#endif
OCTAVE_API
#define OCTAVE_API
Definition:
main.cc:55
octave_setpwent_wrapper
void octave_setpwent_wrapper(void)
Definition:
pwd-wrappers.c:70
octave_getpwnam_wrapper
struct passwd * octave_getpwnam_wrapper(const char *nam)
Definition:
pwd-wrappers.c:59
octave_endpwent_wrapper
void octave_endpwent_wrapper(void)
Definition:
pwd-wrappers.c:78
octave_getpwent_wrapper
struct passwd * octave_getpwent_wrapper(void)
Definition:
pwd-wrappers.c:39
octave_getpwuid_wrapper
struct passwd * octave_getpwuid_wrapper(uid_t uid)
Definition:
pwd-wrappers.c:48
octave_from_passwd
void octave_from_passwd(const struct passwd *pw, struct octave_passwd_wrapper *oct_pw)
Definition:
pwd-wrappers.c:86
octave_passwd_wrapper
Definition:
pwd-wrappers.h:41
octave_passwd_wrapper::pw_shell
char * pw_shell
Definition:
pwd-wrappers.h:48
octave_passwd_wrapper::pw_dir
char * pw_dir
Definition:
pwd-wrappers.h:47
octave_passwd_wrapper::pw_uid
uid_t pw_uid
Definition:
pwd-wrappers.h:44
octave_passwd_wrapper::pw_passwd
char * pw_passwd
Definition:
pwd-wrappers.h:43
octave_passwd_wrapper::pw_gecos
char * pw_gecos
Definition:
pwd-wrappers.h:46
octave_passwd_wrapper::pw_gid
gid_t pw_gid
Definition:
pwd-wrappers.h:45
octave_passwd_wrapper::pw_name
char * pw_name
Definition:
pwd-wrappers.h:42
liboctave
wrappers
pwd-wrappers.h
Generated on Sun Mar 17 2024 22:36:53 for GNU Octave by
1.9.1