ghazel-curb 0.6.2.2 → 0.6.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/curb_easy.c +15 -0
- data/ext/curb_macros.h +1 -1
- metadata +1 -1
data/ext/curb_easy.c
CHANGED
@@ -26,6 +26,21 @@ static VALUE rbstrAmp;
|
|
26
26
|
VALUE cCurlEasy;
|
27
27
|
|
28
28
|
|
29
|
+
/* XXX: This is copy/pasted from ruby 1.8.7 for compatibility with ruby 1.8.6 */
|
30
|
+
|
31
|
+
VALUE
|
32
|
+
rb_hash_lookup_187(hash, key)
|
33
|
+
VALUE hash, key;
|
34
|
+
{
|
35
|
+
VALUE val;
|
36
|
+
|
37
|
+
if (!st_lookup(RHASH(hash)->tbl, key, &val)) {
|
38
|
+
return Qnil; /* without Hash#default */
|
39
|
+
}
|
40
|
+
return val;
|
41
|
+
}
|
42
|
+
|
43
|
+
|
29
44
|
/* ================== CURL HANDLER FUNCS ==============*/
|
30
45
|
|
31
46
|
/* These handle both body and header data */
|
data/ext/curb_macros.h
CHANGED
@@ -12,7 +12,7 @@
|
|
12
12
|
#define rb_easy_set(key,val) rb_hash_aset(rbce->opts, rb_easy_hkey(key) , val)
|
13
13
|
#define rb_easy_get(key) rb_hash_aref(rbce->opts, rb_easy_hkey(key))
|
14
14
|
#define rb_easy_del(key) rb_hash_delete(rbce->opts, rb_easy_hkey(key))
|
15
|
-
#define rb_easy_nil(key) (
|
15
|
+
#define rb_easy_nil(key) (rb_hash_lookup_187(rbce->opts, rb_easy_hkey(key)) == Qnil)
|
16
16
|
#define rb_easy_type_check(key,type) (rb_type(rb_hash_aref(rbce->opts, rb_easy_hkey(key))) == type)
|
17
17
|
|
18
18
|
// TODO: rb_sym_to_s may not be defined?
|