-#define __ASN_E_cbc(buf, size) (cb((buf), (size), app_key) < 0)
-#define _ASN_E_CALLBACK(foo) do { \
- if(foo) goto cb_failed; \
- } while(0)
-#define _ASN_CALLBACK(buf, size) \
- _ASN_E_CALLBACK(__ASN_E_cbc(buf, size))
-#define _ASN_CALLBACK2(buf1, size1, buf2, size2) \
- _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) || __ASN_E_cbc(buf2, size2))
-#define _ASN_CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \
- _ASN_E_CALLBACK(__ASN_E_cbc(buf1, size1) \
- || __ASN_E_cbc(buf2, size2) \
- || __ASN_E_cbc(buf3, size3))
-
-#define _i_ASN_TEXT_INDENT(nl, level) do { \
- int __level = (level); \
- int __nl = ((nl) != 0); \
- int __i; \
- if(__nl) _ASN_CALLBACK("\n", 1); \
- for(__i = 0; __i < __level; __i++) \
- _ASN_CALLBACK(" ", 4); \
- er.encoded += __nl + 4 * __level; \
-} while(0)
-
-#define _i_INDENT(nl) do { \
- int __i; \
- if((nl) && cb("\n", 1, app_key) < 0) return -1; \
- for(__i = 0; __i < ilevel; __i++) \
- if(cb(" ", 4, app_key) < 0) return -1; \
-} while(0)
+#define ASN__E_cbc(buf, size) (cb((buf), (size), app_key) < 0)
+#define ASN__E_CALLBACK(size, foo) \
+ do { \
+ if(foo) goto cb_failed; \
+ er.encoded += (size); \
+ } while(0)
+#define ASN__CALLBACK(buf, size) ASN__E_CALLBACK(size, ASN__E_cbc(buf, size))
+#define ASN__CALLBACK2(buf1, size1, buf2, size2) \
+ ASN__E_CALLBACK((size1) + (size2), \
+ ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2))
+#define ASN__CALLBACK3(buf1, size1, buf2, size2, buf3, size3) \
+ ASN__E_CALLBACK((size1) + (size2) + (size3), \
+ ASN__E_cbc(buf1, size1) || ASN__E_cbc(buf2, size2) \
+ || ASN__E_cbc(buf3, size3))
+
+#define ASN__TEXT_INDENT(nl, level) \
+ do { \
+ int tmp_level = (level); \
+ int tmp_nl = ((nl) != 0); \
+ int tmp_i; \
+ if(tmp_nl) ASN__CALLBACK("\n", 1); \
+ if(tmp_level < 0) tmp_level = 0; \
+ for(tmp_i = 0; tmp_i < tmp_level; tmp_i++) ASN__CALLBACK(" ", 4); \
+ } while(0)
+
+#define _i_INDENT(nl) do { \
+ int tmp_i; \
+ if((nl) && cb("\n", 1, app_key) < 0) \
+ return -1; \
+ for(tmp_i = 0; tmp_i < ilevel; tmp_i++) \
+ if(cb(" ", 4, app_key) < 0) \
+ return -1; \
+ } while(0)