| 4727 | #define GUID_STR_LENGTH 37 |
| 4728 | |
| 4729 | static int db_guid_str(Lua lua) |
| 4730 | { |
| 4731 | int nargs = lua_gettop(lua); |
| 4732 | luaL_argcheck(lua, nargs <= 2, 3, "Function may take only one optional guid blob as string argument"); |
| 4733 | |
| 4734 | uuid_t guid; |
| 4735 | if (nargs == 1) |
| 4736 | uuid_generate(guid); |
| 4737 | else { |
| 4738 | blob_t x = {0}; |
| 4739 | luabb_toblob(lua, 2, &x); |
| 4740 | memcpy(guid, x.data, sizeof(guid)); |
| 4741 | } |
| 4742 | |
| 4743 | char guid_str[GUID_STR_LENGTH]; |
| 4744 | uuid_unparse(guid, guid_str); |
| 4745 | |
| 4746 | lua_pushstring(lua, guid_str); |
| 4747 | return 1; |
| 4748 | } |
| 4749 | |
| 4750 | void force_unregister(Lua L, trigger_reg_t *reg) |
| 4751 | { |
nothing calls this directly
no test coverage detected