NetSurf
|
interface to generate HTML content for displaying directory listings. More...
#include <stdbool.h>
Go to the source code of this file.
Macros | |
#define | DIRLIST_NO_NAME_COLUMN 1 |
#define | DIRLIST_NO_TYPE_COLUMN 1 << 1 |
#define | DIRLIST_NO_SIZE_COLUMN 1 << 2 |
#define | DIRLIST_NO_DATE_COLUMN 1 << 3 |
#define | DIRLIST_NO_TIME_COLUMN 1 << 4 |
Functions | |
bool | dirlist_generate_top (char *buffer, int buffer_length) |
Generates the top part of an HTML directory listing page. More... | |
bool | dirlist_generate_hide_columns (int flags, char *buffer, int buffer_length) |
Generates the part of an HTML directory listing page that can suppress particular columns. More... | |
bool | dirlist_generate_title (const char *title, char *buffer, int buffer_length) |
Generates the part of an HTML directory listing page that contains the title. More... | |
bool | dirlist_generate_parent_link (const char *parent, char *buffer, int buffer_length) |
Generates the part of an HTML directory listing page that links to the parent directory. More... | |
bool | dirlist_generate_headings (char *buffer, int buffer_length) |
Generates the part of an HTML directory listing page that displays the column headings. More... | |
bool | dirlist_generate_row (bool even, bool directory, struct nsurl *url, char *name, const char *mimetype, long long size, char *date, char *time, char *buffer, int buffer_length) |
Generates the part of an HTML directory listing page that displays a row in the directory contents table. More... | |
bool | dirlist_generate_bottom (char *buffer, int buffer_length) |
Generates the bottom part of an HTML directory listing page. More... | |
interface to generate HTML content for displaying directory listings.
These functions should in general be called via the content interface.
Definition in file dirlist.h.
bool dirlist_generate_bottom | ( | char * | buffer, |
int | buffer_length | ||
) |
Generates the bottom part of an HTML directory listing page.
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 344 of file dirlist.c.
References buffer.
Referenced by fetch_file_process_dir().
bool dirlist_generate_headings | ( | char * | buffer, |
int | buffer_length | ||
) |
Generates the part of an HTML directory listing page that displays the column headings.
buffer | buffer to fill with generated HTML |
buffer_length | maximum size of buffer |
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 237 of file dirlist.c.
References buffer, and messages_get().
Referenced by fetch_file_process_dir().
bool dirlist_generate_hide_columns | ( | int | flags, |
char * | buffer, | ||
int | buffer_length | ||
) |
Generates the part of an HTML directory listing page that can suppress particular columns.
flags | flags for which cols to suppress. 0 to suppress none |
buffer | buffer to fill with generated HTML |
buffer_length | maximum size of buffer |
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 100 of file dirlist.c.
References buffer, DIRLIST_NO_DATE_COLUMN, DIRLIST_NO_NAME_COLUMN, DIRLIST_NO_SIZE_COLUMN, DIRLIST_NO_TIME_COLUMN, and DIRLIST_NO_TYPE_COLUMN.
bool dirlist_generate_parent_link | ( | const char * | parent, |
char * | buffer, | ||
int | buffer_length | ||
) |
Generates the part of an HTML directory listing page that links to the parent directory.
parent | url of parent directory |
buffer | buffer to fill with generated HTML |
buffer_length | maximum size of buffer |
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 202 of file dirlist.c.
References buffer, messages_get(), and parent.
Referenced by fetch_file_process_dir().
bool dirlist_generate_row | ( | bool | even, |
bool | directory, | ||
nsurl * | url, | ||
char * | name, | ||
const char * | mimetype, | ||
long long | size, | ||
char * | date, | ||
char * | time, | ||
char * | buffer, | ||
int | buffer_length | ||
) |
Generates the part of an HTML directory listing page that displays a row in the directory contents table.
even | evenness of row number, for alternate row colouring |
directory | whether this row is for a directory (or a file) |
url | url for row entry |
name | name of row entry |
mimetype | MIME type of row entry |
size | size of row entry. If negative, size is left blank |
date | date row entry was last modified |
time | time row entry was last modified |
buffer | buffer to fill with generated HTML |
buffer_length | maximum size of buffer |
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 289 of file dirlist.c.
References buffer, dirlist_filesize_unit(), dirlist_filesize_value(), messages_get(), and nsurl_access().
Referenced by process_dir_ent().
bool dirlist_generate_title | ( | const char * | title, |
char * | buffer, | ||
int | buffer_length | ||
) |
Generates the part of an HTML directory listing page that contains the title.
title | title to use |
buffer | buffer to fill with generated HTML |
buffer_length | maximum size of buffer |
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 143 of file dirlist.c.
References buffer, colour_rb_swap, nscolour_get_stylesheet(), NSCOLOUR_WIN_ODD_BG, nscolours, and NSERROR_OK.
Referenced by fetch_file_process_dir().
bool dirlist_generate_top | ( | char * | buffer, |
int | buffer_length | ||
) |
Generates the top part of an HTML directory listing page.
This is part of a series of functions. To generate a complete page, call the following functions in order:
dirlist_generate_top() dirlist_generate_hide_columns() -- optional dirlist_generate_title() dirlist_generate_parent_link() -- optional dirlist_generate_headings() dirlist_generate_row() -- call 'n' times for 'n' rows dirlist_generate_bottom()
Definition at line 61 of file dirlist.c.
References buffer.
Referenced by fetch_file_process_dir().