Debian Codegraph @

ax25/axgetput/proto_bin.h

raw
1 /*
2 * (c) 2002 Thomas Osterried DL9SAU <[email protected]>
3 * License: GPL. See http://www.fsf.org/
4 * Sources: http://x-berg.in-berlin.de/cgi-bin/viewcvs.cgi/ampr/axgetput/
5 */
6
7 #ifndef PROTO_BIN_H
8 #define PROTO_BIN_H
9
10 extern int bget(void);
11 extern int bput(void);
12
13 static const char bin_s_on_ok[] = "#OK#\r";
14 static const int bin_len_ok = sizeof(bin_s_on_ok)-1;
15 static const char bin_s_on_no[] = "#NO#\r";
16 static const int bin_len_no = sizeof(bin_s_on_no)-1;
17 static const char bin_s_on_abort[] = "#ABORT#\r";
18 static const int bin_len_abort = sizeof(bin_s_on_abort)-1;
19
20 #define bin_send_no_on_sig "\r#NO#\r"
21 #define bin_send_abort_on_sig "\r#ABORT#\r"
22
23 #define IS_BIN_NO(s, len) \
24 len == bin_len_no && !memcmp(s, bin_s_on_no, bin_len_no)
25
26 #define IS_BIN_OK(s, len) \
27 len == bin_len_ok && !memcmp(s, bin_s_on_ok, bin_len_ok)
28
29 #define IS_BIN_ABORT(s, len) \
30 len == bin_len_abort && !memcmp(s, bin_s_on_abort, bin_len_abort)
31
32 #endif /* PROTO_BIN_H */