! * \brief l_genCaseString() * * \param[in] ifunc index into set of functions in generated file * \param[in] itype index into type of function to be used * \return case string for this decoding function * * * Notes: * (1) %ifunc and %itype have been validated, so no error can occur * */
| 747 | * </pre> |
| 748 | */ |
| 749 | static char * |
| 750 | l_genCaseString(l_int32 ifunc, |
| 751 | l_int32 itype) |
| 752 | { |
| 753 | char buf[256]; |
| 754 | char *code = NULL; |
| 755 | |
| 756 | snprintf(buf, sizeof(buf), " case %d:\n", ifunc); |
| 757 | stringJoinIP(&code, buf); |
| 758 | snprintf(buf, sizeof(buf), |
| 759 | " data1 = decodeBase64(l_strdata_%d, strlen(l_strdata_%d), " |
| 760 | "&size1);\n", ifunc, ifunc); |
| 761 | stringJoinIP(&code, buf); |
| 762 | stringJoinIP(&code, |
| 763 | " data2 = zlibUncompress(data1, size1, &size2);\n"); |
| 764 | snprintf(buf, sizeof(buf), |
| 765 | " result = (void *)%s(data2, size2);\n", |
| 766 | l_assoc[itype].memreader); |
| 767 | stringJoinIP(&code, buf); |
| 768 | stringJoinIP(&code, " lept_free(data1);\n"); |
| 769 | stringJoinIP(&code, " lept_free(data2);\n"); |
| 770 | stringJoinIP(&code, " break;\n"); |
| 771 | return code; |
| 772 | } |
| 773 | |
| 774 | |
| 775 | /*! |
no test coverage detected