当前位置: 首页>>代码示例>>C++>>正文


C++ dict_destroy函数代码示例

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


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

示例1: radius_acct_shutdown

void radius_acct_shutdown(void)
{
    if (radius_mutex == NULL) /* haven't init'ed at all */
        return ;

    mutex_lock(radius_mutex);
    run_thread = 0;
    mutex_unlock(radius_mutex);

    gwthread_join_every(proxy_thread);

    dict_destroy(radius_table);
    dict_destroy(session_table);
    dict_destroy(client_table);

    mutex_destroy(radius_mutex);

    octstr_destroy(our_host);
    octstr_destroy(remote_host);
    octstr_destroy(secret_nas);
    octstr_destroy(secret_radius);
    octstr_destroy(unified_prefix);

    info(0, "RADIUS: accounting proxy stopped.");
}
开发者ID:Phonebooth,项目名称:kannel,代码行数:25,代码来源:radius_acct.c

示例2: urltrans_destroy

void urltrans_destroy(URLTranslationList *trans) 
{
    list_destroy(trans->list, destroy_onetrans);
    dict_destroy(trans->names);
    dict_destroy(trans->dict);
    gw_free(trans);
}
开发者ID:armic,项目名称:erpts,代码行数:7,代码来源:urltrans.c

示例3: smsboxc_run

static void smsboxc_run(void *arg)
{
    int fd;
    int port;

    gwlist_add_producer(flow_threads);
    gwthread_wakeup(MAIN_THREAD_ID);
    port = (int) *((long *)arg);
    
    fd = make_server_socket(port, NULL); 
    /* XXX add interface_name if required */

    if (fd < 0) {
        panic(0, "Could not open smsbox port %d", port);
    }

    /*
     * infinitely wait for new connections;
     * to shut down the system, SIGTERM is send and then
     * select drops with error, so we can check the status
     */
    wait_for_connections(fd, run_smsbox, incoming_sms, smsbox_port_ssl);

    gwlist_remove_producer(smsbox_list);

    /* continue avalanche */
    gwlist_remove_producer(outgoing_sms);

    /* all connections do the same, so that all must remove() before it
     * is completely over
     */
    while(gwlist_wait_until_nonempty(smsbox_list) == 1)
        gwthread_sleep(1.0);

    /* close listen socket */
    close(fd);

    gwthread_wakeup(sms_dequeue_thread);
    gwthread_join(sms_dequeue_thread);

    gwlist_destroy(smsbox_list, NULL);
    smsbox_list = NULL;
    gw_rwlock_destroy(smsbox_list_rwlock);
    smsbox_list_rwlock = NULL;

    /* destroy things related to smsbox routing */
    dict_destroy(smsbox_by_id);
    smsbox_by_id = NULL;
    dict_destroy(smsbox_by_smsc);
    smsbox_by_smsc = NULL;
    dict_destroy(smsbox_by_receiver);
    smsbox_by_receiver = NULL;
    dict_destroy(smsbox_by_smsc_receiver);
    smsbox_by_smsc_receiver = NULL;
    
    gwlist_remove_producer(flow_threads);
}
开发者ID:Phonebooth,项目名称:kannel,代码行数:57,代码来源:bb_boxc.c

示例4: cfg_destroy

void cfg_destroy(Cfg *cfg)
{
    if (cfg != NULL) {
        octstr_destroy(cfg->filename);
        dict_destroy(cfg->single_groups);
        dict_destroy(cfg->multi_groups);
        gw_free(cfg);
    }
}
开发者ID:LeeVidor,项目名称:kannel-mongodb,代码行数:9,代码来源:cfg.c

示例5: cxml_node_free

