summaryrefslogtreecommitdiffstats
path: root/Kod/display/ClientServerApp/Common/ipclink.h
blob: d62429e2c945f2b3819d55d0a421f926c77f9037 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 * ipclink.h
 *
 * Interface for the shared memory communication
 *
 *      Author: Erik Hellström, hellstrom@isy.liu.se, 2008-12-14
 *    Modified: Emil Larsson, lime@isy.liu.se, 2012-01-13
 */

#ifndef IPCLINK_H_
#define IPCLINK_H_

// Include files for sleep-functions
#include <windows.h>

//
// Shared data description
//

// Keys
#define COM_KEY  {3,1,4,6}

// Define what is returned from wait operations
typedef unsigned int WaitResult;
#define WAIT_OK    0
#define WAIT_FAIL  1
#define WAIT_CLOSE 2

// Definition of flags
typedef unsigned int FlagType;
#define NULL_FLAG 0

// Exit flags
#define EXIT_OK   0
#define EXIT_FAIL 1

//
// COMMON DATA
//
typedef struct structCommonData {
	FlagType Flag;    // State flag
	bool DoShutdown;  // Shutdown flag
} CommonData;

//
// Length of <DC1>, len, and bcc 
// see manual for "smallprotocol package".
//
#define EXTRA_LEN 3


//
// COM CONDUIT
//
// Maximum string length
//#define COMSTR_LEN 512
// EXTRA_LEN is included
#define COMSTR_LEN 131
 


// Shared memory structure
typedef struct {
	CommonData Common; // Common data
	wchar_t string[COMSTR_LEN]; // Data string
} COMdata;

// Flags
//#define COM_FLAG   0x01 // Example flag
// Events
#define COM_NEVENTS 2 // Number of events
#define COM_READY   0 // Ready
#define COM_REQUEST 1 // Request

// Define sleep function
#define msleep(t) Sleep(t)



#endif /* IPCLINK_H_ */