MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / db_guid_str

Function db_guid_str

lua/sp.c:4729–4748  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4727#define GUID_STR_LENGTH 37
4728
4729static 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
4750void force_unregister(Lua L, trigger_reg_t *reg)
4751{

Callers

nothing calls this directly

Calls 3

lua_gettopFunction · 0.85
luabb_toblobFunction · 0.85
lua_pushstringFunction · 0.85

Tested by

no test coverage detected