home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk22
/
dir04
/
f011290.re_
/
f011290.re
Wrap
Text File
|
1996-04-02
|
6KB
|
193 lines
/*----------------------------------------------------------------------+
| |
| Copyright (c) 1985-93; Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley |
| Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| extern.h -- describes how MicroStation interacts with external |
| programs. |
| |
| $Workfile: msextern.h $
| $Revision: 6.4 $
| $Date: 11 Apr 1995 14:41:40 $
| |
+----------------------------------------------------------------------*/
#ifndef __msexternH__
#define __msexternH__
/* .h File Dependencies */
#ifndef __basedefsH__
#include <basedefs.h>
#endif
#ifndef __msdefsH__
#include <msdefs.h>
#endif
#ifndef __basetypeH__
#include <basetype.h>
#endif
/*----------------------------------------------------------------------+
| |
| Defines |
| |
+----------------------------------------------------------------------*/
#if defined (mdl) || !defined (unix)
#define IPC_NOWAIT 1
#endif
#define EXTP_KEY_GENERATE 0
#define EXTP_NAME_SIZE 20
/* Operators for mdlExternal_queueGet */
#define EXTP_QUEUE_ATTACH 1
#define EXTP_QUEUE_CREATE 2
/* Status for MsgQDescr */
#define EXTP_QUEUE_INUSE 1
#define EXTP_QUEUE_FREE 2
/* Message types */
#define EXTP_FOR_MDL 1
#define EXTP_FOR_APPL 3
#define EXTP_STATUS_NOTIFIED -2
#define EXTP_STATUS_TERMINATED -1
#define EXTP_STATUS_ACTIVE 1
/* Parameters for mdlExternal_setQueueProperty */
#if defined (unix)
# define EXTP_PROPERTY_REMOVE 1 /* Remove when the queue is closed */
# define EXTP_PROPERTY_SEND_TYPE 2
# define EXTP_PROPERTY_RECEIVE_TYPE 3
#endif
#define EXTP_PROPERTY_ASYNCH_RECEIVE 4
#if defined (pm386)
/* Declare the shared memory storage class. */
#define SHMEM_SC _far
#else
#define SHMEM_SC
#endif
/*----------------------------------------------------------------------+
| |
| Typedefs |
| |
+----------------------------------------------------------------------*/
typedef long msgqID_t;
#if defined (unix)
# if !defined (mdl)
# include <sys/types.h>
/* unix gets undef'ed on the HP */
# if !defined (unix)
# define unix 1
# endif
# else
typedef long key_t;
# endif
#endif
#if defined (macintosh)
# if !defined (mdl)
# include <Processes.h>
# else
/* can't include Processes.h, so define ProcessSerialNumber here */
typedef struct processserialnumber
{
unsigned long highLongOfPSN;
unsigned long lowLongOfPSN;
} ProcessSerialNumber;
# endif
#endif
#if defined (unix)
typedef long ProcessID;
typedef key_t IPCKey;
#elif defined (msdos)
typedef long ProcessID;
typedef long IPCKey;
#elif defined (macintosh)
typedef ProcessSerialNumber ProcessID;
typedef long IPCKey;
#elif defined (vax)
typedef long ProcessID;
typedef long IPCKey;
#elif defined (winNT)
typedef ULong ProcessID;
typedef ULong IPCKey;
#elif defined (os2)
typedef ULong ProcessID;
typedef ULong IPCKey;
#else
typedef long ProcessID;
typedef key_t IPCKey;
#endif
typedef struct mdlmessage
{
long mtype;
long msglength; /* number of bytes in request mtext */
ProcessID sendpid; /* filled in by MDL. */
long reqtype; /* request type */
char mtext [1];
} ExternalMessage;
typedef struct mdlmsghdr
{
long mtype;
long msglength; /* number of bytes in request mtext */
ProcessID sendpid; /* filled in by MDL. */
long reqtype; /* request type */
} ExternalMsgHeader;
typedef struct MSexternalProgramDescr
{
char name[MAXFILELENGTH]; /* child program's name */
char *pCommandLine;
ProcessID pid; /* process id that we started */
char status; /* negative means the program
has terminated. Set to one of
the EXTP_STATUS_ flags. */
int exitStatus;
} MSExternalProgramDescr;
typedef struct MSmsgqDescr
{
IPCKey messageKey; /* key for msg queue to/from process */
char externalName[EXTP_NAME_SIZE]; /* Name used for external
programs to get access. */
int msgqID; /* message queue id */
byte status;
byte rcvType;
} MSMsgqDescr;
typedef struct MSshmemDescr
{
char *psharedMem;
IPCKey shmemKey; /* name to pass to process */
char externalName [EXTP_NAME_SIZE]; /* Name used for external
programs to get access. */
int shmemID; /* shared memory id */
byte status;
#if defined (pm386) && !defined (mdl) && !defined (ORACLEDOS)
SHMEM_SC char *shMemFP; /* far pointer to shared memory */
#endif
} MSShmemDescr;
#endif