NetSurf
Data Structures | Enumerations | Functions | Variables
cookie_manager.c File Reference

Implementation of Cookie Management. More...

#include <stdlib.h>
#include <string.h>
#include "utils/messages.h"
#include "utils/utils.h"
#include "utils/log.h"
#include "content/urldb.h"
#include "desktop/cookie_manager.h"
#include "desktop/treeview.h"
Include dependency graph for cookie_manager.c:

Go to the source code of this file.

Data Structures

struct  cookie_manager_folder
 
struct  cookie_manager_ctx
 
struct  cookie_manager_entry
 
struct  treeview_walk_ctx
 Treewalk iterator context. More...
 

Enumerations

enum  cookie_manager_field {
  COOKIE_M_NAME , COOKIE_M_CONTENT , COOKIE_M_DOMAIN , COOKIE_M_PATH ,
  COOKIE_M_EXPIRES , COOKIE_M_LAST_USED , COOKIE_M_RESTRICTIONS , COOKIE_M_VERSION ,
  COOKIE_M_DOMAIN_FOLDER , COOKIE_M_N_FIELDS
}
 
enum  cookie_manager_value {
  COOKIE_M_HTTPS , COOKIE_M_SECURE , COOKIE_M_HTTP , COOKIE_M_NONE ,
  COOKIE_M_NETSCAPE , COOKIE_M_RFC2109 , COOKIE_M_RFC2965 , COOKIE_M_YES ,
  COOKIE_M_NO , COOKIE_M_N_VALUES
}
 

Functions

static nserror cookie_manager_walk_cb (void *ctx, void *node_data, enum treeview_node_type type, bool *abort)
 Callback for treeview_walk. More...
 
static nserror cookie_manager_find_entry (treeview_node *root, const char *title, size_t title_len, struct cookie_manager_entry **found)
 Find a cookie entry in the cookie manager's treeview. More...
 
static nserror cookie_manager_find_folder (treeview_node *root, const char *title, size_t title_len, struct cookie_manager_folder **found)
 Find a cookie domain folder in the cookie manager's treeview. More...
 
static void cookie_manager_free_treeview_field_data (struct cookie_manager_entry *e)
 Free a cookie manager entry's treeview field data. More...
 
static nserror cookie_manager_field_builder (enum cookie_manager_field field, struct treeview_field_data *data, const char *value)
 Build a cookie manager treeview field from given text. More...
 
static nserror cookie_manager_field_builder_time (enum cookie_manager_field field, struct treeview_field_data *fdata, const time_t *value)
 Build a cookie manager treeview field from given time. More...
 
static nserror cookie_manager_set_treeview_field_data (struct cookie_manager_entry *e, const struct cookie_data *data)
 Set a cookie manager entry's data from the cookie_data. More...
 
static nserror cookie_manager_create_cookie_node (struct cookie_manager_folder *parent, const struct cookie_data *data)
 Creates an empty tree entry for a cookie, and links it into the tree. More...
 
static nserror cookie_manager_update_cookie_node (struct cookie_manager_entry *e, const struct cookie_data *data)
 Updates a cookie manager entry for updated cookie_data. More...
 
static nserror cookie_manager_create_domain_folder (struct cookie_manager_folder **folder, const struct cookie_data *data)
 Creates an empty tree folder for a cookie domain, and links it into the tree. More...
 
bool cookie_manager_add (const struct cookie_data *data)
 Add/update a cookie to the viewer. More...
 
void cookie_manager_remove (const struct cookie_data *data)
 Remove a cookie from viewer. More...
 
nserror cookie_manager_set_search_string (const char *string)
 Set the cookie manager search string. More...
 
static nserror cookie_manager_init_entry_fields (void)
 Initialise the treeview entry feilds. More...
 
static nserror cookie_manager_init_common_values (void)
 Initialise the common entry values. More...
 
static void cookie_manager_delete_entry (struct cookie_manager_entry *e)
 Delete cookie manager entries (and optionally delete from urldb) More...
 
static nserror cookie_manager_tree_node_folder_cb (struct treeview_node_msg msg, void *data)
 
static nserror cookie_manager_tree_node_entry_cb (struct treeview_node_msg msg, void *data)
 
