29 #include <sys/types.h>
54 m.
assign (
"gid", static_cast<double> (gr.
gid ()));
65 DEFUN (getgrent, args, ,
67 @deftypefn {Built-in Function} {@var{grp_struct} =} getgrent ()\n\
68 Return an entry from the group database, opening it if necessary.\n\
70 Once the end of data has been reached, @code{getgrent} returns 0.\n\
71 @seealso{setgrent, endgrent}\n\
76 retval(1) = std::string ();
79 int nargin = args.
length ();
94 DEFUN (getgrgid, args, ,
96 @deftypefn {Built-in Function} {@var{grp_struct} =} getgrgid (@var{gid}).\n\
97 Return the first entry from the group database with the group ID\n\
100 If the group ID does not exist in the database, @code{getgrgid} returns 0.\n\
101 @seealso{getgrnam}\n\
106 retval(1) = std::string ();
109 int nargin = args.
length ();
113 double dval = args(0).double_value ();
117 if (
D_NINT (dval) == dval)
119 gid_t gid =
static_cast<gid_t
> (dval);
127 error (
"getgrgid: GID must be an integer");
136 DEFUN (getgrnam, args, ,
138 @deftypefn {Built-in Function} {@var{grp_struct} =} getgrnam (@var{name})\n\
139 Return the first entry from the group database with the group name\n\
142 If the group name does not exist in the database, @code{getgrnam} returns 0.\n\
143 @seealso{getgrgid}\n\
148 retval(1) = std::string ();
151 int nargin = args.
length ();
155 std::string s = args(0).string_value ();
171 DEFUN (setgrent, args, ,
173 @deftypefn {Built-in Function} {} setgrent ()\n\
174 Return the internal pointer to the beginning of the group database.\n\
175 @seealso{getgrent, endgrent}\n\
180 retval(1) = std::string ();
183 int nargin = args.
length ();
198 DEFUN (endgrent, args, ,
200 @deftypefn {Built-in Function} {} endgrent ()\n\
201 Close the group database.\n\
202 @seealso{getgrent, setgrent}\n\
207 retval(1) = std::string ();
210 int nargin = args.
length ();
static int endgrent(void)
static int setgrent(void)
static octave_group getgrgid(gid_t gid)
OCTINTERP_API void print_usage(void)
octave_idx_type length(void) const
string_vector mem(void) const
#define DEFUN(name, args_name, nargout_name, doc)
void error(const char *fmt,...)
std::string passwd(void) const
static octave_group getgrnam(const std::string &nm)
OCTAVE_API double D_NINT(double x)
static octave_group getgrent(void)
std::string name(void) const
void assign(const std::string &k, const octave_value &val)
static octave_value mk_gr_map(const octave_group &gr)