/*
void cxml_node_free(CLOG_INFO* info, void * data) {
  CXMLNODE *node = (CXMLNODE*) data;
*/
void cxml_node_free(CLOG_INFO* info, CXMLNODE **node) {
  dnode_t *dn = NULL;

  if(NULL==node || NULL==*node) {
    return;
  }

  clog( info, CTRACE, "XML: xml_node_free(), free the attributes");
  // free the attributes
  if(NULL!=(*node)->att) {
    if(!dict_isempty((*node)->att)) {
      for (dn = dict_first((*node)->att); dn; dn = dict_next((*node)->att, dn)) {
        char *key=(char*)dnode_getkey(dn);
        char *data=(char*)dnode_get(dn);
        if(NULL!=key) free(key); key=NULL;
        if(NULL!=data) free(data); data=NULL;
      }
    }
    dict_free_nodes((*node)->att);
    dict_destroy((*node)->att);
    (*node)->att=NULL;
  }

  clog( info, CTRACE, "XML: xml_node_free(), free the name");
  // free the name
  if(NULL!=(*node)->name) cstring_free(&((*node)->name));

  clog( info, CTRACE, "XML: xml_node_free(), free the data");
  // free the data
  if(NULL!=(*node)->data) cstring_free(&((*node)->data));

  clog( info, CTRACE, "XML: xml_node_free(), free the subs");
  // free the children
  if(NULL!=(*node)->sub) {
    if(!dict_isempty((*node)->sub)) {
      for (dn = dict_first((*node)->sub); dn; dn = dict_next((*node)->sub, dn)) {
        char *key=(char*)dnode_getkey(dn);
        CXMLNODE *data=(CXMLNODE*)dnode_get(dn);
        if(NULL!=key) free(key); key=NULL;
        cxml_node_free(info, &data);
      }
    }
    dict_free_nodes((*node)->sub);
    dict_destroy((*node)->sub);
    (*node)->sub=NULL;
  }

  free((*node));
  (*node)=NULL;
  node=NULL;
}
开发者ID:wgm,项目名称:cerb2-cparser,代码行数:55,代码来源:cxml_node_free.c

示例6: smpp_pdu_shutdown

int smpp_pdu_shutdown(void)
{
    if (initialized == 0)
        return 0;

    initialized = 0;
    gwlist_destroy(tlvs, (void(*)(void*))smpp_tlv_destroy);
    tlvs = NULL;
    dict_destroy(tlvs_by_tag);
    dict_destroy(tlvs_by_name);
    tlvs_by_tag = tlvs_by_name = NULL;

    return 0;
}
开发者ID:pwhelan,项目名称:kannel,代码行数:14,代码来源:smpp_pdu.c

示例7: brunet_parse_reply

static void brunet_parse_reply(SMSCConn *conn, Msg *msg, int status,
                               List *headers, Octstr *body)
{
    if (status == HTTP_OK || status == HTTP_ACCEPTED) {
        Dict *param;
        Octstr *status;

        if ((param = brunet_parse_body(body)) != NULL &&
            (status = dict_get(param, octstr_imm("Status"))) != NULL &&
            octstr_case_compare(status, octstr_imm("0")) == 0) {
            Octstr *msg_id;

            /* pass the MessageId for this MT to the logging facility */
            if ((msg_id = dict_get(param, octstr_imm("MessageId"))) != NULL)
                msg->sms.binfo = octstr_duplicate(msg_id);

            bb_smscconn_sent(conn, msg, NULL);

        } else {
            error(0, "HTTP[%s]: Message was malformed. SMSC response `%s'.",
                  octstr_get_cstr(conn->id), octstr_get_cstr(body));
            bb_smscconn_send_failed(conn, msg,
                    SMSCCONN_FAILED_MALFORMED, octstr_duplicate(body));
        }
        dict_destroy(param);

    } else {
        error(0, "HTTP[%s]: Message was rejected. SMSC reponse `%s'.",
              octstr_get_cstr(conn->id), octstr_get_cstr(body));
        bb_smscconn_send_failed(conn, msg,
                SMSCCONN_FAILED_REJECTED, octstr_duplicate(body));
    }
}
开发者ID:tphipps,项目名称:kannel,代码行数:33,代码来源:brunet.c

