~ubuntu-branches/ubuntu/vivid/gcl/vivid

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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef _GUIS_H_
#define _GUIS_H_

#include <stdlib.h>

#include "include.h"

#ifdef NeXT
typedef int pid_t;
#endif

#ifndef _ANSI_ARGS_
#ifdef __STDC__
#define _ANSI_ARGS_(x) x
#else
#define _ANSI_ARGS_(x) ()
#endif
#endif

#define STRING_HEADER_FORMAT	"%4.4d"
#define CB_STRING_HEADER	(5)
/*
#define GET_STRING_SIZE_FROM_HEADER(__buf, __plgth)	\
sscanf(__buf, STRING_HEADER_FORMAT, __plgth);
*/

/* sscanf is braindead on SunOS */
#define GET_STRING_SIZE_FROM_HEADER(__buf, __plgth)	\
{\
   __buf[CB_STRING_HEADER - 1] = 0;\
   *__plgth = atoi(__buf);\
   __buf[4] = '';\
}

/* need to have opportunity to collapse message to reduce trafic */
#define MSG_STRAIGHT_TCL_CMD		0
#define MSG_CREATE_COMMAND	1
/*
#define MSG_
*/

typedef struct _guiMsg {

  pid_t pidSender;
  int vMajor;
  int vMinor;
  int idx;
  int fSignal;
  int fAck;
  int IdMsg;
  char *szData;
  char *szMsg;

} guiMsg;

#define MSG_IDX(__p)			(__p->idx)
#define MSG_COMMAND(__p)		(__p->IdMsg)
#define MSG_NEED_ACK(__p)		(__p->fAck)
#define MSG_NEED_SIGNAL_PARENT(__p)	(__p->fSignal)
#define MSG_TCL_STR(__p)		(__p->szData)
#define MSG_DATA_STR(__p)		(__p->szData)
/*
#define MSG_(__p)		(__p->)
*/

#include "sheader.h"
struct message_header * guiParseMsg1();


extern pid_t parent;

struct connection_state *
sock_connect_to_name();
void sock_close_connection( );
int sock_read_str();

guiMsg *guiParseMsg();
void guiFreeMsg();

void
guiCreateThenBindCallback();
int guiBindCallback();

#endif

int
sock_write_str2(struct connection_state *,enum mtype, char *,
		int,const char *,int);


object
fSclear_connection(fixnum);


object
fScheck_fd_for_input(fixnum,fixnum);

#define SI_makefun(a_,b_,c_)