ELinks 0.18.0
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "elinks.h"
#include "bfu/dialog.h"
#include "bfu/hierbox.h"
#include "bfu/listbox.h"
#include "bookmarks/backend/common.h"
#include "bookmarks/bookmarks.h"
#include "bookmarks/dialogs.h"
#include "config/home.h"
#include "config/options.h"
#include "intl/libintl.h"
#include "main/module.h"
#include "main/object.h"
#include "protocol/uri.h"
#include "session/task.h"
#include "terminal/tab.h"
#include "util/conv.h"
#include "util/hash.h"
#include "util/lists.h"
#include "util/memory.h"
#include "util/secsave.h"
#include "util/string.h"
Macros | |
#define | check_bookmark_cache(url) (bookmark_cache && (url) && *(url)) |
Functions | |
static enum evhook_status | bookmark_change_hook (va_list ap, void *data) |
static enum evhook_status | bookmark_write_hook (va_list ap, void *data) |
static void | bookmark_snapshot () |
static int | change_hook_folder_state (struct session *ses, struct option *current, struct option *changed) |
static void | init_bookmarks (struct module *module) |
static void | free_bookmarks (struct bookmark list *bookmarks_list, struct listbox_item list *box_items) |
static void | done_bookmarks (struct module *module) |
void | read_bookmarks (void) |
void | write_bookmarks (void) |
void | bookmarks_set_dirty (void) |
void | bookmarks_unset_dirty (void) |
int | bookmarks_are_dirty (void) |
static void | done_bookmark (struct bookmark *bm) |
void | delete_bookmark (struct bookmark *bm) |
static void | delete_folder_by_name (const char *foldername) |
Deletes any bookmarks with no URLs (i.e., folders) and of which the title matches the given argument. | |
static struct bookmark * | init_bookmark (struct bookmark *root, const char *title, const char *url) |
Allocate and initialize a bookmark in the given folder. | |
static void | add_bookmark_item_to_bookmarks (struct bookmark *bm, struct bookmark *root, int place) |
struct bookmark * | add_bookmark (struct bookmark *root, int place, const char *title, const char *url) |
Add a bookmark to the bookmark list. | |
struct bookmark * | add_bookmark_cp (struct bookmark *root, int place, int codepage, const char *title, const char *url) |
Add a bookmark to the bookmark list. | |
int | update_bookmark (struct bookmark *bm, int codepage, char *title, char *url) |
struct bookmark * | get_bookmark_by_name (struct bookmark *folder, char *title) |
Search for a bookmark with the given title. | |
struct bookmark * | get_bookmark (char *url) |
static void | bookmark_terminal (struct terminal *term, struct bookmark *folder) |
void | bookmark_terminal_tabs (struct terminal *term, char *foldername) |
Create a bookmark for each document on the specified terminal, and a folder to contain those bookmarks. | |
static void | bookmark_all_terminals (struct bookmark *folder) |
char * | get_auto_save_bookmark_foldername_utf8 (void) |
void | bookmark_auto_save_tabs (struct terminal *term) |
void | open_bookmark_folder (struct session *ses, char *foldername) |
Open all bookmarks from the named folder. | |
Variables | |
struct bookmark list | bookmarks = { D_LIST_HEAD_EL(bookmarks) } |
static int | bookmarks_dirty = 0 |
static struct hash * | bookmark_cache = NULL |
static struct bookmark * | bm_snapshot_last_folder |
static union option_info | bookmark_options_info [] |
struct event_hook_info | bookmark_hooks [] |
struct module | bookmarks_module |
#define check_bookmark_cache | ( | url | ) | (bookmark_cache && (url) && *(url)) |
struct bookmark * add_bookmark | ( | struct bookmark * | root, |
int | place, | ||
const char * | title, | ||
const char * | url ) |
Add a bookmark to the bookmark list.
root | The folder in which to add the bookmark, or NULL to add it at top level. |
place | 0 means add to the top. 1 means add to the bottom. |
title | Title of the bookmark. Must be in UTF-8 and not NULL. "-" means add a separator. |
url | URL to which the bookmark will point. Must be in UTF-8. NULL or "" means add a bookmark folder. |
struct bookmark * add_bookmark_cp | ( | struct bookmark * | root, |
int | place, | ||
int | codepage, | ||
const char * | title, | ||
const char * | url ) |
Add a bookmark to the bookmark list.
root | The folder in which to add the bookmark, or NULL to add it at top level. |
place | 0 means add to the top. 1 means add to the bottom. |
codepage | Codepage of title and url. |
title | Title of the bookmark. Must not be NULL. "-" means add a separator. |
url | URL to which the bookmark will point. NULL or "" means add a bookmark folder. |
|
static |
|
static |
void bookmark_auto_save_tabs | ( | struct terminal * | term | ) |
|
static |
|
static |
void bookmark_terminal_tabs | ( | struct terminal * | term, |
char * | foldername ) |
Create a bookmark for each document on the specified terminal, and a folder to contain those bookmarks.
term | The terminal whose open documents should be bookmarked. |
foldername | The name of the new bookmark folder, in UTF-8. |
|
static |
int bookmarks_are_dirty | ( | void | ) |
void bookmarks_set_dirty | ( | void | ) |
void bookmarks_unset_dirty | ( | void | ) |
|
static |
void delete_bookmark | ( | struct bookmark * | bm | ) |
|
static |
Deletes any bookmarks with no URLs (i.e., folders) and of which the title matches the given argument.
foldername | The title of the folder, in UTF-8. |
|
static |
|
static |
|
static |
char * get_auto_save_bookmark_foldername_utf8 | ( | void | ) |
Search for a bookmark with the given title.
The search does not recurse into subfolders.
folder | Search in this folder. NULL means search in the root. |
title | Search for this title. Must be in UTF-8 and not NULL. |
|
static |
Allocate and initialize a bookmark in the given folder.
This however does not set bookmark.box_item; use add_bookmark() for that.
root | The folder in which to add the bookmark, or NULL to add it at top level. |
title | Title of the bookmark. Must be in UTF-8 and not NULL. "-" means add a separator. |
url | URL to which the bookmark will point. Must be in UTF-8. NULL or "" means add a bookmark folder. |
|
static |
void open_bookmark_folder | ( | struct session * | ses, |
char * | foldername ) |
Open all bookmarks from the named folder.
ses | The session in which to open the first bookmark. The other bookmarks of the folder open in new tabs on the same terminal. |
foldername | The name of the bookmark folder, in UTF-8. |
void read_bookmarks | ( | void | ) |
int update_bookmark | ( | struct bookmark * | bm, |
int | codepage, | ||
char * | title, | ||
char * | url ) |
void write_bookmarks | ( | void | ) |
|
static |
struct event_hook_info bookmark_hooks[] |
|
static |
struct bookmark list bookmarks = { D_LIST_HEAD_EL(bookmarks) } |
|
static |