示例8: make_seq_dict

static dict_t *
make_seq_dict (int argc, char **argv)
{
        char index[] = "4294967296"; // 1<<32
        int i        = 0;
        int ret      = 0;
        dict_t *dict = dict_new ();

        if (!dict)
                return NULL;

        for (i = 0; i < argc; i++) {
                snprintf(index, sizeof(index), "%d", i);
                ret = dict_set_str (dict, index, argv[i]);
                if (ret == -1)
                        break;
        }

        if (ret) {
                dict_destroy (dict);
                dict = NULL;
        }

        return dict;
}
开发者ID:ArikaChen,项目名称:glusterfs,代码行数:25,代码来源:cli-cmd-system.c

示例9: ui_destroy

void			ui_destroy(t_dict *dict_key)
{
  extern t_command_line	g_cmdl;
  free(g_cmdl.hostname);
  if (dict_key != NULL)
    dict_destroy(dict_key);
}
开发者ID:brendan-rius,项目名称:12sh,代码行数:7,代码来源:ui_main_init.c

示例10: ca_destroy

/// Finalizer - releases all allocated memory for object.
/// If object is a null pointer, no action occurs.
/// @param[in] ca       the object pointer
void
ca_destroy(ca_o ca)
{
    hash_t *hash;

    if (!ca) {
        return;
    }

    if ((hash = ca->ca_group_hash)) {
        if (hash_count(hash)) {
            putil_warn("group destroyed with %d audits left",
                       (int)hash_count(hash));
        }
        hash_destroy(ca->ca_group_hash);
        ca->ca_group_hash = NULL;
    }

    ca_clear_pa(ca);

    dict_destroy(ca->ca_raw_pa_dict);

    putil_free(ca->ca_prog);
    putil_free(ca->ca_host);
    putil_free(ca->ca_recycled);
    putil_free(ca->ca_rwd);
    putil_free(ca->ca_pccode);
    putil_free(ca->ca_ccode);
    putil_free(ca->ca_pathcode);
    putil_free(ca->ca_subs);
    putil_free(ca->ca_freetext);
    putil_free(ca->ca_line);
    memset(ca, 0, sizeof(*ca));
    putil_free(ca);
}
开发者ID:gisco,项目名称:audited-objects,代码行数:38,代码来源:ca.c

示例11: ca_clear_pa

/// Clear out the raw set and cooked sets. Destroy the entire
/// cooked data structure but leave the raw one present though
/// empty. This is the same as the initial (post-creation) state.
/// @param[in] ca       the object pointer
void
ca_clear_pa(ca_o ca)
{
    dict_t *dict;
    dnode_t *dnp, *next;
    pa_o pa;

    if ((dict = ca->ca_raw_pa_dict)) {
        for (dnp = dict_first(dict); dnp;) {
            next = dict_next(dict, dnp);

            pa = (pa_o)dnode_getkey(dnp);
            dict_delete(dict, dnp);
            dnode_destroy(dnp);
            pa_destroy(pa);
            dnp = next;
        }
    }

    if ((dict = ca->ca_cooked_pa_dict)) {
        for (dnp = dict_first(dict); dnp;) {
            next = dict_next(dict, dnp);

            pa = (pa_o)dnode_getkey(dnp);
            dict_delete(dict, dnp);
            dnode_destroy(dnp);
            pa_destroy(pa);
            dnp = next;
        }
        dict_destroy(ca->ca_cooked_pa_dict);
        ca->ca_cooked_pa_dict = NULL;
    }
}
开发者ID:gisco,项目名称:audited-objects,代码行数:37,代码来源:ca.c

示例12: main

int		main(int ac, char **av, char **env)
{
	t_cmd	cmd;
	t_dict	*envc;

	(void)ac;
	(void)av;
	signal(SIGINT, sig_handler);
	envc = envcpy(env);
	init_tokens();
	interpret_command(envc, &cmd);
	dict_destroy(g_tokens);
	dict_destroy(envc);
	cmd_free(&cmd);
	return (0);
}
开发者ID:cham-s,项目名称:minishell,代码行数:16,代码来源:main.c

