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


C++ entry_free函数代码示例

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


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

示例1: symbol_exit

void symbol_exit(void)
{
   Symbol* q;
   Symbol* p;
   int     i;
   
   for(p = anchor; p != NULL; p = q)
   {
      assert(symbol_is_valid(p));

      SID_del(p);

      q = p->next;
      
      for(i = 0; i < p->used; i++)
         entry_free(p->entry[i]);

      free(p->entry);
      set_free(p->set);
      hash_free(p->hash);

      if (p->deflt != NULL)
         entry_free(p->deflt);

      free(p);
   }
   anchor = NULL;
}
开发者ID:bubuker,项目名称:keggle_santa,代码行数:28,代码来源:symbol.c

示例2: entry_free

static void entry_free(GoomHashEntry *entry) {
	if (entry!=NULL) {
		entry_free(entry->lower);
		entry_free(entry->upper);
		free(entry->key);
		free(entry);
	}
}
开发者ID:Chelovecheggg,项目名称:libvisual,代码行数:8,代码来源:goomsl_hash.c

示例3: table_add_new_entry

static ret_t
table_add_new_entry (cherokee_resolv_cache_t        *resolv,
		     cherokee_buffer_t              *domain,
		     cherokee_resolv_cache_entry_t **entry)
{
	ret_t                          ret;
	cherokee_resolv_cache_entry_t *n    = NULL;

	/* Instance the entry
	 */
	ret = entry_new (&n);
	if (unlikely (ret != ret_ok)) {
		return ret;
	}

	/* Fill it up
	 */
	ret = entry_fill_up (n, domain);
	if (unlikely (ret != ret_ok)) {
		entry_free (n);
		return ret;
	}

	/* Add it to the table
	 */
	CHEROKEE_RWLOCK_WRITER (&resolv->lock);
	ret = cherokee_avl_add (&resolv->table, domain, (void **)n);
	CHEROKEE_RWLOCK_UNLOCK (&resolv->lock);

	*entry = n;
	return ret_ok;
}
开发者ID:BeQ,项目名称:webserver,代码行数:32,代码来源:resolv_cache.c

示例4: run_delete_event

int
run_delete_event (const char *cmd, size_t argc, char *argv[])
{
  if (argc != 1) {
    fprintf (stderr,
             _("use 'delete-event <name>' to delete an event handler\n"));
    return -1;
  }

  const struct entry key = { .name = argv[0] };
  struct entry *entry, *p;

  entry = hash_delete (event_handlers, &key);
  if (!entry) {
    fprintf (stderr, _("delete-event: %s: no such event handler\n"), argv[0]);
    return -1;
  }

  /* Delete them from the handle. */
  p = entry;
  while (p) {
    guestfs_delete_event_callback (g, p->eh);
    p = p->next;
  }

  /* Free the structures. */
  entry_free (entry);

  return 0;
}
开发者ID:DanLipsitt,项目名称:libguestfs,代码行数:30,代码来源:events.c

示例5: wt_entry_return

int wt_entry_return(
	Entry *e
	)
{
	if ( !e ) {
		return 0;
	}

    /* Our entries are allocated in two blocks; the data comes from
	 * the db itself and the Entry structure and associated pointers
	 * are allocated in entry_decode. The db data pointer is saved
	 * in e_bv.
	 */
	if ( e->e_bv.bv_val ) {
#if 0
		/* See if the DNs were changed by modrdn */
		if( e->e_nname.bv_val < e->e_bv.bv_val || e->e_nname.bv_val >
			e->e_bv.bv_val + e->e_bv.bv_len ) {
			ch_free(e->e_name.bv_val);
			ch_free(e->e_nname.bv_val);
		}
#endif
		e->e_name.bv_val = NULL;
		e->e_nname.bv_val = NULL;
		/* In tool mode the e_bv buffer is realloc'd, leave it alone */
		if( !(slapMode & SLAP_TOOL_MODE) ) {
			free( e->e_bv.bv_val );
		}
		BER_BVZERO( &e->e_bv );
	}

	entry_free( e );
}
开发者ID:Distrotech,项目名称:openldap,代码行数:33,代码来源:id2entry.c

