Permalink
Fetching contributors…
Cannot retrieve contributors at this time
109 lines (94 sloc) 3.06 KB
/*
** Copyright (c) 2004, Scott Lystig Fritchie. All rights reserved.
** See the file "LICENSE" at the top of the source distribution for
** full license terms.
**
** NOTICE: This file was generated by the tools of the Erlang Driver
** toolkit. Do not edit this file by hand unless you know
** what you're doing!
**
*/
#ifndef __UNIXDOM_DRV_H
#define __UNIXDOM_DRV_H
#ifdef DRIVER_USING_PTHREADS
#include <pthread.h>
#endif /* DRIVER_USING_PTHREADS */
/*
** Driver<->emulator communication codes (xref with top of unixdom_drv.hrl)
*/
#define S1_DEBUG 0
#define S1_NULL 1
#define S1_OPEN 2
#define S1_GETFD 3
#define S1_SENDFD 4
#define S1_RECEIVEFD 5
#define S1_CLOSE 6
#define S1_WRITE 7
#define S1_READ 8
/*
** Constants
*/
#define MAX_BINVS 24 /* XXX dumb constant! */
#define VALMAP_INUSE 0x01
#define VALMAP_DELAYED_CLEANUP 0x02
#define MAX_RETURN_TERMS 64
/*
** descriptor_t = general state for the port
**
*/
struct descriptor {
ErlDrvPort port;
unsigned short nextxid; /* Call txn ID for very async calls */
int valmap_fd[32];
ErlDrvBinary *tofree[MAX_RETURN_TERMS];
int num_tofree;
};
/*
** callstate_t: asychronous call state
**
** TODO: Fill in the struct members of "i" and "o" below.
*/
typedef struct callstate {
struct callstate *next;
int cmd; /* call/command # */
unsigned int *key; /* Not really used */
void (*invoke)(void *);
void (*free)(void *);
unsigned short xid; /* Only used by as_control()-
initiated funcs */
/*
** Input & output args use a struct simply for convenient
** naming & grouping. There isn't any attempt to get smart about
** using a union or anything like that to avoid bloating the size
** of these structs with the combined args of a zillion different
** functions. XXX For future use: look into the use of unions
** and/or different flavors of callstate_t to avoid structure bloat.
*/
struct {
int __valmap_fd_index;
unsigned long __stash[3];
char * filename;
int flags;
int fd;
int unixdom_fd;
int fd_to_be_sent;
char * ptr;
size_t size;
} i;
struct {
int __expect;
int __expect_errval;
int ret_int;
int ret_int_t;
ssize_t ret_ssize_t;
} o;
} callstate_t;
/*
** End of autogenerated code
** script = ../../edtk/c_h_template.gsl
** filename = unixdom.xml
** gslgen version = 2.000 Beta 1
** date = 2004/02/23
** time = 2:24:55
*/
#endif /* __UNIXDOM_DRV_H */