ktcc: rollback to r9529

git-svn-id: svn://kolibrios.org@9558 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
turbocat
2022-01-02 12:16:17 +00:00
parent 5c8619e65c
commit e08c6968ef
357 changed files with 17300 additions and 456 deletions

View File

@@ -5,10 +5,11 @@
Adapted for TCC's dynamic API by Magomed Kostoev, 2020
*/
#ifndef KOLIBRI_HTTP_H
#define KOLIBRI_HTTP_H
#ifndef _HTTP_H_
#define _HTTP_H_
#include <stddef.h>
#define cdecl __attribute__ ((cdecl))
#define stdcall __attribute__ ((stdcall))
// Bitflags for http_msg.flags
// status
@@ -79,7 +80,7 @@ typedef struct http_msg_s {
Initiates a HTTP connection, using 'GET' method.
Returns NULL on error, identifier otherwise.
*/
extern http_msg * __stdcall (*http_get)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
extern http_msg * stdcall (*http_get)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
/*
url = pointer to ASCIIZ URL
@@ -90,7 +91,7 @@ extern http_msg * __stdcall (*http_get)(const char *url, http_msg *identifier, u
Initiate a HTTP connection, using 'HEAD' method.
Returns NULL on error, identifier otherwise.
*/
extern http_msg * __stdcall (*http_head)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
extern http_msg * stdcall (*http_head)(const char *url, http_msg *identifier, unsigned flags, const char *add_header);
/*
url = pointer to ASCIIZ URL
@@ -105,7 +106,7 @@ extern http_msg * __stdcall (*http_head)(const char *url, http_msg *identifier,
using system function 75, 6.
Returns 0 on error, identifier otherwise
*/
extern http_msg * __stdcall (*http_post)(const char *url, http_msg *identifier, unsigned flags, const char *add_header,
extern http_msg * stdcall (*http_post)(const char *url, http_msg *identifier, unsigned flags, const char *add_header,
const char *content_type, unsigned content_length);
/*
@@ -127,7 +128,7 @@ extern http_msg * __stdcall (*http_post)(const char *url, http_msg *identifier,
In content_length you'll find the length of the content.
In content_received, you'll find the number of content bytes already received.
*/
extern int __stdcall (*http_receive)(http_msg *identifier);
extern int stdcall (*http_receive)(http_msg *identifier);
/*
identifier = identifier which one of the previous functions returned
@@ -136,17 +137,17 @@ extern int __stdcall (*http_receive)(http_msg *identifier);
This procedure can be used to send data to the server (POST)
Returns number of bytes sent, -1 on error
*/
extern int __stdcall (*http_send)(http_msg *identifier, void *dataptr, unsigned datalength);
extern int stdcall (*http_send)(http_msg *identifier, void *dataptr, unsigned datalength);
/*
Sometimes the http_receive function receives incomplete data. If you have the same problem then a macro can help you:
*/
extern int __stdcall (*http_free)(http_msg *identifier);
extern int stdcall (*http_free)(http_msg *identifier);
/*
Free unused data
*/
#define http_long_receive(x) while(http_receive(x)){};
#endif // KOLIBRI_HTTP_H
#endif // _HTTP_H_