diff options
author | 2018-04-17 13:04:42 +0300 | |
---|---|---|
committer | 2018-04-17 13:04:42 +0300 | |
commit | 955c96410a10cbba1999df658404fcdbcdee0ee3 (patch) | |
tree | 67e666dfc530d501866f0771d4558561ab89aa5b /src/server/net.h | |
parent | 051b90d9555360bccf754e084219e31294b420ca (diff) | |
download | coffeetemp-955c96410a10cbba1999df658404fcdbcdee0ee3.tar.gz coffeetemp-955c96410a10cbba1999df658404fcdbcdee0ee3.tar.bz2 coffeetemp-955c96410a10cbba1999df658404fcdbcdee0ee3.zip |
server: split away networking code.
Diffstat (limited to 'src/server/net.h')
-rw-r--r-- | src/server/net.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/server/net.h b/src/server/net.h new file mode 100644 index 0000000..57c17f6 --- /dev/null +++ b/src/server/net.h @@ -0,0 +1,36 @@ +/* + * Hot Beverage Companion – desktop app network module + * + * Copyright (C) 2017 Gediminas Jakutis + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; version 2.1 + * of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#ifndef NET_H_INCLUDED +#define NET_H_INCLUDED + +#define NET_ERROR -1 +#define NET_OK 0 +#define NET_NONEWDATA 1 +#define NET_DEAD 2 + +struct netstate { + int (*getlastdata)(char * const data, struct netstate * const state); +}; + +struct netstate *net_init(const unsigned int port); +int net_close(struct netstate **state); + +#endif /* NET_H_INCLUDED */ |