ELinks 0.18.0
parse-meta-refresh.c File Reference
#include <errno.h>
#include <stdlib.h>
#include "elinks.h"
#include "document/html/parse-meta-refresh.h"
#include "osdep/ascii.h"
#include "util/string.h"
Include dependency graph for parse-meta-refresh.c:

Macros

#define LWS(c)

Functions

int html_parse_meta_refresh (const char *content, unsigned long *delay_out, char **url_out)
 Parses a <meta http-equiv="refresh" content="..."> element.

Macro Definition Documentation

◆ LWS

#define LWS ( c)
Value:
((c) == ' ' || (c) == ASCII_TAB)
#define ASCII_TAB
Definition ascii.h:6

Function Documentation

◆ html_parse_meta_refresh()

int html_parse_meta_refresh ( const char * content,
unsigned long * delay,
char ** url )

Parses a <meta http-equiv="refresh" content="..."> element.

Parameters
[in]contentThe value of the content attribute, with entities already expanded.
[out]delayHow many seconds to wait before refreshing.
[out]urlThe URI to load when refreshing, or NULL to reload the same document. The caller must free the string with mem_free() unless it's NULL.
Returns
0 if successful, or negative on error. On error, *url is NULL.