mirror of
https://github.com/NishiOwO/chimera.git
synced 2025-04-21 08:34:39 +00:00
fix compile on linux 6
This commit is contained in:
parent
dc8640bcad
commit
47ce2e4754
@ -41,7 +41,7 @@
|
|||||||
* permission of John Bradley.
|
* permission of John Bradley.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <varargs.h>
|
#include <stdarg.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -173,7 +173,6 @@ static float GetDpi ARG1(HTMLWidget, hw) {
|
|||||||
look at the problem, the following pre-ANSI code should workaround
|
look at the problem, the following pre-ANSI code should workaround
|
||||||
the problem." */
|
the problem." */
|
||||||
static int PSprintf ARG1V(char *,format, ...) {
|
static int PSprintf ARG1V(char *,format, ...) {
|
||||||
va_dcl
|
|
||||||
va_list args;
|
va_list args;
|
||||||
int len;
|
int len;
|
||||||
char *s;
|
char *s;
|
||||||
@ -198,9 +197,7 @@ static int PSprintf ARG1V(char *,format, ...) {
|
|||||||
}
|
}
|
||||||
#else /* not BROKEN_SOLARIS_COMPILER_STDARG */
|
#else /* not BROKEN_SOLARIS_COMPILER_STDARG */
|
||||||
static int
|
static int
|
||||||
PSprintf (format, va_alist)
|
PSprintf (char* format, ...)
|
||||||
char* format;
|
|
||||||
va_dcl
|
|
||||||
{
|
{
|
||||||
int len;
|
int len;
|
||||||
char *s;
|
char *s;
|
||||||
@ -214,7 +211,7 @@ va_dcl
|
|||||||
}
|
}
|
||||||
PS_string = s;
|
PS_string = s;
|
||||||
}
|
}
|
||||||
va_start(args);
|
va_start(args, format);
|
||||||
len = vsprintf(PS_string+PS_len, format, args);
|
len = vsprintf(PS_string+PS_len, format, args);
|
||||||
/* this is a hack to make it work on systems were vsprintf(s,...)
|
/* this is a hack to make it work on systems were vsprintf(s,...)
|
||||||
* returns s, instead of the len.
|
* returns s, instead of the len.
|
||||||
|
@ -53,6 +53,7 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include "HTMLP.h"
|
#include "HTMLP.h"
|
||||||
#include "DrawingArea.h"
|
#include "DrawingArea.h"
|
||||||
#include <X11/Xaw/Scrollbar.h>
|
#include <X11/Xaw/Scrollbar.h>
|
||||||
|
27
src/http.c
27
src/http.c
@ -221,6 +221,7 @@ int s;
|
|||||||
|
|
||||||
static char *format_get = "\
|
static char *format_get = "\
|
||||||
GET %s HTTP/1.0\n\
|
GET %s HTTP/1.0\n\
|
||||||
|
Host: %s\n\
|
||||||
User-Agent: %s\n\
|
User-Agent: %s\n\
|
||||||
Accept: */*\n\
|
Accept: */*\n\
|
||||||
%s\
|
%s\
|
||||||
@ -229,6 +230,7 @@ Accept: */*\n\
|
|||||||
|
|
||||||
static char *format_get2 = "\
|
static char *format_get2 = "\
|
||||||
GET %s?%s HTTP/1.0\n\
|
GET %s?%s HTTP/1.0\n\
|
||||||
|
Host: %s\n\
|
||||||
User-Agent: %s\n\
|
User-Agent: %s\n\
|
||||||
Accept: */*\n\
|
Accept: */*\n\
|
||||||
%s\
|
%s\
|
||||||
@ -237,6 +239,7 @@ Accept: */*\n\
|
|||||||
|
|
||||||
static char *format_post = "\
|
static char *format_post = "\
|
||||||
POST %s HTTP/1.0\n\
|
POST %s HTTP/1.0\n\
|
||||||
|
Host: %s\n\
|
||||||
User-Agent: %s\n\
|
User-Agent: %s\n\
|
||||||
Accept: */*\n\
|
Accept: */*\n\
|
||||||
Content-length: %d\n\
|
Content-length: %d\n\
|
||||||
@ -249,6 +252,7 @@ Content-type: %s\n\
|
|||||||
|
|
||||||
static char *format_get_crlf = "\
|
static char *format_get_crlf = "\
|
||||||
GET %s HTTP/1.0\r\n\
|
GET %s HTTP/1.0\r\n\
|
||||||
|
Host: %s\r\n\
|
||||||
User-Agent: %s\r\n\
|
User-Agent: %s\r\n\
|
||||||
Accept: */*\r\n\
|
Accept: */*\r\n\
|
||||||
%s\
|
%s\
|
||||||
@ -257,6 +261,7 @@ Accept: */*\r\n\
|
|||||||
|
|
||||||
static char *format_get2_crlf = "\
|
static char *format_get2_crlf = "\
|
||||||
GET %s?%s HTTP/1.0\r\n\
|
GET %s?%s HTTP/1.0\r\n\
|
||||||
|
Host: %s\r\n\
|
||||||
User-Agent: %s\r\n\
|
User-Agent: %s\r\n\
|
||||||
Accept: */*\r\n\
|
Accept: */*\r\n\
|
||||||
%s\
|
%s\
|
||||||
@ -265,6 +270,7 @@ Accept: */*\r\n\
|
|||||||
|
|
||||||
static char *format_post_crlf = "\
|
static char *format_post_crlf = "\
|
||||||
POST %s HTTP/1.0\r\n\
|
POST %s HTTP/1.0\r\n\
|
||||||
|
Host: %s\r\n\
|
||||||
User-Agent: %s\n\
|
User-Agent: %s\n\
|
||||||
Accept: */*\r\n\
|
Accept: */*\r\n\
|
||||||
Content-length: %d\r\n\
|
Content-length: %d\r\n\
|
||||||
@ -405,6 +411,14 @@ int crlf;
|
|||||||
char *query;
|
char *query;
|
||||||
char *auth_info = NULL;
|
char *auth_info = NULL;
|
||||||
char *format;
|
char *format;
|
||||||
|
char* c_host;
|
||||||
|
|
||||||
|
c_host = malloc(strlen(up->hostname) + 10); /* not a good code but should work */
|
||||||
|
if(up->port == 0){
|
||||||
|
sprintf(c_host, "%s", up->hostname);
|
||||||
|
}else{
|
||||||
|
sprintf(c_host, "%s:%d", up->hostname, up->port);
|
||||||
|
}
|
||||||
|
|
||||||
if (up->data_type == NULL) data_type = "application/x-www-form-urlencoded";
|
if (up->data_type == NULL) data_type = "application/x-www-form-urlencoded";
|
||||||
else data_type = up->data_type;
|
else data_type = up->data_type;
|
||||||
@ -431,11 +445,13 @@ int crlf;
|
|||||||
strlen(up->request_data) +
|
strlen(up->request_data) +
|
||||||
strlen(extra_header) +
|
strlen(extra_header) +
|
||||||
strlen(auth_info) +
|
strlen(auth_info) +
|
||||||
strlen(USER_AGENT) + 1);
|
strlen(USER_AGENT) +
|
||||||
|
strlen(c_host) + 1);
|
||||||
sprintf (query,
|
sprintf (query,
|
||||||
format,
|
format,
|
||||||
filename,
|
filename,
|
||||||
up->request_data,
|
up->request_data,
|
||||||
|
c_host,
|
||||||
USER_AGENT,
|
USER_AGENT,
|
||||||
extra_header,
|
extra_header,
|
||||||
auth_info);
|
auth_info);
|
||||||
@ -449,10 +465,12 @@ int crlf;
|
|||||||
strlen(data_type) +
|
strlen(data_type) +
|
||||||
strlen(extra_header) +
|
strlen(extra_header) +
|
||||||
strlen(auth_info) +
|
strlen(auth_info) +
|
||||||
strlen(USER_AGENT) + 1);
|
strlen(USER_AGENT) +
|
||||||
|
strlen(c_host) + 1);
|
||||||
sprintf (query,
|
sprintf (query,
|
||||||
format,
|
format,
|
||||||
filename,
|
filename,
|
||||||
|
c_host,
|
||||||
USER_AGENT,
|
USER_AGENT,
|
||||||
strlen(up->request_data),
|
strlen(up->request_data),
|
||||||
data_type,
|
data_type,
|
||||||
@ -469,16 +487,19 @@ int crlf;
|
|||||||
strlen(format) +
|
strlen(format) +
|
||||||
strlen(extra_header) +
|
strlen(extra_header) +
|
||||||
strlen(auth_info) +
|
strlen(auth_info) +
|
||||||
strlen(USER_AGENT) + 1);
|
strlen(USER_AGENT) +
|
||||||
|
strlen(c_host) + 1);
|
||||||
sprintf (query,
|
sprintf (query,
|
||||||
format,
|
format,
|
||||||
filename,
|
filename,
|
||||||
|
c_host,
|
||||||
USER_AGENT,
|
USER_AGENT,
|
||||||
extra_header,
|
extra_header,
|
||||||
auth_info);
|
auth_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
free(auth_info);
|
free(auth_info);
|
||||||
|
free(c_host);
|
||||||
|
|
||||||
return(query);
|
return(query);
|
||||||
}
|
}
|
||||||
|
@ -331,7 +331,11 @@ ReapChild()
|
|||||||
* checked into it. This gets us off the ground with SYSV. RSE@GMI
|
* checked into it. This gets us off the ground with SYSV. RSE@GMI
|
||||||
*/
|
*/
|
||||||
#if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4)
|
#if defined(WNOHANG) && !defined(SYSV) && !defined(SVR4)
|
||||||
|
#ifdef __linux__
|
||||||
|
int st;
|
||||||
|
#else
|
||||||
union wait st;
|
union wait st;
|
||||||
|
#endif
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user