示例6: ldif_read_entry

/*
 * Lies ein attrval-record nach position `offset' in `s'.
 * Setze *pos (falls pos != 0).
 * Liefere 0 bei Erfolg, -1 sonst.
 * Bei Erfolg:
 *   - pos ist die exakte Anfangsposition.
 *   - Setze *entry auf den gelesenen Eintrag (falls entry != 0).
 *   - Setze *key auf den Schluessel (falls key != 0).
 * EOF ist kein Fehler und liefert *key = 0 (falls key != 0);
 */
int
ldif_read_entry(FILE *s, long offset, char **key, tentry **entry, long *pos)
{
	GString *tmp1 = g_string_new("");
	GString *tmp2 = g_string_new("");
	char *dn;
	char *k = 0;
	tentry *e = 0;

	int rc = ldif_read_header(tmp1, tmp2, s, offset, &k, &dn, pos);
	if (rc || !k) goto cleanup;

	e = entry_new(dn);
	rc = ldif_read_attrval_body(tmp1, tmp2, s, e);
	if (!rc) {
		if (entry) {
			*entry = e;
			e = 0;
		}
		if (key) {
			*key = k;
			k = 0;
		}
	}

cleanup:
	if (k) free(k);
	if (e) entry_free(e);
	g_string_free(tmp1, 1);
	g_string_free(tmp2, 1);
	return rc;
}
开发者ID:wtsi-hgi,项目名称:ldapvi,代码行数:42,代码来源:parseldif.c

示例7: lsa_entry_exit

/*..........................................................................*/
void lsa_entry_exit(raid5_entry_t *rentry)
{
	while (!list_empty(&rentry->free)) {
		Entry *me = list_entry(rentry->free.next, Entry, entry);
		list_del(&me->entry);
		entry_free(me);
	}
}
开发者ID:Quenii,项目名称:lsa_raid,代码行数:9,代码来源:entry.c

示例8: avahi_hashmap_free

void avahi_hashmap_free(AvahiHashmap *m) {
    assert(m);

    while (m->entries_list)
        entry_free(m, m->entries_list, 0);
    
    avahi_free(m);
}
开发者ID:JDsolution,项目名称:ipnc,代码行数:8,代码来源:hashmap.c

示例9: entry_destroy

void entry_destroy(entry_t *e)
{
	if (e != NULL) {
		sdsdel(e->key);
		sdsdel(e->value);
		entry_free(e);
	}
}
开发者ID:pipul,项目名称:lab,代码行数:8,代码来源:hfile.c

示例10: entry_remove_and_free

static void entry_remove_and_free(pa_autoload_entry *e) {
    pa_assert(e);
    pa_assert(e->core);

    pa_idxset_remove_by_data(e->core->autoload_idxset, e, NULL);
    pa_hashmap_remove(e->core->autoload_hashmap, e->name);
    entry_free(e);
}
开发者ID:thewb,项目名称:mokoiax,代码行数:8,代码来源:autoload.c

示例11: avahi_hashmap_remove

void avahi_hashmap_remove(AvahiHashmap *m, const void *key) {
    Entry *e;
    
    assert(m);

    if (!(e = entry_get(m, key)))
        return;

    entry_free(m, e, 0);
}
开发者ID:JDsolution,项目名称:ipnc,代码行数:10,代码来源:hashmap.c

示例12: entry_free

static void
entry_free (void *x)
{
  if (x) {
    struct entry *p = x;
    entry_free (p->next);
    free (p->name);
    free (p->command);
    free (p);
  }
}
开发者ID:DanLipsitt,项目名称:libguestfs,代码行数:11,代码来源:events.c

示例13: entry_alloc

