File: defines.h

package info (click to toggle)
libopenobex 1.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, stretch
  • size: 972 kB
  • ctags: 1,552
  • sloc: ansic: 9,988; xml: 407; makefile: 96
file content (47 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (2)
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
#ifndef OPENOBEX_DEFINES_H
#define OPENOBEX_DEFINES_H

#include <inttypes.h>
#include <stdbool.h>

#ifdef TRUE
#undef TRUE
#endif
#define TRUE true

#ifdef FALSE
#undef FALSE
#endif
#define FALSE false

enum result_type {
	RESULT_ERROR = -1,
	RESULT_TIMEOUT = 0,
	RESULT_SUCCESS = 1,
};
typedef enum result_type result_t;

#define obex_return_if_fail(test) \
        do { if (!(test)) return; } while(0)
#define obex_return_val_if_fail(test, val) \
        do { if (!(test)) return val; } while(0)

#define OBEX_VERSION	0x10      /* OBEX Protocol Version 1.1 */

enum obex_state {
	STATE_IDLE,
	STATE_REQUEST,
	STATE_RESPONSE,
	STATE_ABORT,
};

enum obex_substate {
	SUBSTATE_RX,
	SUBSTATE_TX_PREPARE,
	SUBSTATE_TX,
};

#define OBEX_SRM_FLAG_WAIT_LOCAL  (1 << 0)
#define OBEX_SRM_FLAG_WAIT_REMOTE (1 << 1)

#endif