/***********************************************************************
* *
* This software is part of the ast package *
* Copyright (c) 1990-2011 AT&T Intellectual Property *
* and is licensed under the *
* Eclipse Public License, Version 1.0 *
* by AT&T Intellectual Property *
* *
* A copy of the License is available at *
* (with md5 checksum b35adb5213ca9657e911e9befb180842) *
* *
* Information and Software Systems Research *
* AT&T Research *
* Florham Park NJ *
* *
* Glenn Fowler <gsf@research.att.com> *
* *
***********************************************************************/
#pragma prototyped
/*
* syscall message interface
*/
#ifndef _MSG_H
#define _MSG_H
#include <ast.h>
/* common fd variants */
/* common ipc variants */
/* common symbolic variants */
typedef struct
{
} Msg_file_t;
typedef union
{
long* array;
unsigned long number;
char* pointer;
char* string;
char** vector;
} Msg_arg_t;
typedef union
{
unsigned long number;
} Msg_return_t;
typedef struct
{
int version;
unsigned long call;
unsigned long channel;
unsigned long stamp;
struct
{
unsigned long addr;
unsigned long port;
} ack;
int argc;
} Msg_call_t;
typedef struct
{
int timeout;
int timestamp;
} Msg_info_t;
#if _BLD_cs && defined(__EXPORT__)
#define extern __EXPORT__
#endif
#if !_BLD_cs && defined(__IMPORT__)
#define extern extern __IMPORT__
#endif
extern Msg_info_t msg_info;
#undef extern
#ifndef msgreserve
#define msgreserve(p)
#endif
#define msggetsize(p) ((((p)[0]&((1<<MSG_SIZE_BITS)-1))<<MSG_SIZE_BITS)|((p)[1]&((1<<MSG_SIZE_BITS)-1)))
#define msgsetsize(p,n) ((p)[0]=((n)>>MSG_SIZE_BITS)&((1<<MSG_SIZE_BITS)-1),(p)[1]=(n)&((1<<MSG_SIZE_BITS)-1))
#if _BLD_cs && defined(__EXPORT__)
#define extern __EXPORT__
#endif
extern int msggetmask(char*, int, unsigned long);
extern int msgindex(const char*);
extern const char* msgname(unsigned long);
extern unsigned long msgsetmask(const char*);
extern unsigned long msggetu(char**, char*);
extern int msgputu(char**, char*, unsigned long);
extern long msgreturn(int, unsigned long, ...);
extern long msgvreturn(int, unsigned long, void**, va_list);
#undef extern
#endif