MCPcopy Create free account
hub / github.com/NetHack/NetHack / get_nhuuid

Function get_nhuuid

sys/unix/unixmain.c:848–871  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

846#endif
847
848void
849get_nhuuid(void)
850{
851#if defined(NHUUID)
852 char struuid[NHUUIDSZ] = { 0 };
853#if defined(LINUX) && defined(NHUUID)
854 uuid_t binuuid;
855#endif
856
857 if (svn.nhuuid[0])
858 return;
859
860#if defined(MACOS)
861 get_macos_uuid(&struuid[0]);
862#elif defined(LINUX)
863 uuid_generate_random(binuuid);
864 uuid_unparse(binuuid, struuid);
865#endif /* MACOS || LINUX */
866
867 if (struuid[0])
868 Snprintf(svn.nhuuid, sizeof svn.nhuuid, "%s", struuid);
869
870#endif /* NHUUID */
871}
872
873void
874free_nhuuid(void)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected