Merge branch 'pu'
[jungerl.git] / lib / posix_drv / c_src / posix_drv.h
blob8143b2f48b46710e082c4854b4ac419dfa1595e0
1 /*
2 ** Copyright (c) 2003, Scott Lystig Fritchie. All rights reserved.
3 ** See the file "../LICENSE" for license details.
4 **
5 ** NOTICE: This file was generated by the tools of the Erlang Driver
6 ** toolkit. Do not edit this file by hand unless you know
7 ** what you're doing!
8 **
9 */
11 #ifndef __POSIX_DRV_H
12 #define __POSIX_DRV_H
14 #ifdef DRIVER_USING_PTHREADS
15 #include <pthread.h>
16 #endif /* DRIVER_USING_PTHREADS */
19 ** Driver<->emulator communication codes (xref with top of posix_drv.hrl)
22 #define _DEBUG 0
23 #define _GETGID 1
24 #define _GETEGID 2
25 #define _GETGRNAM 3
26 #define _GETGRGID 4
27 #define _GETGROUPS 5
28 #define _GETPWNAM 6
29 #define _GETPWUID 7
30 #define _GETUID 8
31 #define _GETEUID 9
32 #define _GETLOGIN 10
33 #define _GETPGRP 11
34 #define _GETPPID 12
35 #define _GETSID 13
36 #define _KILL 14
37 #define _LSTAT 15
38 #define _MKFIFO 16
39 #define _MKNOD 17
40 #define _UMASK 18
43 ** Constants
47 #define MAX_BINVS 24 /* QQQ dumb const! */
49 #define VALMAP_INUSE 0x01
50 #define VALMAP_DELAYED_CLEANUP 0x02
53 ** descriptor_t = general state for the port
57 struct descriptor {
58 ErlDrvPort port;
59 unsigned short nextxid; /* Call txn ID for very async calls */
63 ** callstate_t: asychronous call state
65 ** TODO: Fill in the struct members of "i" and "o" below.
67 typedef struct callstate {
68 struct callstate *next;
69 int cmd; /* call/command # */
70 #define XXXKEY ((void *) 1)
71 unsigned int *key; /* Not really used */
72 void (*invoke)(void *);
73 void (*free)(void *);
74 unsigned short xid; /* Only used by as_control()-
75 initiated funcs */
77 ** Input & output args use a struct simply for convenient
78 ** naming & grouping. There isn't any attempt to get smart about
79 ** using a union or anything like that to avoid bloating the size
80 ** of these structs with the combined args of a zillion different
81 ** functions. QQQ For future use: look into the use of unions
82 ** and/or different flavors of callstate_t to avoid structure bloat.
84 struct {
85 char * name;
86 gid_t gid;
87 char * login;
88 uid_t uid;
89 pid_t pid;
90 int sig;
91 char * path;
92 mode_t mode;
93 dev_t dev;
94 mode_t numask;
95 } i;
96 struct {
97 int __expect;
98 int __expect_errval;
99 gid_t ret_gid_t; /* XXX 1 */
100 struct group * ret_grptr; /* XXX 1 */
101 int ret_int; /* XXX 1 */
102 struct passwd * ret_pwptr; /* XXX 1 */
103 uid_t ret_uid_t; /* XXX 1 */
104 char * ret_char_p; /* XXX 1 */
105 pid_t ret_pid_t; /* XXX 1 */
106 gid_t gidset[NGROUPS_MAX];
107 struct stat sb;
108 } o;
109 } callstate_t;
112 ** End of autogenerated code
113 ** script = ../../edtk/c_h_template.gsl
114 ** filename = posix.xml
115 ** gslgen version = 2.000 Beta 1
116 ** date = 2003/05/09
117 ** time = 22:42:08
120 #endif /* __POSIX_DRV_H */