您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ uuid_create函数代码示例

51自学网 2021-06-03 09:26:20
  C++
这篇教程C++ uuid_create函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中uuid_create函数的典型用法代码示例。如果您正苦于以下问题:C++ uuid_create函数的具体用法?C++ uuid_create怎么用?C++ uuid_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了uuid_create函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: generate35

static int generate35( lua_State *L, uuid_fmt_t fmt, int ver, const char *ns,                        const char *name ){    uuid_rc_t rc = 0;    uuid_t *uid = NULL;    uuid_t *uid_ns = NULL;        // create context    if( ( rc = uuid_create( &uid ) ) == UUID_RC_OK &&         ( rc = uuid_create( &uid_ns ) ) == UUID_RC_OK &&         ( rc = uuid_load( uid_ns, ns ) ) == UUID_RC_OK &&         ( rc = uuid_make( uid, ver, uid_ns, name ) ) == UUID_RC_OK ){        uuid_export2lua( &rc, L );        uuid_destroy( uid );        uuid_destroy( uid_ns );    }    else if( uid )    {        uuid_destroy( uid );        if( uid_ns ){            uuid_destroy( uid_ns );        }    }        return ( rc == UUID_RC_OK ) ? 1 : luaL_error( L, "%s", uuid_error( rc ) );}
开发者ID:mah0x211,项目名称:lua-ossp-uuid,代码行数:26,


示例2: cmd_pfs_create

intcmd_pfs_create(const char *sel_path, const char *name,	       uint8_t pfs_type, const char *uuid_str){	hammer2_ioc_pfs_t pfs;	int ecode = 0;	int fd;	uint32_t status;	/*	 * Default to MASTER if no uuid was specified.	 * Default to SLAVE if a uuid was specified.	 *	 * When adding masters to a cluster, the new PFS must be added as	 * a slave and then upgraded to ensure proper synchronization.	 */	if (pfs_type == HAMMER2_PFSTYPE_NONE) {		if (uuid_str)			pfs_type = HAMMER2_PFSTYPE_SLAVE;		else			pfs_type = HAMMER2_PFSTYPE_MASTER;	}	if ((fd = hammer2_ioctl_handle(sel_path)) < 0)		return(1);	bzero(&pfs, sizeof(pfs));	snprintf(pfs.name, sizeof(pfs.name), "%s", name);	pfs.pfs_type = pfs_type;	if (uuid_str) {		uuid_from_string(uuid_str, &pfs.pfs_clid, &status);	} else {		uuid_create(&pfs.pfs_clid, &status);	}	if (status == uuid_s_ok)		uuid_create(&pfs.pfs_fsid, &status);	if (status == uuid_s_ok) {		if (ioctl(fd, HAMMER2IOC_PFS_CREATE, &pfs) < 0) {			if (errno == EEXIST) {				fprintf(stderr,					"NOTE: Typically the same name is "					"used for cluster elements on "					"different mounts,/n"					"      but cluster elements on the "					"same mount require unique names./n"					"pfs-create %s: already present/n",					name);			} else {				perror("ioctl");			}			ecode = 1;		}	} else {		fprintf(stderr, "hammer2: pfs_create: badly formed uuid/n");		ecode = 1;	}	close(fd);	return (ecode);}
开发者ID:wan721,项目名称:DragonFlyBSD,代码行数:58,


示例3: lua_fn_uuid_create

static intlua_fn_uuid_create(lua_State *L) {  uuid_t uuid;  uuid_create(&uuid);  lua_pushx_uuid(L, &uuid);  return 1;}
开发者ID:Geramy,项目名称:cosimus,代码行数:7,


示例4: _soap_addressing_generate_id

static char *_soap_addressing_generate_id(void){  uuid_t uuid;  uint32_t status;  char *ret, *buf;  uuid_create(&uuid, &status);  if (status != uuid_s_ok)  {    log_error("uuidcreate failed (%s)", _soap_addressing_uuid_error(status));    return NULL;  }  uuid_to_string(&uuid, &buf, &status);  if (status != uuid_s_ok)  {    log_error("uuid_to_string failed (%s)", _soap_addressing_uuid_error(status));    return NULL;  }  if (!(ret = (char *)malloc(128)))  {    log_error("malloc failed (%s)", strerror(errno));    free(buf);    return NULL;  }  sprintf(ret, "%s/%s", soap_server_get_name(), buf);  free(buf);  return ret;}
开发者ID:ayang64,项目名称:csoap,代码行数:34,


示例5: _uuuid_create

static void _uuuid_create(struct uuuid_t** uuuid, int* status, int nil){	struct uuuid_t* u;	uint32_t st;	u = uuuid_new();	if (!u) {		*status = UUUID_ERR;		return;	}	if (nil)		uuid_create_nil(&u->uuid, &st);	else		uuid_create(&u->uuid, &st);	if (st != uuid_s_ok) {		uuuid_free(u);		*status = UUUID_ERR;		return;	}	*uuuid = u;	*status = UUUID_OK;}
开发者ID:jpalus,项目名称:libuuuid,代码行数:26,


示例6: uuid_generate

void FFEADContext::addBean(Bean& bean){	StringUtil::trim(bean.name);	if(bean.name=="") {#ifdef HAVE_LIBUUID		uuid_t idt;		uuid_generate(idt);		std::string ids;		for(int i=0;i<16;i++){			ids.push_back(idt[i]);		}		bean.name = ids;#elif HAVE_BSDUUIDINC		uuid_t idt;		uint32_t status;		uuid_create(&idt, &status);		std::string ids((const char *) &idt, sizeof(idt));		bean.name = ids;#else		bean.name = CastUtil::lexical_cast<std::string>(Timer::getCurrentTime());#endif	}	if(bean.name!="" && beans.find(bean.appName+bean.name)==beans.end())		beans[bean.appName+bean.name] = bean;}
开发者ID:sumeetchhetri,项目名称:ffead-cpp,代码行数:26,


示例7: CoCreateGuid

HRESULTPALAPICoCreateGuid(OUT GUID * pguid){#if HAVE_BSD_UUID_H    uuid_t uuid;    uint32_t status;    uuid_create(&uuid, &status);    if (status != uuid_s_ok)    {        ASSERT("Unexpected uuid_create failure (status=%u)/n", status);        PROCAbort();    }    // Encode the uuid with little endian.    uuid_enc_le(pguid, &uuid);#elif HAVE_LIBUUID_H    uuid_generate_random(*(uuid_t*)pguid);    // Change the byte order of the Data1, 2 and 3, since the uuid_generate_random    // generates them with big endian while GUIDS need to have them in little endian.    pguid->Data1 = SWAP32(pguid->Data1);    pguid->Data2 = SWAP16(pguid->Data2);    pguid->Data3 = SWAP16(pguid->Data3);#else    #error Don't know how to generate UUID on this platform#endif    return 0;}
开发者ID:0-wiz-0,项目名称:coreclr,代码行数:29,


示例8: getUid

string getUid(){	string myguid;		uuid_tt u;	int emsg = uuid_create(&u);		if( emsg != 1 )	{		cout << "ERROR GENERATING UID" << endl;		return "0";	}		char suid[64];		sprintf(suid, "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-", u.time_low, u.time_mid,			u.time_hi_and_version, u.clock_seq_hi_and_reserved,			u.clock_seq_low);		for (int i = 0; i < 6; i++)		sprintf(suid+strlen(suid),"%2.2x", u.node[i]);		sprintf(suid+strlen(suid),"/0");		myguid = suid;	cout << "generated uid : " << myguid << endl;		return myguid;}
开发者ID:csugrue,项目名称:ensanche,代码行数:29,


示例9: uuid_dce_to_string

/* export UUID to string representation */void uuid_dce_to_string(uuid_dce_t *uuid_dce, char **str, int *status){    ossp_uuid_t *uuid = NULL;    size_t len;    void *vp;    /* initialize status */    if (status != NULL)        *status = uuid_s_error;    /* sanity check argument(s) */    if (str == NULL || uuid_dce == NULL)        return;    /* import binary representation and export string representation */    if (uuid_create(&uuid) != UUID_RC_OK)        goto leave;    if (uuid_import(uuid, UUID_FMT_BIN, uuid_dce, UUID_LEN_BIN) != UUID_RC_OK)        goto leave;    vp  = str;    len = UUID_LEN_STR;    if (uuid_export(uuid, UUID_FMT_STR, &vp, &len) != UUID_RC_OK)        goto leave;    /* indicate successful operation */    if (status != NULL)        *status = uuid_s_ok;    /* cleanup and return */    leave:    if (uuid != NULL)        uuid_destroy(uuid);    return;}
开发者ID:SemanticGap,项目名称:mypasswordsafe,代码行数:35,


示例10: uuid_dce_create

/* create a UUID (v1 only) */void uuid_dce_create(uuid_dce_t *uuid_dce, int *status){    ossp_uuid_t *uuid;    size_t len;    void *vp;    /* initialize status */    if (status != NULL)        *status = uuid_s_error;    /* sanity check argument(s) */    if (uuid_dce == NULL)        return;    /* create UUID and export as binary representation */    if (uuid_create(&uuid) != UUID_RC_OK)        return;    if (uuid_make(uuid, UUID_MAKE_V1) != UUID_RC_OK) {        uuid_destroy(uuid);        return;    }    vp  = uuid_dce;    len = UUID_LEN_BIN;    if (uuid_export(uuid, UUID_FMT_BIN, &vp, &len) != UUID_RC_OK) {        uuid_destroy(uuid);        return;    }    uuid_destroy(uuid);    /* return successfully */    if (status != NULL)        *status = uuid_s_ok;    return;}
开发者ID:SemanticGap,项目名称:mypasswordsafe,代码行数:35,


示例11: gen_uuid

int gen_uuid(unsigned char *uuid_buf) {  uuid_rc_t result;  uuid_t *uuid;  unsigned char temp_buf[UUID_LEN_STR + 1];  unsigned char *temp_buf_ptr = &temp_buf[0]; /* odd API */  size_t uuid_buf_len = UUID_LEN_STR + 1;  assert(CMSG_UUID_BUF_SIZE == UUID_LEN_STR);  result = uuid_create(&uuid);  UUID_CHECK("uuid_create");  result = uuid_make(uuid, UUID_MAKE_V4);  UUID_CHECK("uuid_make");  result = uuid_export(uuid, UUID_FMT_STR, &temp_buf_ptr, &uuid_buf_len);  UUID_CHECK("uuid_export");  assert(uuid_buf_len == (UUID_LEN_STR + 1));  memcpy(uuid_buf, temp_buf, CMSG_UUID_BUF_SIZE);  result = uuid_destroy(uuid);  UUID_CHECK("uuid_destroy");  return UUID_RC_OK;}
开发者ID:tonyg,项目名称:hop,代码行数:26,


示例12: make_uuid

static String make_uuid( unsigned int mode ){    String result;    uuid_t * u = 0;    if ( UUID_RC_OK == uuid_create( & u ) )    {        if ( UUID_RC_OK == uuid_make( u , mode ) )        {            char buffer[ UUID_LEN_STR + 1 ];            size_t len = UUID_LEN_STR + 1;            void * up = & buffer[0];            if ( UUID_RC_OK == uuid_export( u , UUID_FMT_STR , & up , & len ) )            {                result = buffer;            }        }        uuid_destroy( u );    }    return result;}
开发者ID:cebu4u,项目名称:Trickplay,代码行数:27,


示例13: ngx_x_rid_header_get_variable

ngx_int_t ngx_x_rid_header_get_variable(ngx_http_request_t *r, ngx_http_variable_value_t *v, uintptr_t data) {  u_char            *p         = NULL;  ngx_table_elt_t   *header;  ngx_str_t          hv;  size_t             hlen      = 22;  header = search_headers_in(r, ngx_x_rid_header_name.data, ngx_x_rid_header_name.len);  if (header != NULL) {      hv = header->value;      if (hv.len >= 20 && hv.len <= 50) {          // Reuse existing header          hlen = hv.len;          p = hv.data;      }  }  if (p == NULL) {      // Prepare 22 bytes to store the base58 string      p = ngx_pnalloc(r->pool, 22);      if (p == NULL) {          return NGX_ERROR;      }#if (NGX_FREEBSD)#error FreeBSD is not supported yet, sorry.#elif (NGX_LINUX)      uuid_t* uuid;      // return of uuid_s_ok = 0      if ( uuid_create(&uuid) ) {        return -1;      }      if ( uuid_make(uuid, UUID_MAKE_V4) ) {        uuid_destroy(uuid);        return -1;      }      // at this point we have 16 bytes in "uuid", ready for conversion      uuid_fmt22(uuid, p);      uuid_destroy(uuid);#elif (NGX_SOLARIS)#error Solaris is not supported yet, sorry.#elif (NGX_DARWIN)      uuid_t uuid;      uuid_generate(uuid);      uuid_fmt22(uuid, p);#endif  }  v->len = hlen;  v->valid = 1;  v->no_cacheable = 0;  v->not_found = 0;  v->data = p;  return NGX_OK;}
开发者ID:ebp,项目名称:nginx-x-rid-header,代码行数:59,


示例14: libxl_uuid_generate

void libxl_uuid_generate(libxl_uuid *uuid){    uint32_t status;    BUILD_BUG_ON(sizeof(libxl_uuid) != sizeof(uuid_t));    uuid_create(&uuid->uuid, &status);    assert(status == uuid_s_ok);}
开发者ID:CPFL,项目名称:xen,代码行数:8,


示例15: uuid_create

zmq::uuid_t::uuid_t (){    uint32_t status;    uuid_create (&uuid, &status);    zmq_assert (status == uuid_s_ok);    uuid_to_string (&uuid, &uuid_str, &status);    zmq_assert (status == uuid_s_ok);}
开发者ID:thelonesquirrely,项目名称:zeromq2,代码行数:8,


示例16: main

int main(int argc, char *argv[]){    uuid_t u;    CWT_UNUSED2(argc, argv);    uuid_create(&u);    print_uuid(u);    return 0;}
开发者ID:semenovf,项目名称:cwt-core,代码行数:8,


示例17: pn_i_genuuid

char* pn_i_genuuid(void) {    char *generated;    uuid_t uuid;    uint32_t rc;    uuid_create(&uuid, &rc);    // Under FreeBSD the returned string is newly allocated from the heap    uuid_to_string(&uuid, &generated, &rc);    return generated;}
开发者ID:ModusCreateOrg,项目名称:deb-qpid-proton,代码行数:9,


示例18: dboidCreate

dboid_t dboidCreate( char *name ){	uuid_t 	*uuid;	uuid_t 	*uuid_ns;	char 	*str;		uuid_create( &uuid );	uuid_create( &uuid_ns );		uuid_load( uuid_ns, "ns:OID" );	uuid_make( uuid, UUID_MAKE_V3, uuid_ns, name );		str = NULL;		uuid_export( uuid, UUID_FMT_STR, &str, NULL );	uuid_destroy( uuid_ns );	uuid_destroy( uuid );		return str;	}
开发者ID:high,项目名称:PRiDe,代码行数:21,


示例19: guul_get_uuid

char *guul_get_uuid(){        uuid_t uuid;        uint32_t status;        char *result = NULL;        uuid_create (&uuid, &status);        uuid_to_string (&uuid, &result, &status);        return result;}
开发者ID:ovtn,项目名称:gupnp,代码行数:12,


示例20: ib_uuid_initialize

ib_status_t ib_uuid_initialize(void){    ib_status_t rc;    if (uuid_create(&g_ossp_uuid) != UUID_RC_OK) {        return IB_EOTHER;    }    rc = ib_lock_init(&g_uuid_lock);    return rc;}
开发者ID:aburan28,项目名称:ironbee,代码行数:12,


示例21: cmd_pfs_create

intcmd_pfs_create(const char *sel_path, const char *name,	       uint8_t pfs_type, const char *uuid_str){	hammer2_ioc_pfs_t pfs;	int ecode = 0;	int fd;	uint32_t status;	/*	 * Default to MASTER	 */	if (pfs_type == DMSG_PFSTYPE_NONE) {		pfs_type = HAMMER2_PFSTYPE_MASTER;	}	if ((fd = hammer2_ioctl_handle(sel_path)) < 0)		return(1);	bzero(&pfs, sizeof(pfs));	snprintf(pfs.name, sizeof(pfs.name), "%s", name);	pfs.pfs_type = pfs_type;	if (uuid_str) {		uuid_from_string(uuid_str, &pfs.pfs_clid, &status);	} else {		uuid_create(&pfs.pfs_clid, &status);	}	if (status == uuid_s_ok)		uuid_create(&pfs.pfs_fsid, &status);	if (status == uuid_s_ok) {		if (ioctl(fd, HAMMER2IOC_PFS_CREATE, &pfs) < 0) {			perror("ioctl");			ecode = 1;		}	} else {		fprintf(stderr, "hammer2: pfs_create: badly formed uuid/n");		ecode = 1;	}	close(fd);	return (ecode);}
开发者ID:victoredwardocallaghan,项目名称:DragonFlyBSD,代码行数:40,


示例22: main

/* Simple driver for UUID generator */void main(int argc, char **argv) {	uuid_t u;	int f;	char *page = "XU";	int i;	for(i = 0; i < 10; i ++) {		uuid_create(&u);		char *p = puid2(u); //pmasterkong_code(page, u);		printf("MasterKong: %7d -> %s/n", i, p);		free(p);	}}
开发者ID:tangramor,项目名称:security_code_generator,代码行数:14,


示例23: uuid

const std::string uuid (){  uuid_t id;  uint32_t status;  char *buffer (0);  uuid_create (&id, &status);  uuid_to_string (&id, &buffer, &status);  std::string res (buffer);  free (buffer);  return res;}
开发者ID:JensErat,项目名称:task,代码行数:13,


示例24: uuid_create

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);    //debug("uuid: %s", str);    return(str);}
开发者ID:mondia,项目名称:libvmod-uuid,代码行数:13,


示例25: att_read_group_req

static uint8_t att_read_group_req(struct bt_att *att, struct net_buf *buf){	struct bt_conn *conn = att->chan.conn;	struct bt_att_read_group_req *req;	uint16_t start_handle, end_handle, err_handle;	union {		struct bt_uuid uuid;		struct bt_uuid_16 u16;		struct bt_uuid_128 u128;	} u;	/* Type can only be UUID16 or UUID128 */	if (buf->len != sizeof(*req) + 2 && buf->len != sizeof(*req) + 16) {		return BT_ATT_ERR_INVALID_PDU;	}	req = (void *)buf->data;	start_handle = sys_le16_to_cpu(req->start_handle);	end_handle = sys_le16_to_cpu(req->end_handle);	net_buf_pull(buf, sizeof(*req));	if (!uuid_create(&u.uuid, buf)) {		return BT_ATT_ERR_UNLIKELY;	}	BT_DBG("start_handle 0x%04x end_handle 0x%04x type %s",	       start_handle, end_handle, bt_uuid_str(&u.uuid));	if (!range_is_valid(start_handle, end_handle, &err_handle)) {		send_err_rsp(conn, BT_ATT_OP_READ_GROUP_REQ, err_handle,			     BT_ATT_ERR_INVALID_HANDLE);		return 0;	}	/* Core v4.2, Vol 3, sec 2.5.3 Attribute Grouping:	 * Not all of the grouping attributes can be used in the ATT	 * Read By Group Type Request. The 
C++ uuid_generate函数代码示例
C++ uuid_copy函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。