/*********************************************************************************
 * The contents of this file are subject to the Common Public Attribution
 * License Version 1.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.openemm.org/cpal1.html. The License is based on the Mozilla
 * Public License Version 1.1 but Sections 14 and 15 have been added to cover
 * use of software over a computer network and provide for limited attribution
 * for the Original Developer. In addition, Exhibit A has been modified to be
 * consistent with Exhibit B.
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 * 
 * The Original Code is OpenEMM.
 * The Original Developer is the Initial Developer.
 * The Initial Developer of the Original Code is AGNITAS AG. All portions of
 * the code written by AGNITAS AG are Copyright (c) 2007 AGNITAS AG. All Rights
 * Reserved.
 * 
 * Contributor(s): AGNITAS AG. 
 ********************************************************************************/
# include	<stdlib.h>
# include	<unistd.h>
# include	<fcntl.h>
# include	<string.h>
# include	<dirent.h>
# include	<errno.h>
# include	<sys/types.h>
# include	<sys/stat.h>
# include	"qctrl.h"

entry_t *
entry_alloc (const char *fname, int match) /*{{{*/
{
	entry_t	*e;
	
	if (e = (entry_t *) malloc (sizeof (entry_t))) {
		e -> fname = NULL;
		e -> match = match;
		e -> next = NULL;
		if (fname && (! (e -> fname = strdup (fname))))
			e = entry_free (e);
	}
	return e;
}/*}}}*/
entry_t *
entry_free (entry_t *e) /*{{{*/
{
	if (e) {
		if (e -> fname)
			free (e -> fname);
		free (e);
	}
	return NULL;
}/*}}}*/
entry_t *
entry_free_all (entry_t *e) /*{{{*/
{
	entry_t	*tmp;
	
	while (tmp = e) {
		e = e -> next;
		entry_free (tmp);
	}
	return NULL;
}/*}}}*/
开发者ID:OrangeCountySEOMarketing,项目名称:openemm,代码行数:66,代码来源:qlib.c

示例14: purge_flowtable

/*----------------------------------------------------------------------------*/
  static void
  purge_flowtable(void)
  {
    entry_t *e;
    entry_t *next;

    for(e = list_head(flowtable); e != NULL;) {
      next = e->next;
      entry_free(e);
      e = next;
    }
  }
开发者ID:suxiongye,项目名称:sdn-wise-contiki,代码行数:13,代码来源:flowtable.c

示例15: symbol_add_entry

/* Entry is eaten.
 * No check is done if entry->tuple is a member of sym->set !
 * This has to be done before.
 */
void symbol_add_entry(Symbol* sym, Entry* entry)
{
   const Tuple* tuple;
   
   assert(symbol_is_valid(sym));
   assert(entry_is_valid(entry));
   
   assert(sym->used <= sym->size);
   
   if (sym->used == sym->size)
   {
      sym->size   += sym->extend;
      sym->extend += sym->extend;
      sym->entry   = realloc(
         sym->entry, (size_t)sym->size * sizeof(*sym->entry));
      
      assert(sym->entry != NULL);
   }
   assert(sym->used < sym->size);

   tuple = entry_get_tuple(entry);

   /* There is no index set for the internal symbol.
    */
   assert(!strcmp(sym->name, SYMBOL_NAME_INTERNAL) || set_lookup(sym->set, tuple));

   if (hash_has_entry(sym->hash, tuple))
   {
      if (stmt_trigger_warning(166))
      {
         fprintf(stderr, "--- Warning 166: Duplicate element ");
         tuple_print(stderr, tuple);
         fprintf(stderr, " for symbol %s rejected\n", sym->name);
      }
      entry_free(entry);
   }
   else
   {
      /* Falls noch nicht geschehen, legen wir hier den Typ des
       * Symbols fest.
       */
      if ((sym->type == SYM_ERR) && (sym->used == 0))
         sym->type = entry_get_type(entry);

      assert(sym->type != SYM_ERR);
      
      hash_add_entry(sym->hash, entry);
      
      sym->entry[sym->used] = entry;      
      sym->used++;
   }
}
开发者ID:bubuker,项目名称:keggle_santa,代码行数:56,代码来源:symbol.c


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