这篇教程C++ DEL函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DEL函数的典型用法代码示例。如果您正苦于以下问题:C++ DEL函数的具体用法?C++ DEL怎么用?C++ DEL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DEL函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: loop_rewrite_match//091105 by HGstatic int loop_rewrite_match( const void* p, const void *q ){ connection* conn = (connection*)q; rewrite_rule* rule = (rewrite_rule*)p; const int nmatch = 9; //why is nine? enough? char* newname; int i; char* v; regmatch_t pm[nmatch]; if( conn->uri[0] != '/' ){ //bad luck!! NEW( newname, PATH_LEN+4 ); if( strcmp( conn->current_dir, "/") == 0 ) sprintf( newname, "/%s", conn->uri ); else sprintf( newname, "%s/%s", conn->current_dir, conn->uri ); strcpy( conn->uri, newname ); DEL( newname ); } if( strncmp( conn->uri, rule->base, rule->base_len ) ) return 0; //search next rule if( regexec( &rule->compiled_pattern, conn->uri, nmatch, pm, 0 ) ==REG_NOMATCH ) return 0; //search next rule NEW( newname, FILENAME_LEN+4 ); for( v=rule->result, i=0; *v; v++ ){ if( *v=='$' && *(v+1)>='0'&& *(v+1)<='9' ){ int k = *(++v)-'0', j; if( pm[k].rm_so == -1 ) continue; for( j=pm[k].rm_so; i<FILENAME_LEN && j<pm[k].rm_eo; j++ ) newname[i++]=conn->uri[j]; }else if( i<FILENAME_LEN ){ newname[i++]=*v; } } newname[i]='/0'; strcpy( conn->uri, newname ); DEL( newname );// DBG("new uri: %s", conn->uri ); return 1; //finished.}
开发者ID:xf22001,项目名称:homeserver,代码行数:41,
示例2: DELvoid CDlgMakeTChartImage::allocVariable(){ DEL(m_pdLH); DEL(m_pdRH); DEL(m_pdLV); DEL(m_pdRV); DEL(m_pdStiH); DEL(m_pdStiV); if(m_ulDataCount) { m_pdLH = new double[m_ulDataCount]; m_pdRH = new double[m_ulDataCount]; m_pdLV = new double[m_ulDataCount]; m_pdRV = new double[m_ulDataCount]; m_pdStiH = new double[m_ulDataCount]; m_pdStiV = new double[m_ulDataCount]; memset(m_pdLH, 0, sizeof(double)*m_ulDataCount); memset(m_pdRH, 0, sizeof(double)*m_ulDataCount); memset(m_pdLV, 0, sizeof(double)*m_ulDataCount); memset(m_pdRV, 0, sizeof(double)*m_ulDataCount); memset(m_pdStiH, 0, sizeof(double)*m_ulDataCount); memset(m_pdStiV, 0, sizeof(double)*m_ulDataCount); }}
开发者ID:dlsyaim,项目名称:sm-eye-app,代码行数:26,
示例3: webqq_create_userEXPORT user* webqq_create_user( void* session_ptr, uint number, uchar* md5pass ){ user* u; qqclient* qq; u = loop_search( &user_loop, session_ptr, get_user_searcher ); if( u ) return u; NEW( qqclient*, qq, sizeof(qqclient) ); NEW( user*, u, sizeof(user) ); if( !u || !qq ){ DEL( qq ); DEL( u ); return NULL; } u->session_ptr = session_ptr; u->create_time = u->update_time = time(NULL); u->qq = qq; u->reference = 1; qqclient_md5_create( qq, number, md5pass ); qq->auto_accept = 1; //temporarily do this loop_push_to_tail( &user_loop, u ); return u;}
开发者ID:PythonYXY,项目名称:myqq3,代码行数:22,
示例4: Py_DECREFstaticvoid__destroy (rbtree_t *T, rbtree_node_t *n){ if (n != T->nil) { Py_DECREF(n->key); Py_DECREF(n->value); __destroy(T, n->l); __destroy(T, n->r); DEL (n); }}
开发者ID:shenli-uiuc,项目名称:Centaur,代码行数:13,
示例5: api_init_licence_time_nowvoid api_init_licence_time_now(apiclient* apis){ char *server; NEW(server, 128); strcpy(server, LICENCE_SERVER); char *data; NEW(data, HTTP_POST_SIZE); apis->licence_time_now = time(NULL); sprintf( data, "process=api_init_server_time&" "local=%d" , apis->licence_time_now ); char *http = http_post(server, data); DEL(server); DEL(data); char *next; char *timer, *key; NEW(timer, 12); NEW(key, 33); next = mid_value(http, "<time>", "</time>", timer, 12); next = mid_value(next, "<key>", "</key>", key, 33); apis->licence_time_now = atoi(timer); apis->licence_seckey = LICENCE_SECKEY; char *local_key = api_create_transfer_hash(apis, "sck"); if (stricmp(key, local_key) != 0) { apis->licence_time_now = 0; } // 真JJ奇怪,这两个变量用DEL就会崩溃 //DEL(timer); //DEL(key); // 没办法,先用下面的代码释放内存了 free(*timer); free(*key); DEL(local_key); DEL(http);}
开发者ID:kissthink,项目名称:qq.robot.xiaoc,代码行数:38,
示例6: libqq_createEXPORT qqclient* libqq_create( uint number, char* pass ){ qqclient* qq; if( !if_init ) libqq_init(); NEW( qq, sizeof(qqclient) ); if( !qq ){ DEL( qq ); return NULL; } qqclient_create( qq, number, pass ); qq->auto_accept = 1; //temporarily do this return qq;}
开发者ID:564263820,项目名称:search4alibabainfor,代码行数:14,
示例7: ASSERTbool CBNFParser::Parse(CList<CToken *> &lstTokens, CNode *&pParsed){ ASSERT(m_pRootRule); pParsed = 0; CList<CToken *>::TNode *pFirst = lstTokens.m_pHead; pParsed = NEW(CNode, (pFirst ? pFirst->Data : 0, m_pRootRule->m_iID)); bool bMatch = m_pRootRule->Match(pFirst, *pParsed); if (!bMatch || pFirst) { DEL(pParsed); pParsed = 0; bMatch = false; } return bMatch;}
开发者ID:aaalexandrov,项目名称:Alex,代码行数:14,
示例8: pcibr_hints_subdevsvoidpcibr_hints_subdevs(devfs_handle_t xconn_vhdl, pciio_slot_t slot, uint64_t subdevs){ arbitrary_info_t ainfo = 0; char sdname[16]; devfs_handle_t pconn_vhdl = GRAPH_VERTEX_NONE; sprintf(sdname, "pci/%d", slot); (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl); if (pconn_vhdl == GRAPH_VERTEX_NONE) {#if DEBUG printk("pcibr_hints_subdevs: hwgraph_path_create failed at/n" "/t%p (seeking %s)/n", xconn_vhdl, sdname);#endif return; } hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); if (ainfo == 0) { uint64_t *subdevp; NEW(subdevp); if (!subdevp) {#if DEBUG printk("pcibr_hints_subdevs: subdev ptr alloc failed at/n" "/t%p/n", pconn_vhdl);#endif return; } *subdevp = subdevs; hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp); hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); if (ainfo == (arbitrary_info_t) subdevp) return; DEL(subdevp); if (ainfo == (arbitrary_info_t) NULL) {#if DEBUG printk("pcibr_hints_subdevs: null subdevs ptr at/n" "/t%p/n", pconn_vhdl);#endif return; }#if DEBUG printk("pcibr_subdevs_get: dup subdev add_LBL at/n" "/t%p/n", pconn_vhdl);#endif } *(uint64_t *) ainfo = subdevs;}
开发者ID:muromec,项目名称:linux-ezxdev,代码行数:50,
示例9: fft3_donevoid fft3_done(){ int i, j; if(d.init != 1) { fft3_fail("fft3: has not been initialized."); } for(i=0; i<d.nomp; i++) DEL(d.tomp[i]); free(d.tomp); for(j=0; j<3; j++) { for(i=0; i<d.nomp; i++) { if(d.work[j][i] != NULL) DEL(d.work[j][i]); } free(d.work[j]); } d.init = 0;}
开发者ID:sleitner,项目名称:cart,代码行数:23,
示例10: whilevoid CFMOD::DeleteAllSamples(void){ Log->AddEntry("Deleting All Samples"); CSample *delsample; CSample *nextsample; delsample=FirstSample; while(delsample) { nextsample=delsample->pNext; Log->AddEntry(va("sample: [%s] DEL!",delsample->name)); DEL(delsample); delsample=nextsample; }}
开发者ID:jbworley,项目名称:dlstorm,代码行数:14,
示例11: DELvoid enumdef.dcl(Pname, Ptable tbl){#define FIRST_ENUM 0 int nmem = mem->no_of_names(); Pname p; Pname ns = 0; Pname nl; int enum_old = enum_count; no_of_enumerators = nmem; enum_count = FIRST_ENUM; if (this == 0) error('i',"0->enumdef.dcl(%d)",tbl); for(p=mem, mem=0; p; p=p->n_list) { Pname nn; if (p->n_initializer) { Pexpr i = p->n_initializer->typ(tbl); Neval = 0; enum_count = i->eval(); if (Neval) error("%s",Neval); DEL(i); p->n_initializer = 0; } p->n_evaluated = 1; p->n_val = enum_count++; nn = tbl->insert(p,0); /* ??? */ if (Nold) { if (nn->n_stclass == ENUM) error( (p->n_val!=nn->n_val)?0:'w',"enumerator%n declared twice",nn); else error("incompatibleDs of%n",nn); } else { nn->n_stclass = ENUM; // no store will be allocated if (ns) nl->n_list = nn; else ns = nn; nl = nn; } delete p; } mem = ns; enum_count = enum_old; defined |= DEFINED;}
开发者ID:setekhid,项目名称:cfront1,代码行数:49,
示例12: client_endint client_end( client* c ){ //close all connections pthread_mutex_lock( &c->mutex_conn ); connection* conn; for( conn=c->first_conn; conn; ){ connection* next = conn->next; shutdown( conn->socket, SHUT_RDWR );#ifdef __WIN32__ closesocket( conn->socket );#else close( conn->socket );#endif conn->state = C_END; conn = next; } //close all sessions pthread_mutex_lock( &c->mutex_session ); session* s; for( s=c->first_session; s; ){ session* next = s->next; if( s->reference > 0 ){ DBG("##Fatal Error: session->reference = %d", s->reference ); } LINK_DELETE( s, c->first_session ); DEL( s ); s = next; } pthread_mutex_unlock( &c->mutex_session ); pthread_mutex_unlock( &c->mutex_conn ); //is it safe to do things below? 091205 by HG pthread_mutex_destroy( &c->mutex_session ); pthread_mutex_destroy( &c->mutex_conn ); DEL( c ); return 0;}
开发者ID:xf22001,项目名称:homeserver,代码行数:36,
示例13: DEL//-------------------------------------////-------------------------------------void BaseScene::End(){ for( int i = m_entities.Size() -1; i >= 0; i-- ) { IEntity* entityToDelete = m_entities[i]; entityToDelete->End(); m_entities.Remove( m_entities[i] ); IEntityFactory::Instance().RemoveEntity( entityToDelete ); } m_labels.Clear(); m_labelsToDelete.Clear(); DEL( m_scene );}
开发者ID:CarlosCasVen,项目名称:UTad,代码行数:18,
示例14: __rb_del_nodestaticrbtree_node_t *__rb_del_node(rbtree_t *T, rbtree_node_t *z){ // Delete a node and return successor rbtree_node_t *y; rbtree_node_t *x; rbtree_node_t *remainder = NULL; if (z == NULL) return NULL; remainder = __tree_successor(T, z); if ((z->l == T->nil) || (z->r == T->nil)) y = z; else y = remainder; if (y->l != T->nil) x = y->l; else x = y->r; x->p = y->p; if (y->p == T->nil) T->root = x; else { // Disconnect y from tree if (y == y->p->l) y->p->l = x; else y->p->r = x; } if (y != z) { // copy y to z replace z, the delete target with y's data, then // remove the old shell. saves a rotate. Py_DECREF(z->key); Py_DECREF(z->value); z->key = y->key; z->value = y->value; remainder = z; } if (COLOR(y) == BLACK) { __rb_del_fix(T, x); } DEL(y); T->ct--; if (remainder == T->nil) return NULL; return remainder;}
开发者ID:shenli-uiuc,项目名称:Centaur,代码行数:48,
示例15: RELcDxSound::~cDxSound(void){ REL(_pSegment); REL(_pPerformance); REL(_pLoader); POSITION pos = _sounds.GetStartPosition(); long key; CSound* value; while(pos) { _sounds.GetNextAssoc(pos, key, value); delete value; } _sounds.RemoveAll(); DEL(_pSoundManager);}
开发者ID:jstty,项目名称:OlderProjects,代码行数:16,
示例16: libqq_sendmessageEXPORT int libqq_sendmessage( qqclient* qq, uint to, char* buf, char qun_msg ){ char* tmp; int len = strlen(buf); if( len<1 ) return -2; NEW( tmp, len*2 ); gb_to_utf8( buf, tmp, len*2-1 ); if( qun_msg ){ qqqun* q = qun_get_by_ext( qq, to ); if( q ) qun_send_message( qq, q->number, tmp ); }else{ buddy_send_message( qq, to, tmp ); } DEL( tmp ); return 0;}
开发者ID:564263820,项目名称:search4alibabainfor,代码行数:17,
示例17: api_update_licencevoid api_update_licence(apiclient* apis){ // update licence char *licence = api_check_licence(apis); if ( apis->Licenced ) { } else { printf("Licence status changed./n"); printf("/n!!! @ Not Allowed Client @ !!!/n/n"); printf("Please goto %s//n/n", LICENCE_CONSOLE_OL); printf("Exited."); } DEL(licence);}
开发者ID:kissthink,项目名称:qq.robot.xiaoc,代码行数:17,
示例18: gen_secs_hot_subjects_xmlvoid gen_secs_hot_subjects_xml(int mytype){ int i; for (i=0; i<SECNUM; i++) { gen_sec_hot_subjects_xml(mytype, i); }#ifdef REDIS redisContext *redis = redisConnect("127.0.0.1", 6379); const char *pattern = "stat:%s_sec%d:%s"; char key[128]; char value[512]; const char *argv[3] = { "RPUSH", key, value };#define RPUSH(ikey,itype,ivalue) {/ snprintf(key, 128, pattern, myfile[mytype], secid, ikey);/ snprintf(value, 512, itype, ivalue);/ redisAppendCommandArgv(redis, 3, argv, NULL);/}#define DEL(ikey) {/ snprintf(key, 128, pattern, myfile[mytype], secid, ikey);/ snprintf(value, 512, "DEL %s", key);/ redisAppendCommand(redis, value);/} int secid; for (secid = 0; secid < SECNUM; ++secid) { DEL("title"); DEL("author"); DEL("board"); DEL("replies"); DEL("time"); DEL("id"); for (i = 0; i < sectopnum[secid]; i++) { RPUSH("title" , "%s" , sectop[secid][i].title); RPUSH("author" , "%s" , sectop[secid][i].userid); RPUSH("board" , "%s" , sectop[secid][i].board); RPUSH("replies" , "%lu" , (unsigned long)sectop[secid][i].number); RPUSH("time" , "%lu" , (unsigned long)sectop[secid][i].date); RPUSH("id" , "%lu" , (unsigned long)sectop[secid][i].groupid); } } redisReply *reply; redisGetReply(redis, (void*)&reply); freeReplyObject(reply); redisFree(redis);#undef RPUSH#undef DEL#endif}
开发者ID:loverabbit,项目名称:kbs-redis,代码行数:53,
示例19: pic_bus1_widget_info_dup/* * copy xwidget_info_t from conn_v to peer_conn_v */intpic_bus1_widget_info_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v, cnodeid_t xbow_peer){ xwidget_info_t widget_info, peer_widget_info; char peer_path[256]; vertex_hdl_t peer_hubv; hubinfo_t peer_hub_info; /* get the peer hub's widgetid */ peer_hubv = NODEPDA(xbow_peer)->node_vertex; peer_hub_info = NULL; hubinfo_get(peer_hubv, &peer_hub_info); if (peer_hub_info == NULL) return 0; if (hwgraph_info_get_LBL(conn_v, INFO_LBL_XWIDGET, (arbitrary_info_t *)&widget_info) == GRAPH_SUCCESS) { NEW(peer_widget_info); peer_widget_info->w_vertex = peer_conn_v; peer_widget_info->w_id = widget_info->w_id; peer_widget_info->w_master = peer_hubv; peer_widget_info->w_masterid = peer_hub_info->h_widgetid; /* structure copy */ peer_widget_info->w_hwid = widget_info->w_hwid; peer_widget_info->w_efunc = 0; peer_widget_info->w_einfo = 0; peer_widget_info->w_name = kmalloc(strlen(peer_path) + 1, GFP_KERNEL); strcpy(peer_widget_info->w_name, peer_path); if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_XWIDGET, (arbitrary_info_t)peer_widget_info) != GRAPH_SUCCESS) { DEL(peer_widget_info); return 0; } xwidget_info_set(peer_conn_v, peer_widget_info); return 1; } printk("pic_bus1_widget_info_dup: " "cannot get INFO_LBL_XWIDGET from 0x%lx/n", (uint64_t)conn_v); return 0;}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:48,
示例20: newexceptionobjectEmObject *newexceptionobject(char *errtype, char *message) { EmExceptionObject *ob; if ((ob = NEWOBJ(EmExceptionObject, &Exceptiontype)) == NULL) return NULL; ob->errtype = newstringobject(errtype); ob->message = newstringobject(message); if (ob->errtype == NULL || ob->message == NULL) { if (ob->errtype) DECREF(ob->errtype); if (ob->message) DECREF(ob->message); DEL(ob); return NULL; } ob->value = NULL; return (EmObject *) ob;}
开发者ID:svn2github,项目名称:coderplay,代码行数:18,
示例21: prot_qun_send_msgvoid prot_qun_send_msg( struct qqclient* qq, uint number, char* msg_content ){ qqpacket* p = packetmgr_new_send( qq, QQ_CMD_QUN_CMD ); if( !p ) return; ushort len = strlen( msg_content ); bytebuffer *buf = p->buf; put_byte( buf, 0x2A ); put_int( buf, number ); bytebuffer* content_buf; NEW( content_buf, sizeof(bytebuffer) ,bytebuffer); if( !content_buf ) { packetmgr_del_packet( &qq->packetmgr, p ); return; } content_buf->size = PACKET_SIZE; put_word( content_buf, 0x0001 ); //text type put_byte( content_buf, 0x01 ); //slice_count put_byte( content_buf, 0x00 ); //slice_no put_word( content_buf, 0 ); //id?? put_int( content_buf, 0 ); //zeros put_int( content_buf, 0x4D534700 ); //"MSG" put_int( content_buf, 0x00000000 ); put_int( content_buf, p->time_create ); put_int( content_buf, rand() ); put_int( content_buf, 0x00000000 ); put_int( content_buf, 0x09008600 ); char font_name[] = "宋体"; //must be in UTF8 put_word( content_buf, strlen(font_name) ); put_data( content_buf, (uchar*)font_name, strlen( font_name) ); put_word( content_buf, 0x0000 ); put_byte( content_buf, 0x01 ); put_word( content_buf, len+3 ); put_byte( content_buf, 1 ); //unknown, keep 1 put_word( content_buf, len ); put_data( content_buf, (uchar*)msg_content, len ); put_word( buf, content_buf->pos ); put_data( buf, content_buf->data, content_buf->pos ); DEL( content_buf ); post_packet( qq, p, SESSION_KEY );}
开发者ID:EnoroF,项目名称:gmyqq,代码行数:43,
示例22: pcibr_hints_subdevsvoidpcibr_hints_subdevs(devfs_handle_t xconn_vhdl, pciio_slot_t slot, uint64_t subdevs){ arbitrary_info_t ainfo = 0; char sdname[16]; devfs_handle_t pconn_vhdl = GRAPH_VERTEX_NONE; sprintf(sdname, "%s/%d", EDGE_LBL_PCI, slot); (void) hwgraph_path_add(xconn_vhdl, sdname, &pconn_vhdl); if (pconn_vhdl == GRAPH_VERTEX_NONE) { PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl, "pcibr_hints_subdevs: hwgraph_path_create failed/n")); return; } hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); if (ainfo == 0) { uint64_t *subdevp; NEW(subdevp); if (!subdevp) { PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl, "pcibr_hints_subdevs: subdev ptr alloc failed/n")); return; } *subdevp = subdevs; hwgraph_info_add_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, (arbitrary_info_t) subdevp); hwgraph_info_get_LBL(pconn_vhdl, INFO_LBL_SUBDEVS, &ainfo); if (ainfo == (arbitrary_info_t) subdevp) return; DEL(subdevp); if (ainfo == (arbitrary_info_t) NULL) { PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl, "pcibr_hints_subdevs: null subdevs ptr/n")); return; } PCIBR_DEBUG_ALWAYS((PCIBR_DEBUG_HINTS, xconn_vhdl, "pcibr_subdevs_get: dup subdev add_LBL/n")); } *(uint64_t *) ainfo = subdevs;}
开发者ID:dduval,项目名称:kernel-rhel3,代码行数:42,
示例23: http_sendvoid http_send(int sock, char *message){ OPS("### @ HTTP : Send Message: %s", message); // build char *http; NEW(http, 1024); //memset(http, 0, 1024); strcat(http, "HTTP/1.1 200 OK/r/n"); strcat(http, "Content-Type: text/html/r/n"); strcat(http, "/r/n"); strcat(http, message); // Send send(sock, http, strlen(http), 0); // Close shutdown(sock, SD_BOTH); closesocket(sock); // Clear DEL(http); //DEL(sock);}
开发者ID:kissthink,项目名称:qq.robot.xiaoc,代码行数:20,
示例24: api_create_keyschar* api_create_keys(apiclient* apis, char* type){ char *keys, *flag; NEW(keys, 512); NEW(flag, 384); if (stricmp(type, "uri") == 0) { sprintf(flag, "@URI~%s", apis->APICallback); } else if (stricmp(type, "sts") == 0) { sprintf(flag, "@STS~%s", apis->licence_status); } else if (stricmp(type, "sck") == 0) { sprintf(flag, "@SCK~%s", apis->licence_seckey); } sprintf(keys, LICENCE_HASHED, apis->licence_time_now, flag); DEL(flag); return keys;}
开发者ID:kissthink,项目名称:qq.robot.xiaoc,代码行数:21,
示例25: DELBOOL ZBspTree::Build( LPSTR szFileName ){ BSPMAPDATA data; ZSimpleParser* parser; parser = new ZSimpleParser; if( !parser->Parse( szFileName, &data ) ) return FALSE; DEL( parser ); m_nFaceCount = data.nFaceCount; m_nVertCount = data.nVertCount; m_pVerts = data.pVerts; m_pIndices = data.pIndices; _CreateFaceList(); m_pRootNode = new ZBspNode(); m_pRootNode->SetFaces( m_pRootFace ); _SubDivide( m_pRootNode ); return TRUE;}
开发者ID:blastingzone,项目名称:ComputerGraphicsAdvenced,代码行数:21,
示例26: pic_bus1_inventory_dup/* * copy inventory_t from conn_v to peer_conn_v */intpic_bus1_inventory_dup(vertex_hdl_t conn_v, vertex_hdl_t peer_conn_v){ inventory_t *pinv, *peer_pinv; if (hwgraph_info_get_LBL(conn_v, INFO_LBL_INVENT, (arbitrary_info_t *)&pinv) == GRAPH_SUCCESS) { NEW(peer_pinv); bcopy((const char *)pinv, (char *)peer_pinv, sizeof(inventory_t)); if (hwgraph_info_add_LBL(peer_conn_v, INFO_LBL_INVENT, (arbitrary_info_t)peer_pinv) != GRAPH_SUCCESS) { DEL(peer_pinv); return 0; } return 1; } printk("pic_bus1_inventory_dup: cannot get INFO_LBL_INVENT from 0x%lx/n ", (uint64_t)conn_v); return 0;}
开发者ID:BackupTheBerlios,项目名称:wl530g-svn,代码行数:24,
示例27: http_postchar* http_post(char *server, char *data){ // apply memory char *url, *host_name, *uri, *header, *next; NEW(url, 256); NEW(host_name, 64); NEW(uri, 128); //get host name strcpy(url, server); next = mid_value( url, "//", "/", host_name, 64 ); next = mid_value( next, "/", NULL, uri, 128 ); DEL(url); //DEL(next); //connect int http_sock = qqsocket_create( TCP, NULL, 0 ); //printf(http_sock); if( http_sock <= 0 ) { DEL(host_name); DEL(uri); return ""; } NEW( header, HTTP_POST_SIZE ); qqsocket_connect( http_sock, host_name, 80 ); sprintf( header, "POST /%s HTTP/1.1/r/n" "HOST: %s/r/n" "User-Agent: QQRobot.APIServer.Agent/r/n" "X-Powered-By: %s/r/n" "Content-Type: application/x-www-form-urlencoded/r/n" "Content-Length: %d/r/n/r/n" "%s" , uri, host_name, "[email C++ DELAY函数代码示例 C++ DEG_TO_RAD函数代码示例
|