Skip to content

Commit 125e47a

Browse files
committed
fixup! Adapt control API from NFLua
1 parent 11108c6 commit 125e47a

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

lib/lunatik.h

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -27,38 +27,38 @@
2727
#include "../lunatik_conf.h"
2828

2929
enum callback_result {
30-
CB_SUCCESS,
31-
CB_ERROR,
32-
CB_EMPTY_RESULT,
33-
CB_LIST_EMPTY,
34-
CB_STATE_NOT_FOUND,
30+
CB_SUCCESS,
31+
CB_ERROR,
32+
CB_EMPTY_RESULT,
33+
CB_LIST_EMPTY,
34+
CB_STATE_NOT_FOUND,
3535
};
3636

3737
enum session_status {
38-
SESSION_FREE,
39-
SESSION_RECEIVING,
38+
SESSION_FREE,
39+
SESSION_RECEIVING,
4040
};
4141

4242
struct data_buffer {
43-
char *buffer;
44-
int size;
43+
char *buffer;
44+
int size;
4545
};
4646

4747
struct lunatik_nl_state {
48-
struct lunatik_session *session;
49-
struct nl_sock *send_datasock;
50-
struct nl_sock *recv_datasock;
51-
struct nl_sock *control_sock;
52-
struct data_buffer data_buffer;
53-
enum callback_result cb_result;
54-
uint32_t maxalloc;
55-
uint32_t curralloc;
56-
char name[LUNATIK_NAME_MAXSIZE];
48+
struct lunatik_session *session;
49+
struct nl_sock *send_datasock;
50+
struct nl_sock *recv_datasock;
51+
struct nl_sock *control_sock;
52+
struct data_buffer data_buffer;
53+
enum callback_result cb_result;
54+
uint32_t maxalloc;
55+
uint32_t curralloc;
56+
char name[LUNATIK_NAME_MAXSIZE];
5757
};
5858

5959
struct states_list {
60-
struct lunatik_nl_state *states;
61-
size_t list_size;
60+
struct lunatik_nl_state *states;
61+
size_t list_size;
6262
};
6363

6464
struct received_buffer {
@@ -67,26 +67,26 @@ struct received_buffer {
6767
};
6868

6969
struct lunatik_session {
70-
struct nl_sock *control_sock;
71-
struct states_list states_list;
72-
struct received_buffer recv_buffer;
73-
struct lunatik_nl_state state_holder;
74-
enum session_status status;
75-
enum callback_result cb_result;
76-
int family;
77-
int control_fd;
78-
int data_fd;
79-
uint32_t pid;
70+
struct nl_sock *control_sock;
71+
struct states_list states_list;
72+
struct received_buffer recv_buffer;
73+
struct lunatik_nl_state state_holder;
74+
enum session_status status;
75+
enum callback_result cb_result;
76+
int family;
77+
int control_fd;
78+
int data_fd;
79+
uint32_t pid;
8080
};
8181

8282
static inline int lunatikS_getfd(const struct lunatik_session *session)
8383
{
84-
return session->control_fd;
84+
return session->control_fd;
8585
}
8686

8787
static inline int lunatikS_isopen(const struct lunatik_session *session)
8888
{
89-
return session->control_fd >= 0;
89+
return session->control_fd >= 0;
9090
}
9191

9292
int lunatikS_init(struct lunatik_session *session);
@@ -98,7 +98,7 @@ int lunatikS_newstate(struct lunatik_session *session, struct lunatik_nl_state *
9898
int lunatik_closestate(struct lunatik_nl_state *state);
9999

100100
int lunatik_dostring(struct lunatik_nl_state *state,
101-
const char *script, const char *script_name, size_t total_code_size);
101+
const char *script, const char *script_name, size_t total_code_size);
102102

103103
int lunatikS_list(struct lunatik_session *session);
104104

@@ -109,7 +109,7 @@ int lunatik_initstate(struct lunatik_nl_state *state);
109109
struct lunatik_nl_state *lunatikS_getstate(struct lunatik_session *session, const char *name);
110110

111111
int lunatik_datasend(struct lunatik_nl_state *state,
112-
const char *payload, size_t len);
112+
const char *payload, size_t len);
113113

114114
int lunatik_getcurralloc(struct lunatik_nl_state *state);
115115

0 commit comments

Comments
 (0)