ELinks 0.16.1.1
state.h File Reference
#include "util/error.h"
Include dependency graph for state.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  connection_state
 Either an ELinks internal status code or an error code from the system. More...

Macros

#define is_system_error(state)
#define is_in_state(state, basic_)
#define is_in_result_state(state)
#define is_in_progress_state(state)
#define is_in_connecting_state(state)
#define is_in_transfering_state(state)
#define is_in_queued_state(state)

Typedefs

typedef unsigned char connection_priority_T
typedef int connection_basic_state_T

Enumerations

enum  connection_priority {
  PRI_MAIN = 0 , PRI_DOWNLOAD = 0 , PRI_FRAME , PRI_IFRAME ,
  PRI_CSS , PRI_NEED_IMG , PRI_IMG , PRI_PRELOAD ,
  PRI_CANCEL , PRIORITIES
}
enum  connection_basic_state {
  S_WAIT = 0 , S_DNS , S_CONN , S_SSL_NEG ,
  S_SENT , S_LOGIN , S_GETH , S_PROC ,
  S_TRANS , S_QUESTIONS , S_CONN_PEERS , S_CONN_TRACKER ,
  S_RESUME , S_ERRNO = -1 , S_OK = -100000 , S_INTERRUPTED = -100001 ,
  S_EXCEPT = -100002 , S_INTERNAL = -100003 , S_OUT_OF_MEM = -100004 , S_NO_DNS = -100005 ,
  S_CANT_WRITE = -100006 , S_CANT_READ = -100007 , S_MODIFIED = -100008 , S_BAD_URL = -100009 ,
  S_TIMEOUT = -100010 , S_RESTART = -100011 , S_STATE = -100012 , S_WAIT_REDIR = -100013 ,
  S_LOCAL_ONLY = -100014 , S_UNKNOWN_PROTOCOL = -100015 , S_EXTERNAL_PROTOCOL = -100016 , S_ENCODE_ERROR = -100017 ,
  S_SSL_ERROR = -100018 , S_NO_FORCED_DNS = -100019 , S_HTTP_ERROR = -100100 , S_HTTP_204 = -100101 ,
  S_HTTP_UPLOAD_RESIZED = -100102 , S_FILE_TYPE = -100200 , S_FILE_ERROR = -100201 , S_FILE_CGI_BAD_PATH = -100202 ,
  S_FILE_ANONYMOUS = -100203 , S_FTP_ERROR = -100300 , S_FTP_UNAVAIL = -100301 , S_FTP_LOGIN = -100302 ,
  S_FTP_PORT = -100303 , S_FTP_NO_FILE = -100304 , S_FTP_FILE_ERROR = -100305 , S_NNTP_ERROR = -100400 ,
  S_NNTP_NEWS_SERVER = -100401 , S_NNTP_SERVER_HANG_UP = -100402 , S_NNTP_GROUP_UNKNOWN = -100403 , S_NNTP_ARTICLE_UNKNOWN = -100404 ,
  S_NNTP_TRANSFER_ERROR = -100405 , S_NNTP_AUTH_REQUIRED = -100406 , S_NNTP_ACCESS_DENIED = -100407 , S_NNTP_SERVER_ERROR = -100408 ,
  S_GOPHER_CSO_ERROR = -100500 , S_NO_JAVASCRIPT = -100600 , S_PROXY_ERROR = -100700 , S_BITTORRENT_ERROR = -100800 ,
  S_BITTORRENT_METAINFO = -100801 , S_BITTORRENT_TRACKER = -100802 , S_BITTORRENT_BAD_URL = -100803 , S_BITTORRENT_PEER_URL = -100804 ,
  S_FSP_OPEN_SESSION_UNKN = -100900
}

Functions

char * get_state_message (struct connection_state state, struct terminal *term)
void done_state_message (void)
static struct connection_state connection_state (connection_basic_state_T basic)
static struct connection_state connection_state_for_errno (int syserr)

Macro Definition Documentation

◆ is_in_connecting_state

