| 4373 | "0123456789-_"; |
| 4374 | |
| 4375 | uint64_t moduleTypeEncodeId(const char *name, int encver) { |
| 4376 | /* We use 64 symbols so that we can map each character into 6 bits |
| 4377 | * of the final output. */ |
| 4378 | const char *cset = ModuleTypeNameCharSet; |
| 4379 | if (strlen(name) != 9) return 0; |
| 4380 | if (encver < 0 || encver > 1023) return 0; |
| 4381 | |
| 4382 | uint64_t id = 0; |
| 4383 | for (int j = 0; j < 9; j++) { |
| 4384 | const char *p = strchr(cset,name[j]); |
| 4385 | if (!p) return 0; |
| 4386 | unsigned long pos = p-cset; |
| 4387 | id = (id << 6) | pos; |
| 4388 | } |
| 4389 | id = (id << 10) | encver; |
| 4390 | return id; |
| 4391 | } |
| 4392 | |
| 4393 | /* Search, in the list of exported data types of all the modules registered, |
| 4394 | * a type with the same name as the one given. Returns the moduleType |
no outgoing calls
no test coverage detected