nserror cookie_manager_init (void *core_window_handle)
 Initialise the cookie manager. More...
 
nserror cookie_manager_fini (void)
 Finalise the cookie manager. More...
 
void cookie_manager_redraw (int x, int y, struct rect *clip, const struct redraw_context *ctx)
 Redraw the cookies manager. More...
 
void cookie_manager_mouse_action (enum browser_mouse_state mouse, int x, int y)
 Handles all kinds of mouse action. More...
 
bool cookie_manager_keypress (uint32_t key)
 Key press handling. More...
 
bool cookie_manager_has_selection (void)
 Determine whether there is a selection. More...
 
nserror cookie_manager_expand (bool only_folders)
 Expand the treeview's nodes. More...
 
nserror cookie_manager_contract (bool all)
 Contract the treeview's nodes. More...
 

Variables

struct cookie_manager_ctx cm_ctx
 
struct treeview_callback_table cm_tree_cb_t
 

Detailed Description

Implementation of Cookie Management.

This allows users to view and remove their web cookies.

Todo:
the viewing of cookies is pretty basic and it would be good to apply more processing of the values and perhaps top level domain suffix highlighting to give a better user information as to how the cookies interact with the users sessions.
Todo:
In addition to removing cookies it might be useful to allow users to edit them, especially to alter expiry times.

Definition in file cookie_manager.c.

Enumeration Type Documentation

◆ cookie_manager_field

Enumerator
COOKIE_M_NAME 
COOKIE_M_CONTENT 
COOKIE_M_DOMAIN 
COOKIE_M_PATH 
COOKIE_M_EXPIRES 
COOKIE_M_LAST_USED 
COOKIE_M_RESTRICTIONS 
COOKIE_M_VERSION 
COOKIE_M_DOMAIN_FOLDER 
COOKIE_M_N_FIELDS 

Definition at line 46 of file cookie_manager.c.

◆ cookie_manager_value

Enumerator
COOKIE_M_HTTPS 
COOKIE_M_SECURE 
COOKIE_M_HTTP 
COOKIE_M_NONE 
COOKIE_M_NETSCAPE 
COOKIE_M_RFC2109 
COOKIE_M_RFC2965 
COOKIE_M_YES 
COOKIE_M_NO 
COOKIE_M_N_VALUES 

Definition at line 59 of file cookie_manager.c.

Function Documentation

◆ cookie_manager_add()

bool cookie_manager_add ( const struct cookie_data data)

Add/update a cookie to the viewer.

(Called by urldb.)

Parameters
dataData of cookie being added/updated.
Returns
true (for urldb_iterate_entries)

Definition at line 467 of file cookie_manager.c.

References cm_ctx, cookie_manager_create_cookie_node(), cookie_manager_create_domain_folder(), cookie_manager_find_entry(), cookie_manager_find_folder(), cookie_manager_update_cookie_node(), cookie_manager_entry::data, NSERROR_OK, parent, and cookie_manager_ctx::tree.

Referenced by cookie_manager_init(), urldb_get_cookie(), and urldb_insert_cookie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_contract()

nserror cookie_manager_contract ( bool  all)

Contract the treeview's nodes.

Parameters
allIff false, only entries are contracted.
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 917 of file cookie_manager.c.

References cm_ctx, cookie_manager_ctx::tree, and treeview_contract().

Referenced by cookie_menu_select(), cookie_toolbar_click(), HOOKF(), and MENUHANDLER().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_create_cookie_node()

static nserror cookie_manager_create_cookie_node ( struct cookie_manager_folder parent,
const struct cookie_data data 
)
static

Creates an empty tree entry for a cookie, and links it into the tree.

All information is copied from the cookie_data, and as such can be edited and should be freed.

Parameters
parentthe node to link to
datathe cookie data to use
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 343 of file cookie_manager.c.

References cookie_manager_ctx::built, cm_ctx, cookie_manager_free_treeview_field_data(), cookie_manager_set_treeview_field_data(), cookie_manager_entry::data, cookie_manager_entry::entry, NSERROR_NOMEM, NSERROR_OK, parent, cookie_manager_ctx::tree, TREE_OPTION_NONE, TREE_OPTION_SUPPRESS_REDRAW, TREE_OPTION_SUPPRESS_RESIZE, TREE_REL_FIRST_CHILD, treeview_create_node_entry(), and cookie_manager_entry::user_delete.