#define is_in_connecting_state ( state)
Value:
(S_WAIT < (state).basic && (state).basic < S_TRANS)
@ S_TRANS
Definition state.h:48
@ S_WAIT
Definition state.h:40

◆ is_in_progress_state

#define is_in_progress_state ( state)
Value:
((state).basic >= 0)

◆ is_in_queued_state

#define is_in_queued_state ( state)
Value:
(is_in_connecting_state(state) || (state).basic == S_WAIT)
#define is_in_connecting_state(state)
Definition state.h:31

◆ is_in_result_state

#define is_in_result_state ( state)
Value:
((state).basic < 0)

◆ is_in_state

#define is_in_state ( state,
basic_ )
Value:
((state).basic == (basic_))

◆ is_in_transfering_state

#define is_in_transfering_state ( state)
Value:
((state).basic >= S_TRANS)

◆ is_system_error

#define is_system_error ( state)
Value:
((state).basic == S_ERRNO)
@ S_ERRNO
Definition state.h:56

Typedef Documentation

◆ connection_basic_state_T

◆ connection_priority_T

typedef unsigned char connection_priority_T

Enumeration Type Documentation

◆ connection_basic_state

Enumerator
S_WAIT 
S_DNS 
S_CONN 
S_SSL_NEG 
S_SENT 
S_LOGIN 
S_GETH 
S_PROC 
S_TRANS 
S_QUESTIONS 
S_CONN_PEERS 
S_CONN_TRACKER 
S_RESUME 
S_ERRNO 
S_OK 
S_INTERRUPTED 
S_EXCEPT 
S_INTERNAL 
S_OUT_OF_MEM 
S_NO_DNS 
S_CANT_WRITE 
S_CANT_READ 
S_MODIFIED 
S_BAD_URL 
S_TIMEOUT 
S_RESTART 
S_STATE 
S_WAIT_REDIR 
S_LOCAL_ONLY 
S_UNKNOWN_PROTOCOL 
S_EXTERNAL_PROTOCOL 
S_ENCODE_ERROR 
S_SSL_ERROR 
S_NO_FORCED_DNS 
S_HTTP_ERROR 
S_HTTP_204 
S_HTTP_UPLOAD_RESIZED 
S_FILE_TYPE 
S_FILE_ERROR 
S_FILE_CGI_BAD_PATH 
S_FILE_ANONYMOUS 
S_FTP_ERROR 
S_FTP_UNAVAIL 
S_FTP_LOGIN 
S_FTP_PORT 
S_FTP_NO_FILE 
S_FTP_FILE_ERROR 
S_NNTP_ERROR 
S_NNTP_NEWS_SERVER 
S_NNTP_SERVER_HANG_UP 
S_NNTP_GROUP_UNKNOWN 
S_NNTP_ARTICLE_UNKNOWN 
S_NNTP_TRANSFER_ERROR 
S_NNTP_AUTH_REQUIRED 
S_NNTP_ACCESS_DENIED 
S_NNTP_SERVER_ERROR 
S_GOPHER_CSO_ERROR 
S_NO_JAVASCRIPT 
S_PROXY_ERROR 
S_BITTORRENT_ERROR 
S_BITTORRENT_METAINFO 
S_BITTORRENT_TRACKER 
S_BITTORRENT_BAD_URL 
S_BITTORRENT_PEER_URL 
S_FSP_OPEN_SESSION_UNKN 

◆ connection_priority

Enumerator
PRI_MAIN 
PRI_DOWNLOAD 
PRI_FRAME 
PRI_IFRAME 
PRI_CSS 
PRI_NEED_IMG 
PRI_IMG 
PRI_PRELOAD 
PRI_CANCEL 
PRIORITIES 

Function Documentation

◆ connection_state()

struct connection_state connection_state ( connection_basic_state_T basic)
inlinestatic

◆ connection_state_for_errno()

struct connection_state connection_state_for_errno ( int syserr)
inlinestatic

◆ done_state_message()

void done_state_message ( void )

◆ get_state_message()

char * get_state_message ( struct connection_state state,
struct terminal * term )