26 #if defined (HAVE_CONFIG_H)
32 #include <sys/types.h>
53 m.assign (
"name", gr.
name ());
54 m.assign (
"passwd", gr.
passwd ());
55 m.assign (
"gid",
static_cast<double> (gr.
gid ()));
64 DEFUN (getgrent, args, ,
73 if (args.length () != 0)
81 return ovl (val, msg);
84 DEFUN (getgrgid, args, ,
94 if (args.length () != 1)
97 double dval = args(0).double_value ();
100 error (
"getgrgid: GID must be an integer");
102 gid_t gid =
static_cast<gid_t
> (dval);
109 return ovl (val, msg);
112 DEFUN (getgrnam, args, ,
122 if (args.length () != 1)
125 std::string s = args(0).string_value ();
132 return ovl (val, msg);
135 DEFUN (setgrent, args, ,
142 if (args.length () != 0)
150 return ovl (
static_cast<double> (status), msg);
153 DEFUN (endgrent, args, ,
160 if (args.length () != 0)
168 return ovl (
static_cast<double> (status), msg);
static int setgrent(void)
static group getgrent(void)
string_vector mem(void) const
std::string passwd(void) const
static group getgrgid(gid_t gid)
static int endgrent(void)
static group getgrnam(const std::string &nm)
std::string name(void) const
OCTINTERP_API void print_usage(void)
#define DEFUN(name, args_name, nargout_name, doc)
Macro to define a builtin function.
void error(const char *fmt,...)
static octave_value mk_gr_map(const octave::sys::group &gr)
return octave_value(v1.char_array_value() . concat(v2.char_array_value(), ra_idx),((a1.is_sq_string()||a2.is_sq_string()) ? '\'' :'"'))
octave_value_list ovl(const OV_Args &... args)
Construct an octave_value_list with less typing.