Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

htstring.cc File Reference

#include "global.h"
#include "htatom.h"
#include "htdebug.h"
#include "htstring.h"
#include "snprintf.h"
#include "stream.h"
#include "tools.h"
#include <ctype.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>

Go to the source code of this file.

Defines

#define ATOM_HT_DATA_STRING   MAGICD("STR\x00")
#define ATOM_COMPARE_KEYS_STRING   MAGICD("STR\x10")
#define ATOM_ICOMPARE_KEYS_STRING   MAGICD("STR\x11")

Functions

char * ht_strdup (const char *str)
char * ht_strndup (const char *str, int maxlen)
int ht_strncpy (char *s1, const char *s2, int maxlen)
int ht_strncmp (const char *s1, const char *s2, size_t max)
int ht_strnicmp (const char *s1, const char *s2, size_t max)
int ht_stricmp (const char *s1, const char *s2)
int strccomm (const char *s1, const char *s2)
int strcicomm (const char *s1, const char *s2)
int escape_special_str (char *result, int resultmaxlen, const char *s, const char *specialchars, bool bit7)
int escape_special (char *result, int resultmaxlen, const void *S, int len, const char *specialchars, bool bit7)
int unescape_special_str (char *result, int resultmaxlen, const char *s)
int unescape_special (void *Result, int resultmaxlen, const char *s)
int bin2str (char *result, const void *S, int len)
void wide_char_to_multi_byte (char *result, const byte *Unicode, int maxlen)
void whitespaces (char **str)
void non_whitespaces (char **str)
bool waitforchar (char **str, char b)
bool bnstr (char **str, qword *q, int defaultbase)
bool bnstr (char **str, dword *v, int defaultbase)
int hexdigit (char a)
bool hexb_ex (uint8 &result, const char *s)
bool hexw_ex (uint16 &result, const char *s)
bool hexd_ex (uint32 &result, const char *s)
char * mkhexb (char *buf, byte d)
char * mkhexw (char *buf, word d)
char * mkhexd (char *buf, dword d)
char * mkhexq (char *buf, qword q)
int compare_keys_string (Object *key_a, Object *key_b)
int icompare_keys_string (Object *key_a, Object *key_b)
 BUILDER (ATOM_HT_DATA_STRING, ht_data_string)
bool init_string ()
void done_string ()

Variables

char hexchars [17] = "0123456789abcdef"


Define Documentation

#define ATOM_COMPARE_KEYS_STRING   MAGICD("STR\x10")
 

Definition at line 35 of file htstring.cc.

Referenced by done_string(), and init_string().

#define ATOM_HT_DATA_STRING   MAGICD("STR\x00")
 

Definition at line 34 of file htstring.cc.

Referenced by done_string(), init_string(), and ht_data_string::object_id().

#define ATOM_ICOMPARE_KEYS_STRING   MAGICD("STR\x11")
 

Definition at line 36 of file htstring.cc.

Referenced by done_string(), and init_string().


Function Documentation

int bin2str char *  result,
const void *  S,
int  len
 

Definition at line 297 of file htstring.cc.

References byte, len, and S.

Referenced by ht_uformat_viewer::address_input(), blockop_dialog(), create_request_evalstr(), create_request_expr(), create_request_vregex(), eval_dialog(), FileBrowser::extract_url(), ht_undo_data_delete_string::gettext(), ht_undo_data_delete_string2::gettext(), ht_undo_data_insert_string::gettext(), ht_undo_data_overwrite_string::gettext(), inputboxrect(), test_str_to_ofs(), and test_str_to_pos().

bool bnstr char **  str,
dword *  v,
int  defaultbase
 

Definition at line 436 of file htstring.cc.

bool bnstr char **  str,
qword *  q,
int  defaultbase
 

Definition at line 385 of file htstring.cc.

BUILDER ATOM_HT_DATA_STRING  ,
ht_data_string 
 

int compare_keys_string Object key_a,
Object key_b
 

Definition at line 621 of file htstring.cc.

References value.

Referenced by ht_registry::create_subdir(), ht_string_list::init(), ht_registry::init(), init_analy_names(), and init_string().

void done_string  ) 
 

Definition at line 656 of file htstring.cc.

References ATOM_COMPARE_KEYS_STRING, ATOM_HT_DATA_STRING, ATOM_ICOMPARE_KEYS_STRING, UNREGISTER, and unregister_atom().

int escape_special char *  result,
int  resultmaxlen,
const void *  S,
int  len,
const char *  specialchars,
bool  bit7
 

Definition at line 165 of file htstring.cc.

References byte, hexchars, len, and S.

Referenced by create_desc_evalstr(), create_desc_expr(), create_desc_hexascii(), create_desc_vregex(), escape_special_str(), and AnalyserOutput::generateAddr().

int escape_special_str char *  result,
int  resultmaxlen,
const char *  s,
const char *  specialchars,
bool  bit7
 

Definition at line 160 of file htstring.cc.

References escape_special().

Referenced by ht_object_stream_txt::putString(), and token_translate().

bool hexb_ex uint8 &  result,
const char *  s
 

Definition at line 458 of file htstring.cc.

References hexdigit().

Referenced by hexw_ex(), load_fileconfig(), and load_systemconfig().

bool hexd_ex uint32 &  result,
const char *  s
 

Definition at line 476 of file htstring.cc.

References hexw_ex(), and uint16.

int hexdigit char  a  ) 
 

Definition at line 446 of file htstring.cc.

Referenced by ht_object_stream_txt::getBinary(), hexb_ex(), and unescape_special().

bool hexw_ex uint16 &  result,
const char *  s
 

Definition at line 468 of file htstring.cc.

References hexb_ex(), and uint8.

Referenced by hexd_ex(), load_fileconfig(), and load_systemconfig().

char* ht_strdup const char *  str  ) 
 

Definition at line 40 of file htstring.cc.

References len, NULL, and smalloc().

Referenced by ClassMethod::ClassMethod(), clipboard_add_copy_history_entry(), create_blockop_int_context(), ht_static_treeview::create_node(), export_func_name(), get_config_string(), ht_aviewer::handlemsg(), ht_info_viewer::handlemsg(), ht_data_string::ht_data_string(), ht_expr_search_request::ht_expr_search_request(), ht_history_entry::ht_history_entry(), ht_il_metadata_entry::ht_il_metadata_entry(), ht_log_msg::ht_log_msg(), ht_pe_export_function::ht_pe_export_function(), ht_pe_import_function::ht_pe_import_function(), ht_pe_import_library::ht_pe_import_library(), ht_pef_import_function::ht_pef_import_function(), ht_pef_import_library::ht_pef_import_library(), ht_regex_search_request::ht_regex_search_request(), ht_registry_data_string::ht_registry_data_string(), ht_xbe_import_function::ht_xbe_import_function(), ht_status::idle(), import_func_name(), info_history_entry::info_history_entry(), AnalyInfoline::init(), ht_button::init(), ht_statictext::init(), ht_label::init(), ht_collapsable_sub::init(), ht_context_menu::init(), ht_view::init(), RegNodeFile::init(), ht_static_context_menu::insert_entry(), ht_text_listbox::insert_str(), ht_text_listbox::insert_str_extra(), Analyser::newSymbol(), SymbolBox::quickfindCompletition(), ht_project_listbox::quickfindCompletition(), ht_history_listbox::quickfindCompletition(), ht_listbox::quickfindCompletition(), ht_text_listbox::quickfindCompletition(), VfsListbox::quickfindCompletition(), ht_statictext::settext(), ht_frame::settext(), ht_listbox_title::setTextv(), and ht_window::settitle().

int ht_stricmp const char *  s1,
const char *  s2
 

Definition at line 126 of file htstring.cc.

Referenced by LocalFs::compareFilenames(), ht_app::create_window_file_text(), and icompare_keys_string().

int ht_strncmp const char *  s1,
const char *  s2,
size_t  max
 

