Dillo v3.1.1-98-g318d1f14
Loading...
Searching...
No Matches
dlib.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <ctype.h>
#include <time.h>
#include "dlib.h"
Include dependency graph for dlib.c:

Go to the source code of this file.

Macros

#define DLIB_MSG(...)
 

Functions

void * dMalloc (size_t size)
 
void * dRealloc (void *mem, size_t size)
 
void * dMalloc0 (size_t size)
 
void dFree (void *mem)
 
char * dStrdup (const char *s)
 
char * dStrndup (const char *s, size_t sz)
 
char * dStrconcat (const char *s1,...)
 Concatenate a NULL-terminated list of strings.
 
char * dStrstrip (char *s)
 Remove leading and trailing whitespace.
 
void dStrshred (char *s)
 Clear the contents of the string.
 
char * dStrnfill (size_t len, char c)
 Return a new string of length 'len' filled with 'c' characters.
 
char * dStrsep (char **orig, const char *delim)
 strsep() implementation
 
char * dStriAsciiStr (const char *haystack, const char *needle)
 Case insensitive strstr.
 
int dStrAsciiCasecmp (const char *s1, const char *s2)
 
int dStrnAsciiCasecmp (const char *s1, const char *s2, size_t n)
 
static void dStr_resize (Dstr *ds, int n_sz, int keep)
 Private allocator.
 
DstrdStr_sized_new (int sz)
 Create a new string with a given size.
 
void dStr_fit (Dstr *ds)
 Return memory if there's too much allocated.
 
void dStr_insert_l (Dstr *ds, int pos_0, const char *s, int l)
 Insert a C string, at a given position, into a Dstr (providing length).
 
void dStr_insert (Dstr *ds, int pos_0, const char *s)
 Insert a C string, at a given position, into a Dstr.
 
void dStr_append_l (Dstr *ds, const char *s, int l)
 Append a C string to a Dstr (providing length).
 
void dStr_append (Dstr *ds, const char *s)
 Append a C string to a Dstr.
 
DstrdStr_new (const char *s)
 Create a new string.
 
void dStr_free (Dstr *ds, int all)
 Free a dillo string.
 
void dStr_append_c (Dstr *ds, int c)
 Append one character.
 
void dStr_truncate (Dstr *ds, int len)
 Truncate a Dstr to be 'len' bytes long.
 
void dStr_shred (Dstr *ds)
 Clear a Dstr.
 
void dStr_erase (Dstr *ds, int pos_0, int len)
 Erase a substring.
 
void dStr_vsprintfa (Dstr *ds, const char *format, va_list argp)
 vsprintf-like function that appends.
 
void dStr_vsprintf (Dstr *ds, const char *format, va_list argp)
 vsprintf-like function.
 
void dStr_sprintf (Dstr *ds, const char *format,...)
 Printf-like function.
 
void dStr_sprintfa (Dstr *ds, const char *format,...)
 Printf-like function that appends.
 
int dStr_cmp (Dstr *ds1, Dstr *ds2)
 Compare two dStrs.
 
char * dStr_memmem (Dstr *haystack, Dstr *needle)
 Return a pointer to the first occurrence of needle in haystack.
 
const char * dStr_printable (Dstr *in, int maxlen)
 Return a printable representation of the provided Dstr, limited to a length of roughly maxlen.
 
DlistdList_new (int size)
 Create a new empty list.
 
void dList_free (Dlist *lp)
 Free a list (not its elements)
 
void dList_insert_pos (Dlist *lp, void *data, int pos0)
 Insert an element at a given position [0 based].
 
void dList_append (Dlist *lp, void *data)
 Append a data item to the list.
 
void dList_prepend (Dlist *lp, void *data)
 Prepend a data item to the list.
 
int dList_length (Dlist *lp)
 For completing the ADT.
 
void dList_remove_fast (Dlist *lp, const void *data)
 Remove a data item without preserving order.
 
void dList_remove (Dlist *lp, const void *data)
 
