12 #include "../common/common.h"
16 static int ipc_unmarshall_a
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
17 static int ipc_unmarshall_12
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
18 static int ipc_unmarshall
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
19 static int ipc_unmarshall_ab1
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
20 static int ipc_unmarshall_1a
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
21 static int ipc_unmarshall_1
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
22 static int ipc_unmarshall_123
__P((IPVIWIN
*, IP_BUF
*, IPFunc
));
24 #define OFFSET(t,m) ((size_t)&((t *)0)->m)
26 IPFUNLIST
const ipfuns
[] = {
28 {"a", ipc_unmarshall_a
, OFFSET(IPSIOPS
, addstr
)},
30 {"12", ipc_unmarshall_12
, OFFSET(IPSIOPS
, attribute
)},
32 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, bell
)},
34 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, busy_off
)},
36 {"a", ipc_unmarshall_a
, OFFSET(IPSIOPS
, busy_on
)},
38 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, clrtoeol
)},
40 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, deleteln
)},
42 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, discard
)},
44 {"ab1", ipc_unmarshall_ab1
, OFFSET(IPSIOPS
, editopt
)},
46 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, insertln
)},
48 {"12", ipc_unmarshall_12
, OFFSET(IPSIOPS
, move
)},
50 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, quit
)},
52 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, redraw
)},
54 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, refresh
)},
56 {"a", ipc_unmarshall_a
, OFFSET(IPSIOPS
, rename
)},
60 {"1", ipc_unmarshall_1
, OFFSET(IPSIOPS
, rewrite
)},
62 {"123", ipc_unmarshall_123
, OFFSET(IPSIOPS
, scrollbar
)},
64 {"a", ipc_unmarshall_a
, OFFSET(IPSIOPS
, select
)},
66 {"", ipc_unmarshall
, OFFSET(IPSIOPS
, split
)},
68 {"a", ipc_unmarshall_a
, OFFSET(IPSIOPS
, waddstr
)},
73 ipc_unmarshall_a(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
75 return ((IPFunc_a
)func
)(ipvi
, ipb
->str1
, ipb
->len1
);
79 ipc_unmarshall_12(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
81 return ((IPFunc_12
)func
)(ipvi
, ipb
->val1
, ipb
->val2
);
85 ipc_unmarshall(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
91 ipc_unmarshall_ab1(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
93 return ((IPFunc_ab1
)func
)(ipvi
, ipb
->str1
, ipb
->len1
, ipb
->str2
, ipb
->len2
, ipb
->val1
);
97 ipc_unmarshall_1a(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
99 return ((IPFunc_1a
)func
)(ipvi
, ipb
->val1
, ipb
->str1
, ipb
->len1
);
103 ipc_unmarshall_1(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
105 return ((IPFunc_1
)func
)(ipvi
, ipb
->val1
);
109 ipc_unmarshall_123(IPVIWIN
*ipvi
, IP_BUF
*ipb
, IPFunc func
)
111 return ((IPFunc_123
)func
)(ipvi
, ipb
->val1
, ipb
->val2
, ipb
->val3
);