mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-02-23 01:44:42 +03:00
Update for new lpu API.
This commit is contained in:
parent
fabc086d4a
commit
cde62790f6
@ -283,12 +283,11 @@ nserror textplain_create_internal(textplain_content *c, lwc_string *encoding)
|
||||
goto no_memory;
|
||||
|
||||
error = parserutils_inputstream_create(lwc_string_data(encoding), 0,
|
||||
textplain_charset_hack, ns_realloc, NULL, &stream);
|
||||
textplain_charset_hack, &stream);
|
||||
if (error == PARSERUTILS_BADENCODING) {
|
||||
/* Fall back to Windows-1252 */
|
||||
error = parserutils_inputstream_create("Windows-1252", 0,
|
||||
textplain_charset_hack, ns_realloc, NULL,
|
||||
&stream);
|
||||
textplain_charset_hack, &stream);
|
||||
}
|
||||
if (error != PARSERUTILS_OK) {
|
||||
free(utf8_data);
|
||||
|
@ -37,20 +37,6 @@
|
||||
#include "utils/utf8.h"
|
||||
#include "utils/utils.h"
|
||||
|
||||
void *
|
||||
ns_realloc(void *ptr, size_t size, void *pw)
|
||||
{
|
||||
(void)pw;
|
||||
|
||||
if (ptr == NULL)
|
||||
return size > 0 ? malloc(size) : NULL;
|
||||
if (size == 0) {
|
||||
free(ptr);
|
||||
return NULL;
|
||||
}
|
||||
return realloc(ptr, size);
|
||||
}
|
||||
|
||||
char * strip(char * const s)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -136,17 +136,6 @@ typedef struct
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Private-word-capable realloc() implementation which
|
||||
* behaves as most NS libraries expect in the face of
|
||||
* realloc(ptr, 0) and realloc(NULL, size).
|
||||
*
|
||||
* \param ptr The pointer for reallocation
|
||||
* \param size The number of bytes for the allocation
|
||||
* \param pw A "private word" which we ignore.
|
||||
* \return The new pointer (NULL on frees or errors)
|
||||
*/
|
||||
void *ns_realloc(void *ptr, size_t size, void *pw);
|
||||
|
||||
char * strip(char * const s);
|
||||
int whitespace(const char * str);
|
||||
|
Loading…
x
Reference in New Issue
Block a user