PageRenderTime 56ms CodeModel.GetById 35ms app.highlight 20ms RepoModel.GetById 0ms app.codeStats 0ms

/packages/libc/src/grph.inc

https://github.com/slibre/freepascal
Pascal | 45 lines | 33 code | 9 blank | 3 comment | 0 complexity | 61badfe381d5d16a0a278c7e0ede4587 MD5 | raw file
Possible License(s): LGPL-2.0, LGPL-2.1, LGPL-3.0
 1
 2type
 3   Pgroup = ^group;
 4   group = record
 5        gr_name : Pchar;
 6        gr_passwd : Pchar;
 7        gr_gid : __gid_t;
 8        gr_mem : ^Pchar;
 9     end;
10   PPgroup = ^Pgroup;
11
12procedure setgrent;cdecl;external clib name 'setgrent';
13procedure endgrent;cdecl;external clib name 'endgrent';
14function getgrent:Pgroup;cdecl;external clib name 'getgrent';
15function fgetgrent(__stream:PFILE):Pgroup;cdecl;external clib name 'fgetgrent';
16function putgrent(__p:Pgroup; __f:PFILE):longint;cdecl;external clib name 'putgrent';
17function getgrgid(__gid:__gid_t):Pgroup;cdecl;external clib name 'getgrgid';
18function getgrnam(__name:Pchar):Pgroup;cdecl;external clib name 'getgrnam';
19
20const
21   NSS_BUFLEN_GROUP = 1024;
22
23function getgrent_r(__resultbuf:Pgroup; __buffer:Pchar; __buflen:size_t; __result:PPgroup):longint;cdecl;external clib name 'getgrent_r';
24function getgrgid_r(__gid:__gid_t; __resultbuf:Pgroup; __buffer:Pchar; __buflen:size_t; __result:PPgroup):longint;cdecl;external clib name 'getgrgid_r';
25function getgrnam_r(__name:Pchar; __resultbuf:Pgroup; __buffer:Pchar; __buflen:size_t; __result:PPgroup):longint;cdecl;external clib name 'getgrnam_r';
26function fgetgrent_r(__stream:PFILE; __resultbuf:Pgroup; __buffer:Pchar; __buflen:size_t; __result:PPgroup):longint;cdecl;external clib name 'fgetgrent_r';
27function setgroups(__n:size_t; __groups:P__gid_t):longint;cdecl;external clib name 'setgroups';
28function getgrouplist(__user:Pchar; __group:__gid_t; __groups:P__gid_t; __ngroups:Plongint):longint;cdecl;external clib name 'getgrouplist';
29function initgroups(__user:Pchar; __group:__gid_t):longint;cdecl;external clib name 'initgroups';
30
31
32{ ---------------------------------------------------------------------
33    Borland compatibility types
34  ---------------------------------------------------------------------}
35
36Type
37  TGroup = group;
38
39function putgrent(const __p: group; __f:PFILE):longint;cdecl;external clib name 'putgrent';
40function getgrent_r(var __resultbuf: group; __buffer:Pchar; __buflen:size_t; var __result: Pgroup):longint;cdecl;external clib name 'getgrent_r';
41function getgrgid_r(__gid:__gid_t; var __resultbuf:group; __buffer:Pchar; __buflen:size_t; var __result:Pgroup):longint;cdecl;external clib name 'getgrgid_r';
42function getgrnam_r(__name:Pchar; var __resultbuf:group; __buffer:Pchar; __buflen:size_t; var __result:Pgroup):longint;cdecl;external clib name 'getgrnam_r';
43function fgetgrent_r(__stream:PFILE; var __resultbuf:group; __buffer:Pchar; __buflen:size_t; var __result:Pgroup):longint;cdecl;external clib name 'fgetgrent_r';
44function getgrouplist(__user:Pchar; __group:__gid_t; var __groups: __gid_t; var __ngroups:longint):longint;cdecl;external clib name 'getgrouplist';
45