int encode_ChopstixItemStyle(unsigned char *p, size_t len, const ChopstixItemStyle *data, size_t *size) { size_t ret = 0; size_t l; int i, e; i = 0; { int oldret = ret; ret = 0; e = encode_general_string(p, len, &(data)->name, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 1, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_integer(p, len, &(data)->num, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 0, &l); BACK; ret += oldret; } e = der_put_length_and_tag (p, len, ret, ASN1_C_UNIV, CONS, UT_Sequence, &l); BACK; *size = ret; return 0; }
int encode_ChopstixCreditNumber(unsigned char *p, size_t len, const ChopstixCreditNumber *data, size_t *size) { size_t ret = 0; size_t l; int i, e; i = 0; e = encode_general_string(p, len, data, &l); BACK; *size = ret; return 0; }
int encode_Realm(unsigned char *p, size_t len, const Realm *data, size_t *size) { size_t ret = 0; size_t l; int i, e; i = 0; e = encode_general_string(p, len, data, &l); BACK; *size = ret; return 0; }
int encode_PrincipalName(unsigned char *p, size_t len, const PrincipalName *data, size_t *size) { size_t ret = 0; size_t l; int i, e; i = 0; { int oldret = ret; ret = 0; for(i = (&(data)->name_string)->len - 1; i >= 0; --i) { int oldret = ret; ret = 0; e = encode_general_string(p, len, &(&(data)->name_string)->val[i], &l); BACK; ret += oldret; } e = der_put_length_and_tag (p, len, ret, ASN1_C_UNIV, CONS, UT_Sequence, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 1, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_NAME_TYPE(p, len, &(data)->name_type, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 0, &l); BACK; ret += oldret; } e = der_put_length_and_tag (p, len, ret, ASN1_C_UNIV, CONS, UT_Sequence, &l); BACK; *size = ret; return 0; }
int encode_ChopstixMenuitem(unsigned char *p, size_t len, const ChopstixMenuitem *data, size_t *size) { size_t ret = 0; size_t l; int i, e; i = 0; { int oldret = ret; ret = 0; e = encode_ChopstixFlags(p, len, &(data)->flags, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 8, &l); BACK; ret += oldret; } if((data)->subitems) { int oldret = ret; ret = 0; e = encode_ChopstixItemExtras(p, len, (data)->subitems, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 7, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_ChopstixItemExtras(p, len, &(data)->extras, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 6, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_ChopstixItemStyles(p, len, &(data)->styles, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 5, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_integer(p, len, &(data)->price, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 4, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_general_string(p, len, &(data)->name, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 2, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_ChopstixItemCode(p, len, &(data)->code, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 1, &l); BACK; ret += oldret; } { int oldret = ret; ret = 0; e = encode_integer(p, len, &(data)->gen, &l); BACK; e = der_put_length_and_tag (p, len, ret, ASN1_C_CONTEXT, CONS, 0, &l); BACK; ret += oldret; } e = der_put_length_and_tag (p, len, ret, ASN1_C_UNIV, CONS, UT_Sequence, &l); BACK; *size = ret; return 0; }