void * dList_nth_data (Dlist *lp, int n0)
 Return the nth data item, NULL when not found or 'n0' is out of range.
 
void * dList_find (Dlist *lp, const void *data)
 Return the found data item, or NULL if not present.
 
int dList_find_idx (Dlist *lp, const void *data)
 Search a data item.
 
void * dList_find_custom (Dlist *lp, const void *data, dCompareFunc func)
 Search a data item using a custom function.
 
static void QuickSort (void **left, void **right, dCompareFunc compare)
 QuickSort implementation.
 
void dList_sort (Dlist *lp, dCompareFunc func)
 Sort the list using a custom function.
 
void dList_insert_sorted (Dlist *lp, void *data, dCompareFunc func)
 Insert an element into a sorted list.
 
void * dList_find_sorted (Dlist *lp, const void *data, dCompareFunc func)
 Search a sorted list.
 
int dParser_parse_rc_line (char **line, char **name, char **value)
 Take a dillo rc line and return 'name' and 'value' pointers to it.
 
void dLib_show_messages (bool_t show)
 
char * dGetcwd (void)
 Return the current working directory in a new string.
 
char * dGethomedir (void)
 Return the home directory in a static string (don't free)
 
char * dGetline (FILE *stream)
 Get a line from a FILE stream.
 
int dClose (int fd)
 Close a FD handling EINTR.
 
int dUsleep (unsigned long usec)
 Portable usleep() function.
 

Variables

static bool_t dLib_show_msg = TRUE
 

Macro Definition Documentation

◆ DLIB_MSG

#define DLIB_MSG (   ...)
Value:
fprintf(stderr, __VA_ARGS__); \
static bool_t dLib_show_msg
Definition dlib.c:32
#define D_STMT_START
Definition dlib.h:62
#define D_STMT_END
Definition dlib.h:63

Definition at line 35 of file dlib.c.

Function Documentation

◆ dClose()

◆ dFree()

void dFree ( void *  mem)

Definition at line 68 of file dlib.c.

Referenced by a_Bitvec_free(), a_Bookmarks_add(), a_Bookmarks_chat_add(), a_Bw_free(), a_Cache_set_content_type(), a_Capi_ccc(), a_Capi_dpi_send_data(), a_Capi_open_url(), a_Cookies_get_query(), a_Cookies_get_query(), a_Cookies_set(), a_Cookies_set(), a_Decode_free(), a_Decode_transfer_free(), a_Dialog_input(), a_Dicache_close(), a_Dicache_freeall(), a_Dicache_set_cmap(), a_Dns_freeall(), a_Domain_freeall(), a_Domain_parse(), a_Dpi_ccc(), a_Dpi_rd_dpi_socket_dir(), a_Dpi_srs(), a_Dpiapi_dialog(), a_Dpip_check_auth(), a_Dpip_dsh_free(), a_History_freeall(), a_History_set_title_by_url(), a_Hsts_set(), a_Html_common_image_attrs(), a_Html_image_new(), a_Html_load_stylesheet(), a_Http_ccc(), a_Http_connect_done(), a_Http_freeall(), a_Http_set_proxy_passwd(), a_IO_ccc(), a_Klist_free(), a_Klist_remove(), a_Menu_history_popup(), a_Menu_page_popup(), a_Misc_content_type_cmp(), a_Nav_expect_done(), a_Nav_free(), a_Prefs_freeall(), a_UIcmd_get_passwd(), a_UIcmd_open_file(), a_UIcmd_open_urlstr(), a_UIcmd_search_dialog(), a_UIcmd_view_page_source(), a_Url_free(), a_Url_new(), a_Web_free(), Auth_do_auth_dialog(), Auth_do_auth_dialog_cb(), Auth_do_auth_required(), Auth_parse_free(), Auth_realm_add_path(), Auth_realm_delete(), Bms_check_import(), Bms_del(), Bms_load(), Bms_save(), Bms_sec_del(), Bms_update_sec_title(), Bms_update_title(), Bmsrv_add_bm(), Bmsrv_dpi_send_status_msg(), Bmsrv_modify_add_section(), Bmsrv_modify_add_url(), Bmsrv_modify_update(), Bmsrv_parse_token(), Bmsrv_send_modify_answer(), Bmsrv_send_modify_page(), Bmsrv_send_modify_update(), Bmsrv_send_reload_request(), StyleEngine::buildUserStyle(), Cache_auth_callback(), Cache_auth_free(), Cache_client_dequeue(), Cache_entry_free(), Cache_parse_header(), Cache_provide_redirection_blocked_page(), Cache_savelink_cb(), Capi_conn_resume(), Capi_conn_unref(), Capi_dpi_send_source(), Capi_url_uses_dpi(), UI::change_panel(), cleanup(), Cookie_control_init(), Cookies_delete_node(), Cookies_free_cookie(), Cookies_get(), Cookies_init(), Cookies_parse(), Cookies_parse_date(), Cookies_rc_check(), Cookies_server_timediff(), Cookies_validate_path(), Decode_charset_free(), Decode_compression_free(), Decode_deflate(), Keys::delKeyCmd(), dGetcwd(), Dicache_remove(), dList_free(), Dns_queue_remove(), Dns_server_req(), Dpi_conn_free(), Dpi_connect_socket(), Dpi_connect_socket(), Dpi_get_server_port(), Dpi_get_server_port(), Dpi_parse_token(), Dpi_read_comm_keys(), Dpi_read_comm_keys(), Dpi_read_comm_keys(), Dpi_start_dpid(), Dpi_start_dpid(), Dpiapi_dialog_answer_cb(), dStr_free(), dStr_resize(), expires_extremes(), expires_server_ahead(), expires_server_behind(), File_dillodir_free(), File_dillodir_new(), File_info2html(), File_normalize_path(), File_print_parent_dir(), File_remove_client(), File_send_dir(), File_send_error_page(), File_send_file(), File_serve_client(), File_toggle_html_style(), fill_services_list(), CssProperty::free(), Keys::free(), Paths::free(), free_dpi_attr(), free_plugin_list(), free_services_list(), DilloHtml::freeParseData(), get_command(), get_dpi_attr(), get_dpi_dir(), get_message(), Paths::getPrefsFP(), help_cb(), Hsts_free_policy(), Html_parse_doctype(), Html_parse_entity(), Html_process_space(), Html_process_word(), Html_tag_content_frame(), Html_tag_content_map(), Html_tag_content_textarea(), Html_tag_open_a(), Html_tag_open_button(), Html_tag_open_font(), Html_tag_open_form(), Html_tag_open_hr(), Html_tag_open_input(), Html_tag_open_meta(), Html_tag_open_select(), Html_write_raw(), Http_connect_queued_sockets(), Http_connect_tls(), Http_dns_cb(), Http_fd_map_remove_all(), Http_fd_map_remove_entry(), Http_get(), Http_get_connect_str(), Http_make_query_str(), Http_must_use_proxy(), Http_send_query(), Http_server_remove(), Http_servers_remove_all(), Http_socket_free(), Image_free(), Paths::init(), init_sockdir(), IO_free(), main(), main(), make_wget_argv(), makeStartUrl(), maxage(), Menu_bugmeter_validate(), mk_sockdir(), Nav_stack_clean(), Nav_stack_truncate(), Keys::parse(), CssParser::parseImport(), Keys::parseKey(), parseOption(), Png_free(), read_req_cb(), register_all(), register_service(), save_comm_keys(), send_bm_page(), send_decoded_data(), send_failure_message(), send_html_text(), send_numbered_text(), send_plain_text(), send_sockport(), srv_parse_tok(), stop_active_dpis(), Tls_cert_authorities_freeall(), Tls_check_cert_hostname(), Tls_close_by_key(), Tls_close_by_key(), Tls_examine_certificate(), Tls_examine_certificate(), Tls_fd_map_remove_all(), Tls_fd_map_remove_all(), Tls_fd_map_remove_entry(), Tls_fd_map_remove_entry(), Tls_load_certificates(), Tls_load_certificates(), Tls_remove_duplicate_certificates(), Tls_servers_freeall(), Tls_servers_freeall(), try_ftp_transfer(), tst_dir(), UIcmd_make_save_filename(), UIcmd_make_search_str(), UIcmd_save(), DilloHtml::write(), CssSimpleSelector::~CssSimpleSelector(), DilloHtml::~DilloHtml(), and DoctreeNode::~DoctreeNode().

◆ dGetcwd()

char * dGetcwd ( void  )

Return the current working directory in a new string.

Definition at line 888 of file dlib.c.

References dFree(), and dNew.

Referenced by Paths::init().

◆ dGethomedir()

◆ dGetline()

char * dGetline ( FILE *  stream)

Get a line from a FILE stream.

Return value: read line on success, NULL on EOF.

Definition at line 928 of file dlib.c.

References dReturn_val_if_fail, dStr_append_c(), dStr_free(), dStr_sized_new(), Dstr::len, and Dstr::str.

Referenced by a_Domain_parse(), a_Dpi_rd_dpi_socket_dir(), a_Dpip_check_auth(), Bms_load(), Dpi_read_comm_keys(), Dpi_read_comm_keys(), Dpi_read_comm_keys(), fill_services_list(), get_dpi_dir(), and Keys::parse().

◆ dLib_show_messages()

void dLib_show_messages ( bool_t  show)

Definition at line 876 of file dlib.c.

References dLib_show_msg.

Referenced by main().

◆ dList_append()

◆ dList_find()

void * dList_find ( Dlist lp,
const void *  data 
)

Return the found data item, or NULL if not present.

Definition at line 672 of file dlib.c.

References dList_find_idx(), and Dlist::list.

Referenced by a_Bw_remove_client(), a_Bw_remove_doc(), a_Web_valid(), Cache_delayed_process_queue(), and Capi_conn_valid().

◆ dList_find_custom()

◆ dList_find_idx()

int dList_find_idx ( Dlist lp,
const void *  data 
)

Search a data item.

Return value: its index if found, -1 if not present. (this is useful for a list of integers, for finding number zero).

Definition at line 683 of file dlib.c.

References Dlist::len, and Dlist::list.

Referenced by dList_find().

◆ dList_find_sorted()

◆ dList_free()

◆ dList_insert_pos()

void dList_insert_pos ( Dlist lp,
void *  data,
int  pos0 
)

Insert an element at a given position [0 based].

Definition at line 576 of file dlib.c.

References dRealloc(), Dlist::len, Dlist::list, and Dlist::sz.

Referenced by Cookies_add_matching_cookies(), dList_append(), dList_insert_sorted(), dList_prepend(), and Http_socket_enqueue().

◆ dList_insert_sorted()

void dList_insert_sorted ( Dlist lp,
void *  data,
dCompareFunc  func 
)

Insert an element into a sorted list.

The comparison function receives two list elements.

Definition at line 769 of file dlib.c.

References dList_insert_pos(), Dlist::len, and Dlist::list.

Referenced by a_Klist_insert(), a_Tls_mbedtls_connect_ready(), a_Tls_openssl_connect_ready(), Cache_entry_add(), Cookies_add_cookie(), Dicache_add_entry(), Hsts_set_policy(), Keys::init(), Keys::parseKey(), and Tls_update_cert_authorities_data().

◆ dList_length()

◆ dList_new()

◆ dList_nth_data()

void * dList_nth_data ( Dlist lp,
int  n0 
)

Return the nth data item, NULL when not found or 'n0' is out of range.

Definition at line 662 of file dlib.c.

References Dlist::len, and Dlist::list.

Referenced by a_Auth_do_auth(), a_Bw_cleanup(), a_Bw_free(), a_Bw_get_current_doc(), a_Bw_stop_clients(), a_Cache_client_get_if_unique(), a_Cache_freeall(), a_Cache_process_dbuf(), a_Capi_conn_abort_by_url(), a_Cookies_set(), a_Dialog_input(), a_Dicache_cleanup(), a_Dicache_freeall(), a_Dns_freeall(), a_Hsts_freeall(), a_Klist_free(), a_Nav_get_top_uidx(), a_Nav_get_uidx(), a_Prefs_freeall(), Auth_host_by_url(), Auth_realm_add_path(), Auth_realm_by_name(), Auth_realm_by_path(), Auth_realm_delete(), Auth_realm_includes_path(), Bms_free(), Bms_normalize(), Bms_save(), Bmsrv_send_modify_page(), Cache_auth_free(), Cache_delayed_process_queue_callback(), Cache_entry_remove(), Cache_parse_header(), Cache_process_queue(), Capi_conn_resume(), Cookies_add_matching_cookies(), Cookies_get(), Cookies_get_LRU(), Cookies_rm_expired_cookies(), Cookies_save_and_free(), Dns_server(), File_check_fds(), File_dillodir_free(), File_send_dir(), File_serve_clients(), Keys::free(), free_services_list(), Keys::getShortcut(), Http_connect_queued_sockets(), Http_connect_socket(), Http_fd_map_remove_all(), Http_server_get(), Http_server_remove(), Http_servers_remove_all(), Http_socket_enqueue(), Http_socket_reuse(), Nav_get_scroll_pos(), Nav_save_scroll_pos(), Nav_stack_clean(), Nav_stack_truncate(), parseOption(), send_bm_page(), Tls_cert_authorities_freeall(), Tls_cert_authorities_print_summary(), Tls_fd_map_remove_all(), Tls_fd_map_remove_all(), Tls_servers_freeall(), Tls_servers_freeall(), UIcmd_find_search_str(), and UIcmd_make_search_str().

◆ dList_prepend()

void dList_prepend ( Dlist lp,
void *  data 
)

Prepend a data item to the list.

Definition at line 605 of file dlib.c.

References dList_insert_pos().

◆ dList_remove()

◆ dList_remove_fast()

◆ dList_sort()

void dList_sort ( Dlist lp,
dCompareFunc  func 
)

Sort the list using a custom function.

Definition at line 758 of file dlib.c.

References Dlist::len, Dlist::list, and QuickSort().

Referenced by File_dillodir_new(), and fill_services_list().

◆ dMalloc()

void * dMalloc ( size_t  size)

Definition at line 45 of file dlib.c.

Referenced by a_Misc_encode_base64(), a_Misc_readtag(), dMalloc0(), and Png_datainfo_callback().

◆ dMalloc0()

void * dMalloc0 ( size_t  size)

Definition at line 61 of file dlib.c.

References dMalloc().

◆ dParser_parse_rc_line()

int dParser_parse_rc_line ( char **  line,
char **  name,
char **  value 
)

Take a dillo rc line and return 'name' and 'value' pointers to it.

Notes:

  • line is modified!
  • it skips blank lines and lines starting with '#'

Return value: 1 on blank line or comment, 0 on successful value/pair, -1 otherwise.

Definition at line 834 of file dlib.c.

References dIsspace, dReturn_val_if_fail, and dStrstrip().

Referenced by fill_services_list(), and Keys::parse().

◆ dRealloc()

void * dRealloc ( void *  mem,
size_t  size 
)

◆ dStr_append()

◆ dStr_append_c()

◆ dStr_append_l()

◆ dStr_cmp()

int dStr_cmp ( Dstr ds1,
Dstr ds2 
)

Compare two dStrs.

Definition at line 478 of file dlib.c.

References Dstr::len, MIN, and Dstr::str.

Referenced by a_Url_cmp().

◆ dStr_erase()

◆ dStr_fit()

void dStr_fit ( Dstr ds)

Return memory if there's too much allocated.

Definition at line 269 of file dlib.c.

References dStr_resize(), and Dstr::len.

Referenced by Cache_entry_inject(), Cache_finish_msg(), and Cache_get_header().

◆ dStr_free()

◆ dStr_insert()

void dStr_insert ( Dstr ds,
int  pos_0,
const char *  s 
)

Insert a C string, at a given position, into a Dstr.

Definition at line 298 of file dlib.c.

References dStr_insert_l().

◆ dStr_insert_l()

void dStr_insert_l ( Dstr ds,
int  pos_0,
const char *  s,
int  l 
)

Insert a C string, at a given position, into a Dstr (providing length).

Note: It also works with embedded nil characters.

Definition at line 278 of file dlib.c.

References dStr_resize(), Dstr::len, Dstr::str, and Dstr::sz.

Referenced by dStr_append_l(), and dStr_insert().

◆ dStr_memmem()

char * dStr_memmem ( Dstr haystack,
Dstr needle 
)

Return a pointer to the first occurrence of needle in haystack.

Definition at line 490 of file dlib.c.

References Dstr::len, and Dstr::str.

◆ dStr_new()

◆ dStr_printable()

const char * dStr_printable ( Dstr in,
int  maxlen 
)

Return a printable representation of the provided Dstr, limited to a length of roughly maxlen.

This is NOT threadsafe.

Definition at line 513 of file dlib.c.

References dStr_append(), dStr_append_c(), dStr_append_l(), dStr_sized_new(), dStr_truncate(), HEX, Dstr::len, and Dstr::str.

Referenced by a_Capi_dpi_verify_request(), a_IO_ccc(), and Http_make_query_str().

◆ dStr_resize()

static void dStr_resize ( Dstr ds,
int  n_sz,
int  keep 
)
static

Private allocator.

Definition at line 234 of file dlib.c.

References dFree(), dNew, dRealloc(), Dstr_char_t, Dstr::len, Dstr::str, and Dstr::sz.

Referenced by dStr_fit(), dStr_insert_l(), dStr_sized_new(), and dStr_vsprintfa().

◆ dStr_shred()

void dStr_shred ( Dstr ds)

Clear a Dstr.

Definition at line 379 of file dlib.c.

References Dstr::str, and Dstr::sz.

Referenced by a_Digest_compute_digest().

◆ dStr_sized_new()

◆ dStr_sprintf()

◆ dStr_sprintfa()

◆ dStr_truncate()

◆ dStr_vsprintf()

void dStr_vsprintf ( Dstr ds,
const char *  format,
va_list  argp 
)

vsprintf-like function.

Definition at line 439 of file dlib.c.

References dStr_truncate(), and dStr_vsprintfa().

Referenced by a_UIcmd_set_msg(), and dStr_sprintf().

◆ dStr_vsprintfa()

void dStr_vsprintfa ( Dstr ds,
const char *  format,
va_list  argp 
)

vsprintf-like function that appends.

Used by: dStr_vsprintf(), dStr_sprintf() and dStr_sprintfa().

Definition at line 401 of file dlib.c.

References dStr_resize(), Dstr::len, Dstr::str, and Dstr::sz.

Referenced by DilloHtml::bugMessage(), dStr_sprintfa(), and dStr_vsprintf().

◆ dStrAsciiCasecmp()

int dStrAsciiCasecmp ( const char *  s1,
const char *  s2 
)

Definition at line 203 of file dlib.c.

References D_ASCII_TOLOWER.

Referenced by a_Cache_download_enabled(), a_Capi_dpi_verify_request(), a_Capi_open_url(), a_Color_parse(), a_Decode_charset_init(), a_Decode_content_init(), a_Decode_transfer_init(), a_Dns_resolve(), a_Domain_parse(), a_Domain_permit(), a_Hsts_set(), a_Html_image_new(), a_Html_tag_set_align_attr(), a_Html_tag_set_valign_attr(), a_Menu_page_popup(), a_Misc_content_type_cmp(), a_UIcmd_view_page_source(), a_Url_hostname(), a_Url_new(), a_Url_same_organization(), StyleEngine::apply(), Auth_host_by_url(), Auth_parse_basic_challenge_cb(), Auth_parse_digest_challenge_cb(), Cache_parse_header(), Capi_request_permitted(), Cookie_control_init(), Cookies_control_check_domain(), Cookies_domain_matches(), Cookies_get(), Cookies_parse(), Cookies_rc_check(), Css_property_info_cmp(), Css_shorthand_info_cmp(), datauri_get_mime(), Dns_assign_channels(), Dns_queue_find(), Domain_match(), Domain_node_by_domain_cmp(), Domain_node_cmp(), Domain_node_cmp(), Domain_node_domain_str_cmp(), File_ext(), File_send_file(), Keys::getCmdCode(), Keys::getKeyCode(), Keys::getModifier(), Hsts_preload(), Html_get_radio_input(), Html_parse_doctype(), Html_tag_content_area(), Html_tag_open_button(), Html_tag_open_form(), Html_tag_open_input(), Html_tag_open_link(), Html_tag_open_meta(), Html_tag_open_style(), Html_tag_open_table(), Html_tag_open_ul(), Http_get(), Http_must_use_proxy(), Http_server_get(), Http_socket_reuse_compatible(), main(), CssSimpleSelector::match(), Menu_bugmeter_validate(), Nav_reload_callback(), CssParser::parse(), CssParser::parseImport(), CssParser::parseMedia(), parseOption(), CssParser::parseUrl(), CssParser::parseValue(), CssParser::parseWeight(), Tls_servers_by_url_cmp(), Tls_servers_by_url_cmp(), Tls_servers_cmp(), Tls_servers_cmp(), and CssParser::tokenMatchesProperty().

◆ dStrconcat()

◆ dStrdup()

char * dStrdup ( const char *  s)

Definition at line 77 of file dlib.c.

References dNew.

Referenced by a_Auth_get_auth_str(), a_Bookmarks_chat_add(), a_Cache_set_content_type(), a_Cookies_get_query(), a_Cookies_get_query(), a_Dialog_input(), a_Domain_parse(), a_History_set_title_by_url(), a_Html_get_attr_wdef(), a_Html_image_new(), a_Http_init(), a_Menu_page_popup(), a_Nav_save_url(), a_Prefs_init(), a_Tls_mbedtls_connect_ready(), a_Tls_openssl_connect_ready(), a_UIcmd_get_location_text(), a_UIcmd_init(), a_Url_decode_hex_str(), a_Url_string_strip_delimiters(), dw::core::Layout::addAnchor(), dw::fltk::ui::FltkOptionMenuResource::addItem(), lout::misc::StringBuffer::append(), CssPropertyList::apply(), Auth_do_auth_dialog_cb(), Auth_do_auth_required(), Auth_parse_basic_challenge_cb(), Auth_parse_digest_challenge_cb(), Auth_realm_add_path(), Bmsrv_modify_add_section(), Bmsrv_modify_add_url(), Bmsrv_modify_update(), Bmsrv_parse_token(), Bmsrv_send_modify_update(), Cache_process_queue(), Capi_conn_new(), Capi_url_uses_dpi(), UI::change_panel(), Cookie_control_init(), Cookies_add_cookie(), Cookies_get(), Cookies_load_cookies(), Cookies_validate_domain(), Cookies_validate_path(), dw::core::style::Font::copyAttrs(), CssPropertyList::CssPropertyList(), datauri_get_data(), datauri_get_mime(), dGethomedir(), DilloHtml::DilloHtml(), Dns_cache_add(), Dns_queue_add(), Dns_server_req(), expires_extremes(), expires_server_ahead(), expires_server_behind(), File_dillodir_new(), File_prepare_send_dir(), File_prepare_send_error_page(), File_prepare_send_file(), File_print_parent_dir(), fill_services_list(), dw::fltk::ui::FltkEntryResource::FltkEntryResource(), dw::fltk::ui::FltkLabelButtonResource::FltkLabelButtonResource(), dw::fltk::ui::FltkMultiLineTextResource::FltkMultiLineTextResource(), form::Form::FormClickedReceiver::FormClickedReceiver(), get_dpi_attr(), get_dpi_dir(), Hsts_set_policy(), Html_tag_content_frame(), Html_tag_content_textarea(), Html_tag_open_font(), Html_tag_open_form(), Html_tag_open_input(), Html_tag_open_meta(), Html_tag_open_optgroup(), Http_get(), Http_get_connect_str(), Http_get_referer(), Http_must_use_proxy(), Http_server_get(), dw::Image::Image(), Keys::init(), dw::fltk::FltkFont::initSystemFonts(), dw::TrieBuilder::insert(), main(), main(), makeStartUrl(), maxage(), Menu_bugmeter_validate(), CssParser::parseImport(), Keys::parseKey(), parseOption(), CssParser::parseUrl(), CssParser::parseValue(), dw::fltk::ui::FltkOptionMenuResource::pushGroup(), form::Form::RadioButtonResourceDecorator::RadioButtonResourceDecorator(), register_all(), register_service(), form::Form::ResourceDecorator::ResourceDecorator(), dw::core::FindtextState::search(), form::Form::SelectionResourceDecorator::SelectionResourceDecorator(), TipWinButton::set_tooltip(), TipWinInput::set_tooltip(), dw::core::Layout::setAnchor(), StyleEngine::setId(), dw::fltk::ui::FltkLabelButtonResource::setLabel(), StyleEngine::setNonCssHint(), CssSimpleSelector::setSelect(), dw::fltk::ui::FltkEntryResource::setText(), TipWinButton::TipWinButton(), TipWinInput::TipWinInput(), Tls_update_cert_authorities_data(), lout::object::Object::toString(), UIcmd_save(), Unescape_html_str(), and Unescape_uri_str().

◆ dStriAsciiStr()

char * dStriAsciiStr ( const char *  haystack,
const char *  needle 
)

Case insensitive strstr.

Definition at line 184 of file dlib.c.

References D_ASCII_TOLOWER.

Referenced by a_Misc_parse_content_type(), Html_parse_doctype(), Html_tag_open_link(), Html_tag_open_meta(), and Html_tag_open_style().

◆ dStrnAsciiCasecmp()

◆ dStrndup()

◆ dStrnfill()

char * dStrnfill ( size_t  len,
char  c 
)

Return a new string of length 'len' filled with 'c' characters.

Definition at line 149 of file dlib.c.

References dNew.

Referenced by Html_process_space().

◆ dStrsep()

char * dStrsep ( char **  orig,
const char *  delim 
)

strsep() implementation

Definition at line 159 of file dlib.c.

Referenced by Cookies_load_cookies(), Html_tag_open_form(), and Http_must_use_proxy().

◆ dStrshred()

void dStrshred ( char *  s)

Clear the contents of the string.

Definition at line 140 of file dlib.c.

Referenced by Auth_do_auth_dialog_cb().

◆ dStrstrip()

char * dStrstrip ( char *  s)

◆ dUsleep()

int dUsleep ( unsigned long  usec)

Portable usleep() function.

The usleep() function is deprecated in POSIX.1-2001 and removed in POSIX.1-2008, see usleep(3).

Definition at line 967 of file dlib.c.

Referenced by Dpi_blocking_start_dpid(), and Dpi_blocking_start_dpid().

◆ QuickSort()

static void QuickSort ( void **  left,
void **  right,
dCompareFunc  compare 
)
static

QuickSort implementation.

This allows for a simple compare function for all the ADT.

Definition at line 725 of file dlib.c.

References QuickSort().

Referenced by dList_sort(), and QuickSort().

Variable Documentation

◆ dLib_show_msg

bool_t dLib_show_msg = TRUE
static

Definition at line 32 of file dlib.c.

Referenced by dLib_show_messages().