示例13: agr_destroy

/* Destroys AGR. */
static void
agr_destroy (struct agr_proc *agr)
{
  struct agr_var *iter, *next;

  subcase_destroy (&agr->sort);
  free (agr->break_vars);
  for (iter = agr->agr_vars; iter; iter = next)
    {
      next = iter->next;

      if (iter->function & FSTRING)
	{
	  size_t n_args;
	  size_t i;

	  n_args = agr_func_tab[iter->function & FUNC].n_args;
	  for (i = 0; i < n_args; i++)
	    free (iter->arg[i].c);
	  free (iter->string);
	}
      else if (iter->function == SD)
        moments1_destroy (iter->moments);

      dict_destroy_internal_var (iter->subject);
      dict_destroy_internal_var (iter->weight);

      free (iter);
    }
  if (agr->dict != NULL)
    dict_destroy (agr->dict);
}
开发者ID:student-t,项目名称:PSPP,代码行数:33,代码来源:aggregate.c

示例14: history_free

void history_free(history_t* past)
{
    state_free(dict_lookup(past->states, "x"));
    state_free(dict_lookup(past->states, "y"));
    state_free(dict_lookup(past->states, "scalex"));
    state_free(dict_lookup(past->states, "scaley"));
    state_free(dict_lookup(past->states, "cxform.r0"));
    state_free(dict_lookup(past->states, "cxform.g0"));
    state_free(dict_lookup(past->states, "cxform.b0"));
    state_free(dict_lookup(past->states, "cxform.a0"));
    state_free(dict_lookup(past->states, "cxform.r1"));
    state_free(dict_lookup(past->states, "cxform.g1"));
    state_free(dict_lookup(past->states, "cxform.b1"));
    state_free(dict_lookup(past->states, "cxform.a1"));
    state_free(dict_lookup(past->states, "rotate"));
    state_free(dict_lookup(past->states, "shear"));
    state_free(dict_lookup(past->states, "pivot.x"));
    state_free(dict_lookup(past->states, "pivot.y"));
    state_free(dict_lookup(past->states, "pin.x"));
    state_free(dict_lookup(past->states, "pin.y"));
    state_free(dict_lookup(past->states, "blendmode"));
    state_free(dict_lookup(past->states, "flags"));
    filterState_free(dict_lookup(past->states, "filter"));
    dict_destroy(past->states);
    free(past);
}
开发者ID:SenecaCDOT-BigBlueButton,项目名称:swftools,代码行数:26,代码来源:swfc-history.c

示例15: gfxpoly_check

char gfxpoly_check(gfxpoly_t*poly)
{
    dict_t*d = dict_new2(&point_type);
    int s,t;
    gfxpolystroke_t*stroke = poly->strokes;
    for(;stroke;stroke=stroke->next) {
	for(s=0;s<stroke->num_points;s++) {
	    point_t p = stroke->points[s];
	    int num = (s>=1 && s<stroke->num_points-1)?2:1; // mid points are two points (start+end)
	    if(!dict_contains(d, &p)) {
		dict_put(d, &p, (void*)(ptroff_t)num);
	    } else {
		int count = (ptroff_t)dict_lookup(d, &p);
		dict_del(d, &p);
		count+=num;
		dict_put(d, &p, (void*)(ptroff_t)count);
	    }
	}
    }
    DICT_ITERATE_ITEMS(d, point_t*, p, void*, c) {
        int count = (ptroff_t)c;
        if(count&1) {
            fprintf(stderr, "Point (%f,%f) occurs %d times\n", p->x*poly->gridsize, p->y*poly->gridsize, count);
            dict_destroy(d);
            return 0;
        }
    }
开发者ID:ggjjlldd,项目名称:swftools,代码行数:27,代码来源:poly.c


注:本文中的dict_destroy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。