Referenced by cookie_manager_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_create_domain_folder()

static nserror cookie_manager_create_domain_folder ( struct cookie_manager_folder **  folder,
const struct cookie_data data 
)
static

Creates an empty tree folder for a cookie domain, and links it into the tree.

All information is copied from the cookie_data, and as such can be edited and should be freed.

Parameters
folderupdated to the new folder
datathe cookie data to use
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 431 of file cookie_manager.c.

References cookie_manager_ctx::built, cm_ctx, COOKIE_M_N_FIELDS, cookie_manager_folder::data, treeview_field_desc::field, treeview_field_data::field, cookie_manager_ctx::fields, cookie_manager_folder::folder, NSERROR_NOMEM, NSERROR_OK, cookie_manager_ctx::tree, TREE_OPTION_NONE, TREE_OPTION_SUPPRESS_REDRAW, TREE_OPTION_SUPPRESS_RESIZE, TREE_REL_FIRST_CHILD, treeview_create_node_folder(), treeview_field_data::value, and treeview_field_data::value_len.

Referenced by cookie_manager_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_delete_entry()

static void cookie_manager_delete_entry ( struct cookie_manager_entry e)
static

Delete cookie manager entries (and optionally delete from urldb)

Parameters
eCookie manager entry to delete.

Definition at line 714 of file cookie_manager.c.

References COOKIE_M_DOMAIN, COOKIE_M_NAME, COOKIE_M_PATH, cookie_manager_free_treeview_field_data(), cookie_manager_entry::data, NSLOG, path(), urldb_delete_cookie(), cookie_manager_entry::user_delete, and treeview_field_data::value.

Referenced by cookie_manager_tree_node_entry_cb().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_expand()

nserror cookie_manager_expand ( bool  only_folders)

Expand the treeview's nodes.

Parameters
only_foldersIff true, only folders are expanded.
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 910 of file cookie_manager.c.

References cm_ctx, cookie_manager_ctx::tree, and treeview_expand().

Referenced by cookie_menu_select(), cookie_toolbar_click(), HOOKF(), and MENUHANDLER().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_field_builder()

static nserror cookie_manager_field_builder ( enum cookie_manager_field  field,
struct treeview_field_data data,
const char *  value 
)
inlinestatic

Build a cookie manager treeview field from given text.

Parameters
fieldCookie manager treeview field to build
dataCookie manager entry field data to set
valueText to set in field, ownership yielded
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 219 of file cookie_manager.c.

References cm_ctx, treeview_field_desc::field, treeview_field_data::field, cookie_manager_ctx::fields, NSERROR_OK, treeview_field_data::value, and treeview_field_data::value_len.

Referenced by cookie_manager_init_common_values(), and cookie_manager_set_treeview_field_data().

Here is the caller graph for this function:

◆ cookie_manager_field_builder_time()

static nserror cookie_manager_field_builder_time ( enum cookie_manager_field  field,
struct treeview_field_data fdata,
const time_t *  value 
)
inlinestatic

Build a cookie manager treeview field from given time.

The time should be converted to text in the users locacle

Parameters
fieldCookie manager treeview field to build
fdataCookie manager entry field data to set
valueTime to show in field
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 241 of file cookie_manager.c.

References cm_ctx, treeview_field_desc::field, treeview_field_data::field, cookie_manager_ctx::fields, NSERROR_OK, treeview_field_data::value, and treeview_field_data::value_len.

Referenced by cookie_manager_set_treeview_field_data().

Here is the caller graph for this function:

◆ cookie_manager_find_entry()

static nserror cookie_manager_find_entry ( treeview_node root,
const char *  title,
size_t  title_len,
struct cookie_manager_entry **  found 
)
static

Find a cookie entry in the cookie manager's treeview.

Parameters
rootSearch root node, or NULL to search from tree's root
titleID of the node to look for
title_lenByte length of title string
foundUpdated to the matching node's cookie maanger entry
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 139 of file cookie_manager.c.

References cm_ctx, cookie_manager_walk_cb(), treeview_walk_ctx::entry, NSERROR_OK, root, treeview_walk_ctx::title, treeview_walk_ctx::title_len, cookie_manager_ctx::tree, TREE_NODE_ENTRY, and treeview_walk().

