• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ remove_entry函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getattr

int CassandraFS::unlink(const char* path) {
    struct stat stat;
    struct cfs_attrs cfs_attrs;
    int attr_err = getattr(path, &stat, &cfs_attrs);

    if (attr_err) {
        return attr_err;
    }
    
    CassandraFutureSpool *spool = new CassandraFutureSpool(4);

    spool->append(remove_entry(path));
    spool->append(remove_sub_entry(path));
    spool->append(remove_sub_entries(path));
    
    if (!S_ISDIR(stat.st_mode)) {
        remove_physical_file(&stat, &cfs_attrs, spool);
    }

    spool->wait_all();
    int errors = spool->get_errors();
    delete spool;
    
    if (errors > 0) {
        return -EIO;
    }
    
    return 0;
}
开发者ID:hkroger,项目名称:cqlfs,代码行数:29,代码来源:CassandraFS.cpp


示例2: remove_entry

static void
remove_entry(IsStore *self,
	     IsStoreEntry *entry)
{
	IsStorePrivate *priv;
	GtkTreeIter iter;
	GtkTreePath *path;
	GSequenceIter *parent_iter;

	priv = self->priv;

	parent_iter = entry->parent;
	iter.stamp = priv->stamp;
	iter.user_data = entry->iter;
	path = gtk_tree_model_get_path(GTK_TREE_MODEL(self), &iter);
	g_sequence_remove(entry->iter);
	gtk_tree_model_row_deleted(GTK_TREE_MODEL(self), path);
	gtk_tree_path_free(path);

	/* remove parent if it has no children now */
	if (parent_iter) {
		IsStoreEntry *parent = g_sequence_get(parent_iter);
		if (g_sequence_get_length(parent->entries) == 0) {
			remove_entry(self, parent);
		}
	}
}
开发者ID:guestiso9001,项目名称:indicator-sensors,代码行数:27,代码来源:is-store.c


示例3: econ_change_items

void econ_change_items(dbref d, int id, int brand, int num)
{
	char *t, *u;
	int base = 0, i1, i2, i3;

	if(!Good_obj(d))
		return;
	if(brand)
		if(get_parts_short_name(id, brand) == get_parts_short_name(id, 0))
			brand = 0;
	t = silly_atr_get(d, A_ECONPARTS);
	if((u = find_entry(t, id, brand))) {
		if(sscanf(u, "[%d,%d,%d]", &i1, &i2, &i3) == 3)
			base += i3;
		remove_entry(t, u);
	}
	base += num;
	if(base <= 0) {
		if(u)
			silly_atr_set(d, A_ECONPARTS, t);
		return;
	}
	if(!(IsActuator(id)))
		add_entry(t, tprintf("%d,%d,%d", id, brand, base));
	silly_atr_set(d, A_ECONPARTS, t);
	if(IsActuator(id))
		econ_change_items(d, Cargo(S_ACTUATOR), brand, base);
	/* Successfully changed */
}
开发者ID:chazu,项目名称:btmux,代码行数:29,代码来源:econ.c


示例4: main

int main(void) {
    struct entry e1, e2, e3, e4;
    struct entry first_entry;
    struct entry *list = &first_entry;

    first_entry.next = &e1;
    e1.value = 1;
    e1.next = &e2;
    e2.value = 2;
    e2.next = &e3;
    e3.value = 3;
    e3.next = &e4;
    e4.value = 4;
    e4.next = (struct entry *)0;

    remove_entry(&e3);

    list = list->next;
    while (list != (struct entry *)0) {
        printf("%i\n", list->value);
        list = list->next;
    }

    return 0;
}
开发者ID:Krak-n,项目名称:learning,代码行数:25,代码来源:ch10pr04.c


示例5: entry

void core_options::add_entries(const options_entry *entrylist, bool override_existing)
{
	// loop over entries until we hit a NULL name
	for ( ; entrylist->name != NULL || (entrylist->flags & OPTION_HEADER) != 0; entrylist++)
	{
		// allocate a new entry
		entry *newentry = new entry(*entrylist);
		if (newentry->name() != NULL)
		{
			// see if we match an existing entry
			entry *existing = m_entrymap.find(newentry->name());
			if (existing != NULL)
			{
				// if we're overriding existing entries, then remove the old one
				if (override_existing)
				{
					core_options::entry *e = m_entrylist;
					remove_entry(*existing);
					delete e;
				}

				// otherwise, just override the default and current values and throw out the new entry
				else
				{
					existing->set_default_value(newentry->value());
					delete newentry;
					continue;
				}
			}
		}

		// add us to the list and maps
		append_entry(*newentry);
	}
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:35,代码来源:options.c


示例6: main

int main(int argc, char **argv) 
{
	CLIENT client_struct, *c;
        FLICK_SERVER_LOCATION s;
	int sel, done;
	
	c = &client_struct;
	
	if (argc != 2) {
		fprintf(stderr, "Usage: %s <host>\n", argv[0]);
		exit(1);
	}
	
	s.server_name = argv[1];
	s.prog_num = netphone;
	s.vers_num = firstphone;
	create_client(c, s);
	
	done = 0;
	while (!done) {
		read_integer(("\n(1) Add an entry (2) Remove an entry "
			      "(3) Find a phone number (4) Exit: "),
			     &sel);
		switch(sel) {
		case 1:  add_entry(c); break;
		case 2:  remove_entry(c); break;
		case 3:  find_entry(c); break;
		case 4:  done = 1; break;
		default: printf("Please enter 1, 2, 3, or 4.\n");
		}
	}
	return 0;
}
开发者ID:berkus,项目名称:flick,代码行数:33,代码来源:phonebook.c


示例7: ghostfs_rename

int ghostfs_rename(struct ghostfs *gfs, const char *path, const char *newpath)
{
	struct dir_iter it;
	struct dir_entry *entry;
	int ret;

	ret = dir_iter_lookup(gfs, &it, path, false);
	if (ret < 0)
		return ret;

	if (it.entry == &gfs->root_entry)
		return -EINVAL;

	remove_entry(gfs, newpath, false);

	ret = create_entry(gfs, newpath, false, &entry);
	if (ret < 0)
		return ret;

	// remove old entry
	it.entry->filename[0] = '\0';
	cluster_set_dirty(it.cluster, true);

	// fix new entry
	entry->size = it.entry->size;
	entry->cluster = it.entry->cluster;

	return 0;
}
开发者ID:mukadr,项目名称:ghostfs,代码行数:29,代码来源:fs.c


示例8: elapse_func

static void elapse_func(AvahiTimeEvent *t, void *userdata) {
    AvahiCacheEntry *e = userdata;
/*     char *txt; */
    unsigned percent = 0;

    assert(t);
    assert(e);

/*     txt = avahi_record_to_string(e->record); */

    switch (e->state) {

        case AVAHI_CACHE_EXPIRY_FINAL:
        case AVAHI_CACHE_POOF_FINAL:
        case AVAHI_CACHE_GOODBYE_FINAL:
        case AVAHI_CACHE_REPLACE_FINAL:

            remove_entry(e->cache, e);

            e = NULL;
/*         avahi_log_debug("Removing entry from cache due to expiration (%s)", txt); */
            break;

        case AVAHI_CACHE_VALID:
        case AVAHI_CACHE_POOF:
            e->state = AVAHI_CACHE_EXPIRY1;
            percent = 85;
            break;

        case AVAHI_CACHE_EXPIRY1:
            e->state = AVAHI_CACHE_EXPIRY2;
            percent = 90;
            break;
        case AVAHI_CACHE_EXPIRY2:
            e->state = AVAHI_CACHE_EXPIRY3;
            percent = 95;
            break;

        case AVAHI_CACHE_EXPIRY3:
            e->state = AVAHI_CACHE_EXPIRY_FINAL;
            percent = 100;
            break;
    }

    if (e) {

        assert(percent > 0);

        /* Request a cache update if we are subscribed to this entry */
        if (avahi_querier_shall_refresh_cache(e->cache->interface, e->record->key))
            avahi_interface_post_query(e->cache->interface, e->record->key, 0, NULL);

        /* Check again later */
        next_expiry(e->cache, e, percent);

    }

/*     avahi_free(txt); */
}
开发者ID:sunilghai,项目名称:avahi-clone,代码行数:59,代码来源:cache.c


示例9: while

void core_options::reset()
{
	// remove all entries from the list
	while (m_entrylist != NULL)
		remove_entry(*m_entrylist);

	// reset the map
	m_entrymap.reset();
}
开发者ID:bdidier,项目名称:MAME-OS-X,代码行数:9,代码来源:options.c


示例10: del

/**
 * Tries to delete a person.
 */
void del(void)
{
    int i, num_del;
    if (num_list > 1)
    {
        // ask how many entry that user want to delete
        printf("How many entry do you want to delete? Choose 1~%i: ", num_list);
        scanf("%i", &num_del);
        for (i = 0; i < num_del - 1; i++)
        {
            remove_entry(); // delete (wanted number - 1) entries
        }
    }
    remove_entry(); // delete once more

    // print_list list
    print_list();
}
开发者ID:wontheone1,项目名称:C-Programming,代码行数:21,代码来源:ex32+linked_listwithoutheader.c


示例11: ax_free

EXP_FUNC void STDCALL ax_free(void *y, const char* f, const int l)
{
    if(enable)  
        printf("free\t");
        
    remove_entry(y, f, l);
    print_buf_stats();
    free(y);
}
开发者ID:1deus,项目名称:tmk_keyboard,代码行数:9,代码来源:os_port.c


示例12: test4

/*Test4 tests inserting a large number of keys, chekcing key_count, deleting a few, rechecking the
key_count, then clearing the entire table. We will then reinsert some keys.*/
static int test4(){
   int x = 1, y =2, z = 3, w =4, k = 5, a =6, b =7
   , c =8, d = 9, e = 10, f = 11, g = 12;
   Table *t;

   /*Creates table and adds 13 keys to it.*/
   create_table(&t, z, NULL);
   put(t, "Krabs", &a);
   put(t, "Larry", &b);
   put(t, "Herminator", &c);
   put(t, "Brian", &d);
   put(t, "Steve", &e);
   put(t, "Nelson", &f);
   put(t, "Corwin", &g);
   put(t, "Spongebob", &x);
   put(t, "Patrick", &y);
   put(t, "Squidward", &z);
   put(t, "Sandy", &w);
   put(t, "Art thou feeling it now,", NULL);
   put(t, "Mr. Krabs?", &k);
   printf("%d\n", get_key_count(t));
   display_table(t);
   /*Removes two keys from the table, then rechekcs key_count and
   displays the state of the table.*/
   remove_entry(t,"Mr. Krabs?");
   remove_entry(t,"Art thou feeling it now,");
   printf("%d\n", get_key_count(t));
   display_table(t);

   /*Clears the table, then rechecks the key_count.*/
   clear_table(t);
   printf("%d\n", get_key_count(t));
   /*Reinserts 7 keys, then checks the state of the table again.*/
   put(t, "A1", &a);
   put(t, "A2", &b);
   put(t, "A3", &c);
   put(t, "A4", &d);
   put(t, "A5", &e);
   put(t, "A6", &f);
   put(t, "A7", &g);
   display_table(t);
   destroy_table(t);
   return SUCCESS;
}
开发者ID:bhandy02,项目名称:School-Projects,代码行数:46,代码来源:student_tests.c


示例13: create_two_story_trie

static bool create_two_story_trie(void)
{
	bool success = true;

	success &= add_entry("1.0.0.0", 32, "1::00", 120);
	success &= add_entry("2.0.0.0", 32, "1::10", 124);
	success &= add_entry("3.0.0.0", 32, "1::20", 124);

	success &= remove_entry(NULL, 0, "1::", 128, -ESRCH);
	success &= remove_entry(NULL, 0, "1::", 121, -ESRCH);
	success &= remove_entry(NULL, 0, "1::", 119, -ESRCH);
	success &= remove_entry(NULL, 0, "0::", 0, -ESRCH);

	success &= test("1.0.0.0", "1::00");
	success &= test("2.0.0.0", "1::10");
	success &= test("3.0.0.0", "1::20");

	return success;
}
开发者ID:pandax381,项目名称:NAT64,代码行数:19,代码来源:eamt_test.c


示例14: while

core_options::~core_options()
{
	// delete all entries from the list
	while (m_entrylist != NULL)
	{
		core_options::entry *e = m_entrylist;
		remove_entry(*m_entrylist);
		delete e;
	}
}
开发者ID:Ilgrim,项目名称:MAMEHub,代码行数:10,代码来源:options.c


示例15: remove_entry

    ReturnCode RamFileSystem::remove_entry(uint32_t entry_id)
    {
        if (entry_id == NULL_ID)
        {
            return NULL_PARAMETER;
        }

        // Cannot remove root
        if (entry_id == 1)
        {
            return WRONG_ENTRY_TYPE;
        }

        auto find = _entry_index.find(entry_id);
        if (find == _entry_index.end())
        {
            return ENTRY_NOT_FOUND;
        }

        auto type = find->second->metadata().type();

        if (type == FOLDER_ENTRY)
        {
            auto folder = dynamic_cast<Folder *>(find->second.get());
            if (folder != nullptr)
            {
                if (folder->size() > 0)
                {
                    return FOLDER_NOT_EMPTY;
                }
            }
        }

        auto parent_find = _entry_index.find(find->second->parent_folder_id());
        if (parent_find == _entry_index.end())
        {
            // Parent not found?
            return ENTRY_NOT_FOUND;
        }

        auto parent_folder = dynamic_cast<Folder *>(parent_find->second.get());
        if (parent_folder == nullptr)
        {
            // Parent wrong entry type?
            return WRONG_ENTRY_TYPE;
        }

        auto result = parent_folder->remove_entry(entry_id);
        if (result == SUCCESS)
        {
            _entry_index.erase(find);
        }

        return result;
    }
开发者ID:astrellon,项目名称:loss,代码行数:55,代码来源:ram_filesystem.cpp


示例16: DelCrate

//-------------------------------------------------------------------------
// Delete a crate from the crate db
//-------------------------------------------------------------------------
int DelCrate()
{
	char	crateName[CRATE_NAME_SIZE + 1];
	int		index, numOfEntries;
	int		status = SUCCESS;

	static DESCRIPTOR( phy_name_p, "PHY_NAME" );
	static DYNAMIC_DESCRIPTOR( phy_name );

	// get user input
	str_free1_dx(&phy_name);				// per twf -- clear out field
	cli_get_value( &phy_name_p, &phy_name );
	str_upcase( &phy_name, &phy_name );
	// trim it...
	sprintf(crateName, "%.6s", phy_name.pointer);

	// check to see if db file memory mapped
	if( CRATEdbFileIsMapped == FALSE ) {			// is not, so try
		if( map_data_file(CRATE_DB) != SUCCESS ) {	// we're dead in the water
			status = FAILURE;		// MAP_ERROR;		[2001.07.12]
			goto DelCrate_Exit;
		}
	}

	// get number of current entries
	if( (numOfEntries = get_file_count(CRATE_DB)) == 0 ) {	// no entries in crate db file
		if( MSGLVL(IMPORTANT) )
			fprintf( stderr, "db file empty, no entries to remove\n" );

		status = FAILURE;		// DELCRATE_ERROR;		[2001.07.12]
		goto DelCrate_Exit;
	}

	// try to remove from crate.db
	if( (index = lookup_entry(CRATE_DB, crateName)) >= 0 ) {	// module does exist
		if( remove_entry(CRATE_DB, index) != SUCCESS ) {		// removal failed
			status = FAILURE;		// DELCRATE_ERROR;		[2001.07.12]
			goto DelCrate_Exit;
		}
	}
	else {		// no such module
		if( MSGLVL(IMPORTANT) )
			fprintf( stderr, "delcrate(): entry '%s' not found\n", crateName);

		status = FAILURE;		// DELCRATE_ERROR;		[2001.07.12]
		goto DelCrate_Exit;
	}

DelCrate_Exit:
	if( MSGLVL(DETAILS) ) {
		printf("DelCrate() status = %d\n", status);
	}

	return SUCCESS;
}
开发者ID:LucyScott,项目名称:mdsplus,代码行数:58,代码来源:verbs.c


示例17: remove_entry

void CPjTimerEntry::DoCancel() 
{
    /* It's possible that _timer_id is -1, see schedule(). In this case,
     * the entry has not been added to the timer heap, so don't remove
     * it.
     */
    if (entry_ && entry_->_timer_id != -1)
	remove_entry(timer_heap_, this);
    
    rtimer_.Cancel();
}
开发者ID:avble,项目名称:natClientEx,代码行数:11,代码来源:timer_symbian.cpp


示例18: main

int main(int argc, char **argv) {
	if (argc!=2) {
		fprintf(stderr,"usage : syr1_rm nom\n");
		return -1;
	}
	int res = remove_entry(argv[1]);
	if (res< 0) {
		fprintf(stderr,"Error %d during syr1_rm\n",res);
	}
	return 0;
}
开发者ID:tompo-andri,项目名称:Licence3,代码行数:11,代码来源:syr1_rm.c


示例19: rename

    ReturnCode RamFileSystem::rename(uint32_t folder_id, const std::string &name, uint32_t new_parent_id, const std::string &new_name)
    {
        if (name.size() == 0u || new_parent_id == NULL_ID || new_name.size() == 0u)
        {
            return NULL_PARAMETER;
        }

        // We did it!
        if (folder_id == new_parent_id && name == new_name)
        {
            return SUCCESS;
        }

        auto find = _entry_index.find(folder_id);
        if (find == _entry_index.end())
        {
            return ENTRY_NOT_FOUND;
        }
        auto current_parent = find->second.get();
        if (current_parent->metadata().type() != FOLDER_ENTRY)
        {
            return WRONG_ENTRY_TYPE;
        }

        find = _entry_index.find(new_parent_id);
        if (find == _entry_index.end())
        {
            return ENTRY_NOT_FOUND;
        }
        auto new_parent = find->second.get();
        if (new_parent->metadata().type() != FOLDER_ENTRY)
        {
            return WRONG_ENTRY_TYPE;
        }

        auto current_parent_folder = dynamic_cast<Folder *>(current_parent);
        auto new_parent_folder = dynamic_cast<Folder *>(new_parent);

        Entry *to_move = nullptr;
        auto move_find = current_parent_folder->find_entry(name, &to_move);
        if (move_find != SUCCESS)
        {
            return move_find;
        }

        auto move_result = new_parent_folder->add_entry(new_name, to_move);
        if (move_result != SUCCESS)
        {
            return move_result;
        }
        current_parent_folder->remove_entry(name);

        return SUCCESS;
    }
开发者ID:astrellon,项目名称:loss,代码行数:54,代码来源:ram_filesystem.cpp


示例20: avahi_cache_free

void avahi_cache_free(AvahiCache *c) {
    assert(c);

    while (c->entries)
        remove_entry(c, c->entries);
    assert(c->n_entries == 0);

    avahi_hashmap_free(c->hashmap);

    avahi_free(c);
}
开发者ID:sunilghai,项目名称:avahi-clone,代码行数:11,代码来源:cache.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ remove_file函数代码示例发布时间:2022-05-30
下一篇:
C++ remove_edge函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap