- Timestamp:
- 2018-07-03T05:58:47Z (6 years ago)
- Branches:
- master
- Children:
- c17d0af
- Parents:
- 49ab3cb
- git-author:
- dequis <dx@…> (03-07-18 05:27:59)
- git-committer:
- dequis <dx@…> (03-07-18 05:58:47)
- Location:
- lib
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
lib/misc.c
r49ab3cb r9e83b15 774 774 } 775 775 } 776 777 /* copied from irssi's misc.c, by timo sirainen */ 778 int b_istr_equal(gconstpointer v, gconstpointer v2) 779 { 780 return g_ascii_strcasecmp((const char *) v, (const char *) v2) == 0; 781 } 782 783 /* copied from irssi's misc.c, by lemonboy */ 784 guint b_istr_hash(gconstpointer v) 785 { 786 const signed char *p; 787 guint32 h = 5381; 788 789 for (p = v; *p != '\0'; p++) { 790 h = (h << 5) + h + g_ascii_toupper(*p); 791 } 792 793 return h; 794 } -
lib/misc.h
r49ab3cb r9e83b15 151 151 G_MODULE_EXPORT char *str_pad_and_truncate(const char *string, long char_len, const char *ellipsis); 152 152 153 G_MODULE_EXPORT int b_istr_equal(gconstpointer v, gconstpointer v2); 154 G_MODULE_EXPORT guint b_istr_hash(gconstpointer v); 155 153 156 #endif
Note: See TracChangeset
for help on using the changeset viewer.