如何在apache2.2中生成uuid?

时间:2016-06-24 06:15:06

标签: apache apache2.2

#include<apr_uuid.h>
char* gen_UUID()
{
 apr_uuid_t *t;
 char ch[40];
 apr_uuid_get(t);
 apr_uuid_parse(uuid,ch);
}

我收到了分段错误。

1 个答案:

答案 0 :(得分:0)

生成uuiD

char* generate_UUID(request_rec *r)
{ 
   apr_uuid_t *uuid; char uuid_str[40]; 
   uuid=(apr_uuid_t *)apr_palloc(r->pool,sizeof(apr_uuid_t));
   apr_uuid_get(uuid); 
   apr_uuid_format(uuid_str,uuid); ap_rprintf(r,"after format %s",uuid_str); 
   return uuid_str; 
}