mirror of
https://github.com/dhewm/dhewm3-libs.git
synced 2025-02-17 17:31:11 +00:00
that's almost recent and fixes building Yamagi Quake II (which supports using dhewm3-libs as YQUAKE2LIBS in its CMake build, esp. relevant when building with MSVC). This time it's build with Visual Studio 2019 instead of MinGW (`nmake /f Makefile.vc mode=dll` in VS developer console); the curl nmake files had to be adjusted a bit to output libcurl-4.dll instead of libcurl.dll (I didn't want to change the DLL name in dhewm3 builds), and libcurl-4.lib had to be manually renamed to libcurl.lib for the dhewm3 and YQ2 builds to still work. You may have to delete and recreate your existing CMake build directories if you used them with dhewm3-libs from before this commit. I successfully tested this with dhewm3 with both MinGW (YQ2 buildenv) and VS2019, 32bit (x86) and 64bit (x64), and Yamagi Quake II with VS2019 x86+x64 - apparently MinGW is happy to use the MSVC .lib file and doesn't require the .dll.a for linking. Thanks to Yamagi for giving me the curl builds so I could integrate them!
84 lines
2.7 KiB
C
84 lines
2.7 KiB
C
#ifndef CURLINC_WEBSOCKETS_H
|
|
#define CURLINC_WEBSOCKETS_H
|
|
/***************************************************************************
|
|
* _ _ ____ _
|
|
* Project ___| | | | _ \| |
|
|
* / __| | | | |_) | |
|
|
* | (__| |_| | _ <| |___
|
|
* \___|\___/|_| \_\_____|
|
|
*
|
|
* Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
|
|
*
|
|
* This software is licensed as described in the file COPYING, which
|
|
* you should have received as part of this distribution. The terms
|
|
* are also available at https://curl.se/docs/copyright.html.
|
|
*
|
|
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
|
|
* copies of the Software, and permit persons to whom the Software is
|
|
* furnished to do so, under the terms of the COPYING file.
|
|
*
|
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
|
* KIND, either express or implied.
|
|
*
|
|
* SPDX-License-Identifier: curl
|
|
*
|
|
***************************************************************************/
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct curl_ws_frame {
|
|
int age; /* zero */
|
|
int flags; /* See the CURLWS_* defines */
|
|
curl_off_t offset; /* the offset of this data into the frame */
|
|
curl_off_t bytesleft; /* number of pending bytes left of the payload */
|
|
size_t len; /* size of the current data chunk */
|
|
};
|
|
|
|
/* flag bits */
|
|
#define CURLWS_TEXT (1<<0)
|
|
#define CURLWS_BINARY (1<<1)
|
|
#define CURLWS_CONT (1<<2)
|
|
#define CURLWS_CLOSE (1<<3)
|
|
#define CURLWS_PING (1<<4)
|
|
#define CURLWS_OFFSET (1<<5)
|
|
|
|
/*
|
|
* NAME curl_ws_recv()
|
|
*
|
|
* DESCRIPTION
|
|
*
|
|
* Receives data from the websocket connection. Use after successful
|
|
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
|
*/
|
|
CURL_EXTERN CURLcode curl_ws_recv(CURL *curl, void *buffer, size_t buflen,
|
|
size_t *recv,
|
|
struct curl_ws_frame **metap);
|
|
|
|
/* sendflags for curl_ws_send() */
|
|
#define CURLWS_PONG (1<<6)
|
|
|
|
/*
|
|
* NAME curl_easy_send()
|
|
*
|
|
* DESCRIPTION
|
|
*
|
|
* Sends data over the websocket connection. Use after successful
|
|
* curl_easy_perform() with CURLOPT_CONNECT_ONLY option.
|
|
*/
|
|
CURL_EXTERN CURLcode curl_ws_send(CURL *curl, const void *buffer,
|
|
size_t buflen, size_t *sent,
|
|
curl_off_t framesize,
|
|
unsigned int sendflags);
|
|
|
|
/* bits for the CURLOPT_WS_OPTIONS bitmask: */
|
|
#define CURLWS_RAW_MODE (1<<0)
|
|
|
|
CURL_EXTERN struct curl_ws_frame *curl_ws_meta(CURL *curl);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* CURLINC_WEBSOCKETS_H */
|