Referenced by cookie_manager_add(), and cookie_manager_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_find_folder()

static nserror cookie_manager_find_folder ( treeview_node root,
const char *  title,
size_t  title_len,
struct cookie_manager_folder **  found 
)
static

Find a cookie domain folder in the cookie manager's treeview.

Parameters
rootSearch root node, or NULL to search from tree's root
titleID of the node to look for
title_lenByte length of title string
foundUpdated to the matching node's cookie maanger folder
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 169 of file cookie_manager.c.

References cm_ctx, cookie_manager_walk_cb(), treeview_walk_ctx::folder, NSERROR_OK, root, treeview_walk_ctx::title, treeview_walk_ctx::title_len, cookie_manager_ctx::tree, TREE_NODE_FOLDER, and treeview_walk().

Referenced by cookie_manager_add(), and cookie_manager_remove().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_fini()

nserror cookie_manager_fini ( void  )

Finalise the cookie manager.

This destroys the cookie manager treeview and the cookie manager module's internal data. After calling this if the cookie manager is required again, cookie_manager_init must be called.

Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 846 of file cookie_manager.c.

References cookie_manager_ctx::built, cm_ctx, COOKIE_M_N_FIELDS, COOKIE_M_N_VALUES, treeview_field_desc::field, cookie_manager_ctx::fields, NSERROR_OK, NSLOG, cookie_manager_ctx::tree, treeview_destroy(), treeview_fini(), treeview_field_data::value, and cookie_manager_ctx::values.

Referenced by ami_cookies_destroy(), atari_cookie_manager_finish(), nsgtk_cookies_destroy(), nsw32_cookies_finalise(), and ro_gui_cookies_finalise().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_free_treeview_field_data()

static void cookie_manager_free_treeview_field_data ( struct cookie_manager_entry e)
static

Free a cookie manager entry's treeview field data.

Parameters
eCookie manager entry to free data from

Definition at line 197 of file cookie_manager.c.

References COOKIE_M_CONTENT, COOKIE_M_DOMAIN, COOKIE_M_EXPIRES, COOKIE_M_LAST_USED, COOKIE_M_NAME, COOKIE_M_PATH, cookie_manager_entry::data, and treeview_field_data::value.

Referenced by cookie_manager_create_cookie_node(), cookie_manager_delete_entry(), and cookie_manager_update_cookie_node().

Here is the caller graph for this function:

◆ cookie_manager_has_selection()

bool cookie_manager_has_selection ( void  )

Determine whether there is a selection.

Returns
true iff there is a selection

Definition at line 903 of file cookie_manager.c.

References cm_ctx, cookie_manager_ctx::tree, and treeview_has_selection().

Referenced by cookie_menu_prepare(), and cookie_toolbar_update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_init()

nserror cookie_manager_init ( void *  core_window_handle)

Initialise the cookie manager.

This iterates through the URL database, enumerating the cookies and creates a treeview.

This must be called before any other cookie_manager_* function.

Parameters
core_window_handleThe core_window in which the cookie view is shown
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 791 of file cookie_manager.c.

References cookie_manager_ctx::built, cm_ctx, cm_tree_cb_t, COOKIE_M_N_FIELDS, cookie_manager_add(), cookie_manager_init_common_values(), cookie_manager_init_entry_fields(), cookie_manager_ctx::fields, NSERROR_OK, NSLOG, cookie_manager_ctx::tree, treeview_create(), TREEVIEW_DEL_EMPTY_DIRS, treeview_get_height(), treeview_init(), TREEVIEW_NO_MOVES, TREEVIEW_SEARCHABLE, and urldb_iterate_cookies().

Referenced by ami_cookies_present(), atari_cookie_manager_init_phase2(), nsgtk_cookies_init(), nsw32_cookie_init(), and ro_cookie_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_init_common_values()

static nserror cookie_manager_init_common_values ( void  )
static

Initialise the common entry values.

Returns
true on success, false on memory exhaustion

Definition at line 668 of file cookie_manager.c.

