All pastes #914090 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-22 16:43 UTC
rendered paste body
 /* generate a DCE 1.1 v1 UUID from system environment */
 char *uuid_v1(void)
 {
     uuid_t *uuid;
     char *str;

     uuid_create(&uuid);
     uuid_make(uuid, UUID_MAKE_V1);
     str = NULL;
     uuid_export(uuid, UUID_FMT_STR, &str, NULL);
     uuid_destroy(uuid);
     return str;
 }

=================================================================

int generateUUID(char * uniqueid) {

        uuid_t *uuid;
        uuid_create(&uuid);
        uuid_make(uuid, UUID_MAKE_V1);
        uniqueid = NULL;
        uuid_export(uuid, UUID_FMT_STR, (void**)&uniqueid, NULL);
        uuid_destroy(uuid);
        return 0;
}