|
|
@ -126,6 +126,7 @@ bencode_item_t *bencode_dictionary_add_len(bencode_item_t *dict, const char *key |
|
|
* bencode_buffer_t object. */ |
|
|
* bencode_buffer_t object. */ |
|
|
INLINE bencode_item_t *bencode_dictionary_add_string(bencode_item_t *dict, const char *key, const char *val); |
|
|
INLINE bencode_item_t *bencode_dictionary_add_string(bencode_item_t *dict, const char *key, const char *val); |
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val); |
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val); |
|
|
|
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_len(bencode_item_t *dict, const char *key, const char *val, int len); |
|
|
|
|
|
|
|
|
/* Ditto, but for a "str" object */ |
|
|
/* Ditto, but for a "str" object */ |
|
|
INLINE bencode_item_t *bencode_dictionary_add_str(bencode_item_t *dict, const char *key, const str *val); |
|
|
INLINE bencode_item_t *bencode_dictionary_add_str(bencode_item_t *dict, const char *key, const str *val); |
|
|
@ -407,6 +408,12 @@ INLINE bencode_item_t *bencode_dictionary_add_string(bencode_item_t *dict, const |
|
|
return bencode_dictionary_add(dict, key, bencode_string(bencode_item_buffer(dict), val)); |
|
|
return bencode_dictionary_add(dict, key, bencode_string(bencode_item_buffer(dict), val)); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_len(bencode_item_t *dict, const char *key, const char *val, int len) { |
|
|
|
|
|
if (!val) |
|
|
|
|
|
return NULL; |
|
|
|
|
|
return bencode_dictionary_add(dict, key, bencode_string_len(bencode_item_buffer(dict), val, len)); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val) { |
|
|
INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val) { |
|
|
if (!val) |
|
|
if (!val) |
|
|
return NULL; |
|
|
return NULL; |
|
|
|