References cm_ctx, COOKIE_M_HTTP, COOKIE_M_HTTPS, COOKIE_M_NETSCAPE, COOKIE_M_NONE, COOKIE_M_RESTRICTIONS, COOKIE_M_RFC2109, COOKIE_M_RFC2965, COOKIE_M_SECURE, COOKIE_M_VERSION, cookie_manager_field_builder(), COOKIE_NETSCAPE, COOKIE_RFC2109, COOKIE_RFC2965, messages_get(), NSERROR_OK, and cookie_manager_ctx::values.

Referenced by cookie_manager_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_init_entry_fields()

static nserror cookie_manager_init_entry_fields ( void  )
static

Initialise the treeview entry feilds.

Returns
true on success, false on memory exhaustion

Definition at line 560 of file cookie_manager.c.

References cm_ctx, COOKIE_M_CONTENT, COOKIE_M_DOMAIN, COOKIE_M_DOMAIN_FOLDER, COOKIE_M_EXPIRES, COOKIE_M_LAST_USED, COOKIE_M_N_FIELDS, COOKIE_M_NAME, COOKIE_M_PATH, COOKIE_M_RESTRICTIONS, COOKIE_M_VERSION, treeview_field_desc::field, cookie_manager_ctx::fields, treeview_field_desc::flags, messages_get(), NSERROR_OK, NSERROR_UNKNOWN, TREE_FLAG_DEFAULT, TREE_FLAG_SEARCHABLE, and TREE_FLAG_SHOW_NAME.

Referenced by cookie_manager_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_keypress()

bool cookie_manager_keypress ( uint32_t  key)

Key press handling.

Parameters
keyThe ucs4 character codepoint
Returns
true if the keypress is dealt with, false otherwise.

Definition at line 896 of file cookie_manager.c.

References cm_ctx, cookie_manager_ctx::tree, and treeview_keypress().

Referenced by ami_cookies_key(), atari_cookie_manager_keypress(), cookie_key(), cookie_menu_select(), cookie_toolbar_click(), HOOKF(), MENUHANDLER(), nsgtk_cookies_key(), nsw32_cookie_key(), and ro_gui_window_menu_select().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_mouse_action()

void cookie_manager_mouse_action ( enum browser_mouse_state  mouse,
int  x,
int  y 
)

Handles all kinds of mouse action.

Parameters
mouseThe current mouse state
xX coordinate
yY coordinate

Definition at line 889 of file cookie_manager.c.

References cm_ctx, cookie_manager_ctx::tree, and treeview_mouse_action().

Referenced by ami_cookies_mouse(), atari_cookie_manager_mouse_action(), cookie_mouse(), nsgtk_cookies_mouse(), and nsw32_cookie_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_redraw()

void cookie_manager_redraw ( int  x,
int  y,
struct rect clip,
const struct redraw_context ctx 
)

Redraw the cookies manager.

Parameters
xX coordinate to render treeview at
yY coordinate to render treeview at
clipCurrent clip rectangle (wrt tree origin)
ctxCurrent redraw context

Definition at line 881 of file cookie_manager.c.

References clip(), cm_ctx, cookie_manager_ctx::tree, and treeview_redraw().

Referenced by ami_cookies_draw(), atari_cookie_manager_draw(), cookie_draw(), nsgtk_cookies_draw(), and nsw32_cookie_draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_remove()

void cookie_manager_remove ( const struct cookie_data data)

Remove a cookie from viewer.

(Called by urldb.)

Parameters
dataData of cookie being removed.

Definition at line 511 of file cookie_manager.c.

References cm_ctx, cookie_manager_find_entry(), cookie_manager_find_folder(), cookie_manager_entry::data, cookie_manager_entry::entry, NSERROR_OK, parent, cookie_manager_ctx::tree, TREE_OPTION_NONE, and treeview_delete_node().

Referenced by urldb_insert_cookie().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_set_search_string()

nserror cookie_manager_set_search_string ( const char *  string)

Set the cookie manager search string.

Parameters
stringSering to set as search string.
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 543 of file cookie_manager.c.

References cm_ctx, NSERROR_NOT_FOUND, cookie_manager_ctx::tree, and treeview_set_search_string().

Referenced by ami_cookies_present(), nsgtk_cookies_present(), nsw32_cookies_present(), and ro_gui_cookies_present().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_set_treeview_field_data()

