1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

[network] enum connection_priority -> connection_priority_T

This commit is contained in:
Witold Filipczyk 2022-01-28 16:22:03 +01:00
parent cea2521b91
commit ec6cfcaf22
7 changed files with 17 additions and 15 deletions

View File

@ -72,7 +72,7 @@ static INIT_LIST_OF(struct keepalive_connection, keepalive_connections);
static void check_keepalive_connections(void);
static void notify_connection_callbacks(struct connection *conn);
static /* inline */ enum connection_priority
static /* inline */ connection_priority_T
get_priority(struct connection *conn)
{
int priority;
@ -215,11 +215,11 @@ static void
check_queue_bugs(void)
{
struct connection *conn;
enum connection_priority prev_priority = 0;
connection_priority_T prev_priority = 0;
int cc = 0;
foreach (conn, connection_queue) {
enum connection_priority priority = get_priority(conn);
connection_priority_T priority = get_priority(conn);
cc += conn->running;
@ -269,7 +269,7 @@ done_connection_socket(struct socket *socket, struct connection_state state)
static struct connection *
init_connection(struct uri *uri, struct uri *proxied_uri, struct uri *referrer,
off_t start, enum cache_mode cache_mode,
enum connection_priority priority)
connection_priority_T priority)
{
static struct socket_operations connection_socket_operations = {
set_connection_socket_state,
@ -496,7 +496,7 @@ static inline void
add_to_queue(struct connection *conn)
{
struct connection *c;
enum connection_priority priority = get_priority(conn);
connection_priority_T priority = get_priority(conn);
foreach (c, connection_queue)
if (get_priority(c) > priority)
@ -801,7 +801,7 @@ retry_connection(struct connection *conn, struct connection_state state)
static int
try_to_suspend_connection(struct connection *conn, struct uri *uri)
{
enum connection_priority priority = get_priority(conn);
connection_priority_T priority = get_priority(conn);
struct connection *c;
foreachback (c, connection_queue) {
@ -845,7 +845,7 @@ again:
while (conn != (struct connection *) &connection_queue) {
struct connection *c;
enum connection_priority pri = get_priority(conn);
connection_priority_T pri = get_priority(conn);
for (c = conn; c != (struct connection *) &connection_queue && get_priority(c) == pri;) {
struct connection *cc = c;
@ -889,7 +889,7 @@ register_check_queue(void)
int
load_uri(struct uri *uri, struct uri *referrer, struct download *download,
enum connection_priority pri, enum cache_mode cache_mode, off_t start)
connection_priority_T pri, enum cache_mode cache_mode, off_t start)
{
struct cache_entry *cached;
struct connection *conn;
@ -1081,7 +1081,7 @@ cancel_download(struct download *download, int interrupt)
void
move_download(struct download *old, struct download *new_,
enum connection_priority newpri)
connection_priority_T newpri)
{
struct connection *conn;

View File

@ -104,7 +104,7 @@ void retry_connection(struct connection *, struct connection_state);
void cancel_download(struct download *download, int interrupt);
void move_download(struct download *old, struct download *new_,
enum connection_priority newpri);
connection_priority_T newpri);
void detach_connection(struct download *, off_t);
void abort_all_connections(void);
@ -119,7 +119,7 @@ void shutdown_connection_stream(struct connection *conn);
* that should be probably something else than data, but... ;-) */
/* Returns 0 on success and -1 on failure. */
int load_uri(struct uri *uri, struct uri *referrer, struct download *download,
enum connection_priority pri, enum cache_mode cache_mode, off_t start);
connection_priority_T pri, enum cache_mode cache_mode, off_t start);
int is_entry_used(struct cache_entry *cached);

View File

@ -22,6 +22,8 @@ enum connection_priority {
PRIORITIES,
};
typedef unsigned char connection_priority_T;
#define is_system_error(state) ((state).basic == S_ERRNO)
#define is_in_state(state,basic_) ((state).basic == (basic_))
#define is_in_result_state(state) ((state).basic < 0)

View File

@ -88,7 +88,7 @@ get_user_program(struct terminal *term, char *progid, int progidlen)
/* declared in "session/session.h" */
void
print_error_dialog(struct session *ses, struct connection_state state,
struct uri *uri, enum connection_priority priority)
struct uri *uri, connection_priority_T priority)
{
stub_called("print_error_dialog");
}

View File

@ -63,7 +63,7 @@ struct download {
struct connection_state state;
struct connection_state prev_error;
enum connection_priority pri;
connection_priority_T pri;
};
/** The user has navigated to a resource that ELinks does not display

View File

@ -288,7 +288,7 @@ retry_connection_without_verification(void *data)
void
print_error_dialog(struct session *ses, struct connection_state state,
struct uri *uri, enum connection_priority priority)
struct uri *uri, connection_priority_T priority)
{
struct string msg;
char *uristring;

View File

@ -278,7 +278,7 @@ void set_session_referrer(struct session *ses, struct uri *referrer);
void
print_error_dialog(struct session *ses, struct connection_state state,
struct uri *uri, enum connection_priority priority);
struct uri *uri, connection_priority_T priority);
void process_file_requests(struct session *);