/* ************************************************************************** * Copyright (C) 1990 by * * DIGITAL Equipment Corporation, Maynard, Mass. * * * * This software is furnished under a license and may be used and copied * * only in accordance with the terms of such license and with the * * inclusion of the above copyright notice. This software or any other * * copies thereof may not be provided or otherwise made available to any * * other person. No title to or ownership of the software is hereby * * transferred. * * * * The information in this software is subject to change without notice * * and should not be construed as a commitment by DIGITAL Equipment * * Corporation. * * * * DIGITAL assumes no responsibility for the use or reliability of its * * software on equipment which is not supplied by DIGITAL. * * * ************************************************************************** */ /* * * FACILITY: * * DECnet-Vax OSI IPC Example Programs * * ABSTRACT: * * C language header file defining constants and data structures * used in the IPC example progams. * * AUTHOR: * * MwD * * CREATION DATE: Dec-1991 * * MODIFICATION HISTORY: * * X-00 MWD0000 MwD Dec-1991 * Creation. * */ #ifndef _IPC_DEF_ #define _IPC_DEF_ /* * Helpful notions. */ #define TRUE 1 #define FALSE 0 #define NULL 0 /* For empty pointers */ /* * Macros for status checking. For VMS, check low bit set for success. * For IPC calls, check the primary status field for VMS success. * On errors, exit the program immediately ( for IPC also dump the * secondary status ). */ #define VMS_OK( _x_ ) ((_x_ & 1) == 1) #define VMS_CHECK( _x_ ) if( !VMS_OK( _x_ ) ) exit( _x_ ); #define IPC_CHECK( _x_ ) if( ! VMS_OK( _x_.IPCB$L_STATUS ) ) { \ printf( "IPC secondary status = %d\n", _x_.IPCB$L_STATUS1 ); \ exit( _x_.IPCB$L_STATUS ); } /* * IPC Network Item List element */ #define IPC_K_ITEM_HDR_LENGTH 4 /* Tag = 2 bytes, length = 2 bytes */ typedef struct { unsigned short int length; unsigned short int tag; char value_buffer[]; } IPC_ITEM_T; /* * IPC Network Item List control structure for item_list__xxxx() routines */ #define IPC_K_ITEM_CNTRL_LENGTH 12 typedef struct { IPC_ITEM_T *next_item; /* Where next item should start */ unsigned short max_length; /* Max available list size */ unsigned short cur_length; /* Current length of item list */ char list_head[]; /* Start of item list */ } IPC_ITEM_LIST_T; /* * Return codes from the item_list__xxx() routines */ #define IPC_S_ITEM_SUCCESS 1 #define IPC_S_ITEM_NO_ROOM 2 #define IPC_S_ITEM_FAILED_FREE 4 #endif