Definition at line 91 of file htstring.cc.

Referenced by ht_text_listbox::compare_strn(), ht_project_listbox::quickfind(), ht_history_listbox::quickfind(), SymbolBox::quickfindCompletition(), ht_project_listbox::quickfindCompletition(), and ht_history_listbox::quickfindCompletition().

int ht_strncpy char *  s1,
const char *  s2,
int  maxlen
 

Like strcpy but copies a maximum of |maxlen| characters (including trainling zero). The operation is performed in a way that the trailing zero is always written if maxlen is > 0.

Returns:
number of characters copied (without trailing zero)

Definition at line 77 of file htstring.cc.

char* ht_strndup const char *  str,
int  maxlen
 

Like ht_strdup but dups a maximum of |maxlen| characters of |str|.

Returns:
new string

Definition at line 56 of file htstring.cc.

References len, MIN, NULL, and smalloc().

int ht_strnicmp const char *  s1,
const char *  s2,
size_t  max
 

Definition at line 108 of file htstring.cc.

Referenced by ht_itext_listbox::compare_strn(), and parse_info_node().

int icompare_keys_string Object key_a,
Object key_b
 

Definition at line 633 of file htstring.cc.

References ht_stricmp(), and value.

Referenced by init_string().

bool init_string  ) 
 

Definition at line 644 of file htstring.cc.

References ATOM_COMPARE_KEYS_STRING, ATOM_HT_DATA_STRING, ATOM_ICOMPARE_KEYS_STRING, compare_keys_string(), icompare_keys_string(), REGISTER, and register_atom().

char* mkhexb char *  buf,
byte  d
 

Definition at line 484 of file htstring.cc.

References buf, and hexchars.

Referenced by ht_uformat_viewer::render_tagstring().

char* mkhexd char *  buf,
dword  d
 

Definition at line 500 of file htstring.cc.

References buf, and hexchars.

Referenced by ht_disasm_sub::getline(), ht_hex_sub::getline(), and ht_uformat_viewer::render_tagstring().

char* mkhexq char *  buf,
qword  q
 

Definition at line 513 of file htstring.cc.

References buf, and hexchars.

Referenced by ht_uformat_viewer::render_tagstring().

char* mkhexw char *  buf,
word  d
 

Definition at line 491 of file htstring.cc.

References buf, and hexchars.

Referenced by ht_uformat_viewer::render_tagstring().

void non_whitespaces char **  str  ) 
 

Definition at line 340 of file htstring.cc.

int strccomm const char *  s1,
const char *  s2
 

Definition at line 144 of file htstring.cc.

Referenced by ht_text_listbox::compare_ccomm(), SymbolBox::quickfindCompletition(), ht_project_listbox::quickfindCompletition(), and ht_history_listbox::quickfindCompletition().

int strcicomm const char *  s1,
const char *  s2
 

Definition at line 152 of file htstring.cc.

Referenced by ht_itext_listbox::compare_ccomm().

int unescape_special void *  Result,
int  resultmaxlen,
const char *  s
 

Definition at line 239 of file htstring.cc.

References byte, and hexdigit().

Referenced by unescape_special_str().

int unescape_special_str char *  result,
int  resultmaxlen,
const char *  s
 

Definition at line 232 of file htstring.cc.

References unescape_special().

Referenced by ht_object_stream_txt::getString().

bool waitforchar char **  str,
char  b
 

Definition at line 347 of file htstring.cc.

void whitespaces char **  str  ) 
 

Definition at line 332 of file htstring.cc.

Referenced by ht_info_viewer::find_node(), and parse_xref_body().

void wide_char_to_multi_byte char *  result,
const byte *  Unicode,
int  maxlen
 

Definition at line 310 of file htstring.cc.


Variable Documentation

char hexchars[17] = "0123456789abcdef"
 

Definition at line 38 of file htstring.cc.

Referenced by escape_special(), mkhexb(), mkhexd(), mkhexq(), and mkhexw().


Generated on Fri May 7 21:15:49 2004 by doxygen 1.3.5