etc.c File Reference
`#include "ruby.h"`
`#include "ruby/encoding.h"`
`#include <sys/types.h>`

Go to the source code of this file.

## Macros

#define | numberof(array) (sizeof(array) / sizeof(*(array)))

## Functions

char * | getenv ()
char * | getlogin ()
static VALUE | etc_getlogin (VALUE obj)
static VALUE | etc_getpwuid (int argc, VALUE *argv, VALUE obj)
static VALUE | etc_getpwnam (VALUE obj, VALUE nam)
static VALUE | etc_passwd (VALUE obj)
static VALUE | etc_each_passwd (VALUE obj)
static VALUE | etc_setpwent (VALUE obj)
static VALUE | etc_endpwent (VALUE obj)
static VALUE | etc_getpwent (VALUE obj)
static VALUE | etc_getgrgid (int argc, VALUE *argv, VALUE obj)
static VALUE | etc_getgrnam (VALUE obj, VALUE nam)
static VALUE | etc_group (VALUE obj)
static VALUE | etc_setgrent (VALUE obj)
static VALUE | etc_endgrent (VALUE obj)
static VALUE | etc_getgrent (VALUE obj)
static VALUE | etc_sysconfdir (VALUE obj)
static VALUE | etc_systmpdir (void)
void | Init_etc (void)

## Variables

static VALUE | sPasswd

## Macro Definition Documentation

#define numberof | ( |  | array | ) | (sizeof(array) / sizeof(*(array)))

Definition at line 560 of file etc.c.

Referenced by etc_systmpdir().

## Function Documentation

static VALUE etc_each_passwd | ( | VALUE | obj | ) |

static

Definition at line 256 of file etc.c.

References RETURN_ENUMERATOR.

Referenced by Init_etc().

static VALUE etc_endgrent | ( | VALUE | obj | ) |

static

Definition at line 519 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_endpwent | ( | VALUE | obj | ) |

static

Definition at line 281 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_getgrent | ( | VALUE | obj | ) |

static

Definition at line 548 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_getgrgid | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | obj
| ) |  |

static

Definition at line 362 of file etc.c.

References getgid(), id, NUM2GIDT, Qnil, rb_eArgError, rb_raise(), rb_scan_args(), and rb_secure().

Referenced by Init_etc().

static VALUE etc_getgrnam | ( | VALUE | obj,
|  | VALUE | nam
| ) |  |

static

Definition at line 395 of file etc.c.

References Qnil, rb_eArgError, rb_raise(), rb_secure(), RSTRING_PTR, and SafeStringValue.

Referenced by Init_etc().

static VALUE etc_getlogin | ( | VALUE | obj | ) |

static

Definition at line 51 of file etc.c.

References getenv(), getlogin(), Qnil, rb_secure(), and rb_tainted_str_new2().

Referenced by Init_etc().

static VALUE etc_getpwent | ( | VALUE | obj | ) |

static

Definition at line 316 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_getpwnam | ( | VALUE | obj,
|  | VALUE | nam
| ) |  |

static

Definition at line 158 of file etc.c.

References Qnil, rb_eArgError, rb_raise(), RSTRING_PTR, and SafeStringValue.

Referenced by Init_etc().

static VALUE etc_getpwuid | ( | int | argc,
|  | VALUE * | argv,
|  | VALUE | obj
| ) |  |

static

Definition at line 127 of file etc.c.

References getuid(), id, NUM2UIDT, Qnil, rb_eArgError, rb_raise(), rb_scan_args(), and rb_secure().

Referenced by Init_etc().

static VALUE etc_group | ( | VALUE | obj | ) |

static

Definition at line 459 of file etc.c.

References Qnil, rb_block_given_p(), and rb_secure().

Referenced by Init_etc().

static VALUE etc_passwd | ( | VALUE | obj | ) |

static

Definition at line 221 of file etc.c.

References Qnil, rb_block_given_p(), and rb_secure().

Referenced by Init_etc().

static VALUE etc_setgrent | ( | VALUE | obj | ) |

static

Definition at line 507 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_setpwent | ( | VALUE | obj | ) |

static

Definition at line 269 of file etc.c.

References Qnil.

Referenced by Init_etc().

static VALUE etc_sysconfdir | ( | VALUE | obj | ) |

static

Definition at line 572 of file etc.c.

References CSIDL_COMMON_APPDATA, rb_filesystem_str_new_cstr(), and rb_w32_special_folder().

Referenced by Init_etc().

static VALUE etc_systmpdir | ( | void |  | ) |

static

Definition at line 585 of file etc.c.

References FL_TAINT, FL_UNSET, FL_UNTRUSTED, len, numberof, Qnil, rb_filesystem_encoding(), rb_filesystem_str_new_cstr(), rb_w32_conv_from_wchar(), and rb_w32_system_tmpdir().

Referenced by Init_etc().

char* getenv | ( |  | ) |

char* getlogin | ( |  | ) |

Definition at line 707 of file win32.c.

References NTLoginName.

Referenced by etc_getlogin().

void Init_etc | ( | void |  | ) |

Definition at line 606 of file etc.c.

References etc_each_passwd(), etc_endgrent(), etc_endpwent(), etc_getgrent(), etc_getgrgid(), etc_getgrnam(), etc_getlogin(), etc_getpwent(), etc_getpwnam(), etc_getpwuid(), etc_group(), etc_passwd(), etc_setgrent(), etc_setpwent(), etc_sysconfdir(), etc_systmpdir(), NULL, rb_define_const(), rb_define_module(), rb_define_module_function(), rb_define_singleton_method(), rb_extend_object(), rb_mEnumerable, rb_struct_define(), and sPasswd.

## Variable Documentation

VALUE sPasswd

static

Definition at line 26 of file etc.c.

Referenced by Init_etc().