static nserror cookie_manager_set_treeview_field_data ( struct cookie_manager_entry e,
const struct cookie_data data 
)
static

Set a cookie manager entry's data from the cookie_data.

Parameters
eCookie manager entry to set up
dataData associated with entry's cookie
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 273 of file cookie_manager.c.

References cm_ctx, COOKIE_M_CONTENT, COOKIE_M_DOMAIN, COOKIE_M_EXPIRES, COOKIE_M_HTTP, COOKIE_M_HTTPS, COOKIE_M_LAST_USED, COOKIE_M_NAME, COOKIE_M_NETSCAPE, COOKIE_M_NONE, COOKIE_M_PATH, COOKIE_M_RESTRICTIONS, COOKIE_M_RFC2109, COOKIE_M_RFC2965, COOKIE_M_SECURE, COOKIE_M_VERSION, cookie_manager_field_builder(), cookie_manager_field_builder_time(), COOKIE_NETSCAPE, COOKIE_RFC2109, COOKIE_RFC2965, cookie_manager_entry::data, cookie_data::domain, cookie_data::expires, cookie_data::http_only, cookie_data::last_used, messages_get(), cookie_data::name, NSERROR_OK, cookie_data::path, cookie_data::secure, cookie_data::value, cookie_manager_ctx::values, and cookie_data::version.

Referenced by cookie_manager_create_cookie_node(), and cookie_manager_update_cookie_node().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_tree_node_entry_cb()

static nserror cookie_manager_tree_node_entry_cb ( struct treeview_node_msg  msg,
void *  data 
)
static

Definition at line 762 of file cookie_manager.c.

References cookie_manager_delete_entry(), cookie_manager_entry::data, treeview_node_msg::data, treeview_node_msg::delete, cookie_manager_entry::entry, treeview_node_msg::msg, NSERROR_OK, TREE_MSG_NODE_DELETE, TREE_MSG_NODE_EDIT, TREE_MSG_NODE_LAUNCH, treeview_node_msg::user, and cookie_manager_entry::user_delete.

Here is the call graph for this function:

◆ cookie_manager_tree_node_folder_cb()

static nserror cookie_manager_tree_node_folder_cb ( struct treeview_node_msg  msg,
void *  data 
)
static

◆ cookie_manager_update_cookie_node()

static nserror cookie_manager_update_cookie_node ( struct cookie_manager_entry e,
const struct cookie_data data 
)
static

Updates a cookie manager entry for updated cookie_data.

All information is copied from the cookie_data, and as such can be edited and should be freed.

Parameters
ethe entry to update
datathe cookie data to use
Returns
NSERROR_OK on success, appropriate error otherwise

Definition at line 393 of file cookie_manager.c.

References cm_ctx, cookie_manager_free_treeview_field_data(), cookie_manager_set_treeview_field_data(), cookie_manager_entry::data, cookie_manager_entry::entry, NSERROR_OK, cookie_manager_ctx::tree, treeview_update_node_entry(), and cookie_manager_entry::user_delete.

Referenced by cookie_manager_add().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cookie_manager_walk_cb()

static nserror cookie_manager_walk_cb ( void *  ctx,
void *  node_data,
enum treeview_node_type  type,
bool *  abort 
)
static

Callback for treeview_walk.

Definition at line 101 of file cookie_manager.c.

References COOKIE_M_NAME, treeview_walk_ctx::ctx, cookie_manager_entry::entry, treeview_walk_ctx::entry, cookie_manager_folder::folder, treeview_walk_ctx::folder, NSERROR_OK, treeview_walk_ctx::title, treeview_walk_ctx::title_len, TREE_NODE_ENTRY, TREE_NODE_FOLDER, and type.

Referenced by cookie_manager_find_entry(), and cookie_manager_find_folder().

Here is the caller graph for this function:

Variable Documentation

◆ cm_ctx

struct cookie_manager_ctx cm_ctx

◆ cm_tree_cb_t

struct treeview_callback_table cm_tree_cb_t
Initial value:
= {
}
static nserror cookie_manager_tree_node_folder_cb(struct treeview_node_msg msg, void *data)
static nserror cookie_manager_tree_node_entry_cb(struct treeview_node_msg msg, void *data)

Definition at line 784 of file cookie_manager.c.

Referenced by cookie_manager_init().