MCPcopy Create free account
hub / github.com/acl-dev/acl / create_decode_tab

Method create_decode_tab

lib_acl_cpp/src/mime/mime_code.cpp:282–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

280}
281
282void mime_code::create_decode_tab(const unsigned char *toTab, string *out)
283{
284 unsigned char tab[255];
285 char buf[32];
286 unsigned char *cp;
287 int i, n = (int) strlen((const char*) toTab);
288
289 memset(tab, 0xff, sizeof(tab));
290
291 for (i = 0; i < n; i++) {
292 tab[toTab[i]] = (unsigned char) i;
293 }
294
295 out->clear();
296 for (i = 0, cp = tab; cp < tab + sizeof(tab); cp++) {
297 if (i++ % 16 == 0) {
298 out->append("\r\n");
299 }
300 safe_snprintf(buf, sizeof(buf), "%d, ", *cp);
301 out->append((char*) buf);
302 }
303}
304
305void mime_code::set_status(bool encoding)
306{

Callers

nothing calls this directly

Calls 3

safe_snprintfFunction · 0.85
clearMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected