Blame


1 b42d807f 2023-09-02 op /*
2 b42d807f 2023-09-02 op * This is free and unencumbered software released into the public domain.
3 b42d807f 2023-09-02 op *
4 b42d807f 2023-09-02 op * Anyone is free to copy, modify, publish, use, compile, sell, or
5 b42d807f 2023-09-02 op * distribute this software, either in source code form or as a compiled
6 b42d807f 2023-09-02 op * binary, for any purpose, commercial or non-commercial, and by any
7 b42d807f 2023-09-02 op * means.
8 b42d807f 2023-09-02 op *
9 b42d807f 2023-09-02 op * In jurisdictions that recognize copyright laws, the author or authors
10 b42d807f 2023-09-02 op * of this software dedicate any and all copyright interest in the
11 b42d807f 2023-09-02 op * software to the public domain. We make this dedication for the benefit
12 b42d807f 2023-09-02 op * of the public at large and to the detriment of our heirs and
13 b42d807f 2023-09-02 op * successors. We intend this dedication to be an overt act of
14 b42d807f 2023-09-02 op * relinquishment in perpetuity of all present and future rights to this
15 b42d807f 2023-09-02 op * software under copyright law.
16 b42d807f 2023-09-02 op *
17 b42d807f 2023-09-02 op * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 b42d807f 2023-09-02 op * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 b42d807f 2023-09-02 op * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 b42d807f 2023-09-02 op * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 b42d807f 2023-09-02 op * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 b42d807f 2023-09-02 op * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 b42d807f 2023-09-02 op * OTHER DEALINGS IN THE SOFTWARE.
24 b42d807f 2023-09-02 op */
25 b42d807f 2023-09-02 op
26 b42d807f 2023-09-02 op enum {
27 b42d807f 2023-09-02 op WST_UNKNOWN = -1,
28 b42d807f 2023-09-02 op WST_CONT = 0x00,
29 b42d807f 2023-09-02 op WST_TEXT = 0x01,
30 b42d807f 2023-09-02 op WST_BINARY = 0x02,
31 b42d807f 2023-09-02 op WST_CLOSE = 0x08,
32 b42d807f 2023-09-02 op WST_PING = 0x09,
33 b42d807f 2023-09-02 op WST_PONG = 0x0A,
34 b42d807f 2023-09-02 op };
35 b42d807f 2023-09-02 op
36 b42d807f 2023-09-02 op struct client;
37 b42d807f 2023-09-02 op
38 b42d807f 2023-09-02 op int ws_accept_hdr(const char *, char *, size_t);
39 b42d807f 2023-09-02 op int ws_read(struct client *, int *, size_t *);
40 b42d807f 2023-09-02 op int ws_compose(struct client *, int, const void *, size_t);