ELinks 0.18.0
file.c File Reference
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "elinks.h"
#include "cache/cache.h"
#include "config/options.h"
#include "encoding/encoding.h"
#include "intl/libintl.h"
#include "main/module.h"
#include "network/connection.h"
#include "network/socket.h"
#include "osdep/osdep.h"
#include "protocol/common.h"
#include "protocol/file/cgi.h"
#include "protocol/file/dgi.h"
#include "protocol/file/file.h"
#include "protocol/http/http.h"
#include "protocol/uri.h"
#include "util/conv.h"
#include "util/file.h"
#include "util/memory.h"
#include "util/string.h"
Include dependency graph for file.c:

Functions

static void add_dir_entry (struct directory_entry *entry, struct string *page, int pathlen, char *dircolor, int first)
static void add_dir_entries (struct directory_entry *entries, char *dirpath, struct string *page)
static struct connection_state list_directory (struct connection *conn, char *dirpath, struct string *page)
static void check_if_closed (struct socket *socket, struct read_buffer *rb)
static void read_from_stdin (struct connection *conn)
void file_protocol_handler (struct connection *connection)

Variables

static union option_info file_options []
struct module file_protocol_module

Function Documentation

◆ add_dir_entries()

void add_dir_entries ( struct directory_entry * entries,
char * dirpath,
struct string * page )
inlinestatic

◆ add_dir_entry()

void add_dir_entry ( struct directory_entry * entry,
struct string * page,
int pathlen,
char * dircolor,
int first )
inlinestatic

◆ check_if_closed()

void check_if_closed ( struct socket * socket,
struct read_buffer * rb )
static

◆ file_protocol_handler()

void file_protocol_handler ( struct connection * connection)

◆ list_directory()

struct connection_state list_directory ( struct connection * conn,
char * dirpath,
struct string * page )
inlinestatic

◆ read_from_stdin()

void read_from_stdin ( struct connection * conn)
static

Variable Documentation

◆ file_options

union option_info file_options[]
static
Initial value:
= {
INIT_OPT_TREE("protocol", N_("Local files"),
"file", OPT_ZERO,
N_("Options specific to local browsing.")),
INIT_OPT_BOOL("protocol.file", N_("Allow reading special files"),
"allow_special_files", OPT_ZERO, 0,
N_("Whether to allow reading from non-regular files. "
"Note this can be dangerous; reading /dev/urandom or "
"/dev/zero can ruin your day!")),
INIT_OPT_BOOL("protocol.file", N_("Show hidden files in directory listing"),
"show_hidden_files", OPT_ZERO, 1,
N_("When set to false, files with name starting with a dot "
"will be hidden in local directory listings.")),
INIT_OPT_BOOL("protocol.file", N_("Try encoding extensions"),
"try_encoding_extensions", OPT_ZERO, 1,
N_("When set, if we can't open a file named 'filename', "
"we'll try to open 'filename' with some encoding extension "
"appended (ie. 'filename.gz'); it depends on the supported "
"encodings.")),
NULL_OPTION_INFO,
}
@ OPT_ZERO
Definition options.h:23
#define N_(msg)
Definition libintl.h:25

◆ file_protocol_module

struct module file_protocol_module
Initial value:
N_("File"),
)
#define NULL
Definition explodename.c:35
#define struct_module(name, options, hooks, submods, data, init, done, getname)
Definition module.h:47
static union option_info file_options[]
Definition file.c:45