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

C++ ListAdd函数代码示例

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

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



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

示例1: CopySpecifier

struct Specifier * CopySpecifier(struct Specifier * spec)
{
if(spec)
switch(spec->type)
{
case 0:
return MkSpecifier(spec->specifier);
case 2:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
struct Enumerator * enumerator;

if(spec->list)
{
for(enumerator = (*spec->list).first; enumerator; enumerator = enumerator->next)
ListAdd(list, CopyEnumerator(enumerator));
}
return MkEnum(id, list);
}
case 3:
case 4:
{
struct Identifier * id = CopyIdentifier(spec->id);
struct __ecereNameSpace__ecere__sys__OldList * list = (((void *)0));
struct ClassDef * def;
struct Specifier * s;

if(spec->definitions)
{
list = MkList();
if(spec->list)
{
for(def = (*spec->list).first; def; def = def->next)
ListAdd(list, CopyClassDef(def));
}
}
s = MkStructOrUnion(spec->type, id, list);
s->extDeclStruct = CopyExtDecl(spec->extDeclStruct);
return s;
}
case 1:
{
struct Specifier * copy = (copy = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier), copy->type = 1, copy->name = __ecereNameSpace__ecere__sys__CopyString(spec->name), copy->symbol = spec->symbol, copy->templateArgs = (((void *)0)), copy);

return copy;
}
case 7:
return MkSpecifierSubClass(CopySpecifier(spec->_class));
case 8:
return __extension__ ({
struct Specifier * __ecereInstance1 = __ecereNameSpace__ecere__com__eInstance_New(__ecereClass_Specifier);

__ecereInstance1->loc = spec->loc, __ecereInstance1->type = 8, __ecereInstance1->templateParameter = spec->templateParameter, __ecereInstance1;
});
case 5:
return MkSpecifierExtended(CopyExtDecl(spec->extDecl));
}
开发者ID:tcsilver,项目名称:ecere-sdk,代码行数:58,代码来源:copy.c


示例2: QMkDeclarationBase

struct Declaration * QMkDeclarationBase(int base, struct InitDeclarator * initDecl)
{
struct __ecereNameSpace__ecere__sys__OldList * specs = MkList(), * initDecls = (((void *)0));

ListAdd(specs, MkSpecifier(base));
if(initDecl)
{
initDecls = MkList();
ListAdd(initDecls, initDecl);
}
return MkDeclaration(specs, initDecls);
}
开发者ID:DBane,项目名称:sdk,代码行数:12,代码来源:shortcuts.c


示例3: ListView_GetItemCount

BOOL ZipDlg::ListMove( BOOL blnUp)
{
	int	intSize		= ListView_GetItemCount( hwndList) ;
	bool	blnMoved	= false ;	// 動く余地があるかどうか
	int	intIndex ;
	
	vector<BOOL> vecSelected ;
	BOOL blnTop = TRUE ;

	for( int i = 0; i < intSize; i++)
	{
		intIndex = blnUp ? i : intSize - i - 1 ;
		
		if( ListView_GetItemState( hwndList, intIndex, LVIS_SELECTED))
		{
			if( !blnMoved)
			{
				continue ;
			}

			// リストビュー
			ListView_DeleteItem( hwndList, intIndex) ;

			if( blnUp) // index減少
			{
				ListAdd( vecFileList[ intIndex], intIndex - 1) ;
			}
			else
			{
				ListAdd( vecFileList[ intIndex], intIndex + 1) ;
			}

			if( blnTop)
			{
				ListView_SetItemState( hwndList, intIndex + ( blnUp ? -1 : 1), LVIS_FOCUSED, LVIS_FOCUSED) ;
				ListView_EnsureVisible( hwndList, intIndex + ( blnUp ? -1 : 1), FALSE) ;
				blnTop = FALSE ;
			}

			// ドキュメント
			ListReload() ;
		}
		else
		{
			blnMoved = true ;
		}
	}

	return TRUE ;
}
开发者ID:nitoyon,项目名称:mp3album,代码行数:50,代码来源:ZipDlg.cpp


示例4: AddOpenNeighboursToList

void AddOpenNeighboursToList (location_t here)
{
  if (HasExit (here, NORTH)) {
    ListAdd (Neighbour (here, NORTH));
  }
  if (HasExit (here, EAST)) {
    ListAdd (Neighbour (here, EAST));
  }
  if (HasExit (here, SOUTH)) {
    ListAdd (Neighbour (here, SOUTH));
  }
  if (HasExit (here, WEST)) {
    ListAdd (Neighbour (here, WEST));
  }
}
开发者ID:micromouseonline,项目名称:micromouse-maze,代码行数:15,代码来源:mazeflooder.c


示例5: mimeTypeAdd

static void
mimeTypeAdd(MIMEType *   const MIMETypeP,
            const char * const type,
            const char * const ext,
            bool *       const successP) {
    
    uint16_t index;
    void * mimeTypesItem;
    bool typeIsInList;

    assert(MIMETypeP != NULL);

    typeIsInList = ListFindString(&MIMETypeP->typeList, type, &index);
    if (typeIsInList)
        mimeTypesItem = MIMETypeP->typeList.item[index];
    else
        mimeTypesItem = (void*)PoolStrdup(&MIMETypeP->pool, type);

    if (mimeTypesItem) {
        bool extIsInList;
        extIsInList = ListFindString(&MIMETypeP->extList, ext, &index);
        if (extIsInList) {
            MIMETypeP->typeList.item[index] = mimeTypesItem;
            *successP = TRUE;
        } else {
            void * extItem = (void*)PoolStrdup(&MIMETypeP->pool, ext);
            if (extItem) {
                bool addedToMimeTypes;

                addedToMimeTypes =
                    ListAdd(&MIMETypeP->typeList, mimeTypesItem);
                if (addedToMimeTypes) {
                    bool addedToExt;
                    
                    addedToExt = ListAdd(&MIMETypeP->extList, extItem);
                    *successP = addedToExt;
                    if (!*successP)
                        ListRemove(&MIMETypeP->typeList);
                } else
                    *successP = FALSE;
                if (!*successP)
                    PoolReturn(&MIMETypeP->pool, extItem);
            } else
                *successP = FALSE;
        }
    } else
        *successP = FALSE;
}
开发者ID:BirminghamConservatoire,项目名称:IntegraLive,代码行数:48,代码来源:response.c


示例6: DragQueryFile

LRESULT ZipDlg::OnDropFiles( HWND hwnd, WPARAM wParam, LPARAM lParam)
{
	HDROP hDrop = (HDROP)wParam ;
	unsigned int intIndex = DragQueryFile( hDrop, 0xFFFFFFFF, NULL, 0) ;
	for( unsigned int i = 0; i < intIndex; i++)
	{
		char pszBuf[ MAX_PATH + 1] ;
		DragQueryFile( hDrop, i, pszBuf, MAX_PATH) ;
		string s = pszBuf ;

		// フォルダか?
		if( GetFileAttributes( s.c_str()) & FILE_ATTRIBUTE_DIRECTORY)
		{
			// 検索開始
			string strFind = s + "\\*.*" ;
			WIN32_FIND_DATA wfd ;
			HANDLE hFind = FindFirstFile( strFind.c_str(), &wfd) ;
			if( hFind == INVALID_HANDLE_VALUE)
			{
				return 0 ;
			}
			do
			{
				// アイテム名のフィルタリング
				string strFile = wfd.cFileName ;
				if( strFile == "." || strFile == "..")
				{
					continue ;
				}

				Mp3File* pMp3 = new Mp3File( s + "\\" + strFile) ;
				pMp3->SetSaveName( GetFileName( s) + "\\" + strFile) ;
				ListAdd( pMp3, vecFileList.size()) ;
			}
			while( FindNextFile( hFind, &wfd)) ;

			FindClose( hFind) ;
		}
		else if( !Profile::blnOnlyMp3 || s.rfind( ".mp3") == s.size() - 4 || 
		    s.rfind( ".MP3") == s.size() - 4)
		{
			Mp3File* pMp3 = new Mp3File( pszBuf) ;
			ListAdd( pMp3, vecFileList.size()) ;
		}
	}
	DragFinish( hDrop) ;
	return TRUE ;
}
开发者ID:nitoyon,项目名称:mp3album,代码行数:48,代码来源:ZipDlg.cpp


示例7: CopyInstantiation

static struct Instantiation * CopyInstantiation(struct Instantiation * inst)
{
struct Instantiation * copy;
struct __ecereNameSpace__ecere__sys__OldList * list = MkList();
struct MembersInit * member;

if(inst->members)
{
for(member = (*inst->members).first; member; member = member->next)
ListAdd(list, CopyMembersInit(member));
}
copy = MkInstantiation(CopySpecifier(inst->_class), CopyExpression(inst->exp), list);
copy->data = inst->data;
if(inst->data)
{
struct Symbol * classSym = FindClass(inst->_class->name);
struct __ecereNameSpace__ecere__com__Class * _class = classSym ? classSym->registered : (((void *)0));

if(_class)
{
if(_class->type == 0)
((struct __ecereNameSpace__ecere__com__Instance *)(char *)((struct __ecereNameSpace__ecere__com__Instance *)copy->data))->_refCount++;
}
}
copy->loc = inst->loc;
copy->isConstant = inst->isConstant;
return copy;
}
开发者ID:tcsilver,项目名称:ecere-sdk,代码行数:28,代码来源:copy.c


示例8: RCBC_MiniXML_ProcessGeometries_Mesh_FloatArray

/**
 * Reads a float array, such as verticies, normals, text cords, etc...
 * @param tempory The ModelTempory struct to hold the array.
 * @param mesh The mesh using the floats
 * @param xnode The XML node containing the data.
 * @return 
 */
FloatArray* RCBC_MiniXML_ProcessGeometries_Mesh_FloatArray(ModelTempory *tempory, Mesh *mesh, mxml_node_t *xnode) {
	DEBUG_M("Entering function...");

	const char* id = mxmlElementGetAttr(xnode, "id");
	const char* count_s = mxmlElementGetAttr(xnode, "count");
	int count = atoi(count_s);

	FloatArray* newarray = NEW(FloatArray, count);
	if(!newarray) {
		return NULL;
	}

	GLfloat f = 0.0f;
	int i = 0;
	char* pch = strtok(xnode->child->value.opaque, " ");
	while(pch && i < count) {
		sscanf(pch, "%f", &f);
		newarray->values[i] = f;
		pch = strtok(NULL, " ");
		i++;
	}

	ListAdd(tempory->deleteme, newarray);

	DEBUG_M("exiting function");
	return newarray;
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:34,代码来源:rcbc_xml_minixml_geometries.c


示例9: ListAddFromString

int ListAddFromString(TList *list,char *c)
{
	char *t = 0;
	char *p = 0;

	/* sanity */
	if (!list) {
		return FALSE;
	}

	if (c)
		while (1)
		{
			NextToken(&c);

			while (*c==',')
				c++;

			if (!(t=GetToken(&c)))
				break;

			p=c-2;

			while (*p==',')
				*(p--)='\0';

			if (*t)
				if (!ListAdd(list,t))
					return FALSE;
		};

	return TRUE;
}
开发者ID:cmjonze,项目名称:anacapa,代码行数:33,代码来源:data.c


示例10: LookupNotificationAttributes

static NotificationAttributes * LookupNotificationAttributes(struct ListHead * attributesList, int shortServerID, ObjectIDType objectID,
                                                             ObjectInstanceIDType objectInstanceID, ResourceIDType resourceID)
{
    NotificationAttributes * result = NULL;
    if (attributesList != NULL)
    {
        struct ListHead * i;
        ListForEach(i, attributesList)
        {
            NotificationAttributes * attributes = ListEntry(i, NotificationAttributes, list);
            if ((attributes != NULL) &&
                (attributes->ShortServerID == shortServerID) &&
                (attributes->ObjectID == objectID) &&
                (attributes->ObjectInstanceID == objectInstanceID) &&
                (attributes->ResourceID == resourceID))
            {
                result = attributes;
                break;
            }
        }
        if (result == NULL)
        {
            // doesn't exist yet, so create
            result = malloc(sizeof(NotificationAttributes));
            memset(result, 0, sizeof(NotificationAttributes));
            memset(result->Valid, 0, sizeof(result->Valid));
            result->ObjectID = objectID;
            result->ObjectInstanceID = objectInstanceID;
            result->ResourceID = resourceID;
            result->ShortServerID = shortServerID;
            ListAdd(&result->list, attributesList);
        }
    }
开发者ID:FlowM2M,项目名称:AwaLWM2M,代码行数:33,代码来源:lwm2m_attributes.c


示例11: QMkClass

struct TypeName * QMkClass(char * spec, struct Declarator * decl)
{
struct __ecereNameSpace__ecere__sys__OldList * specs = MkList();

ListAdd(specs, MkSpecifierName(spec));
return MkTypeName(specs, decl);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c


示例12: RCBC_MiniXML_ProcessTextureEffects_Newparam

/* Process the <library_effects><effect><profile_COMMON><newparam> section of COLLADA */
void RCBC_MiniXML_ProcessTextureEffects_Newparam(ModelTempory *tempory, mxml_node_t *node, Hookup* fx_hookup) {
	DEBUG_M("Entering function...");
	mxml_node_t* child;
	//const char* newparam_sid = mxmlElementGetAttr(node, "id");
	//const char* surface_type;
	const char* init_from;

	assert(tempory);
	assert(node);
	assert(fx_hookup);

	DumpNodeInfo(node);

	for(node = node->child; node != NULL; node = node->next) {
		DumpNodeInfo(node);
		if(node->type == MXML_ELEMENT
		&& strcasecmp(node->value.element.name, "surface") == 0) {

			for(child = node->child; child != NULL; child = child->next) {
				if(child->type == MXML_ELEMENT
				&& strcasecmp(child->value.element.name, "init_from") == 0) {

					//surface_type = mxmlElementGetAttr(child, "type");
					init_from = child->child->value.opaque;
					Hookup* img_hookup = NEW(Hookup, (char*)init_from, &fx_hookup->ptr);
					ListAdd(tempory->sinks, img_hookup);
				}
			}

		}
	}
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:33,代码来源:rcbc_xml_minixml_textures.c


示例13: QBrackets

struct Expression * QBrackets(struct Expression * exp)
{
struct __ecereNameSpace__ecere__sys__OldList * expList = MkList();

ListAdd(expList, exp);
return MkExpBrackets(expList);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c


示例14: RCBC_MiniXML_ProcessTextureEffects

/* Process the <library_effects> section of COLLADA */
void RCBC_MiniXML_ProcessTextureEffects(ModelTempory *tempory, mxml_node_t *node) {
	DEBUG_M("Entering function...");
	const char* id;
	mxml_node_t* child;

	assert(tempory);
	if(!node) {
		return;
	}
	
	/* Loop through all the effect nodes */
	for(node = node->child; node != NULL; node = node->next) {
		if(node->type == MXML_ELEMENT	&&
			strcasecmp(node->value.element.name, "effect") == 0) {

			id = mxmlElementGetAttr(node, "id");

			for(child = node->child; child != NULL; child = child->next) {
				if(child->type == MXML_ELEMENT &&
					strcasecmp(child->value.element.name, "profile_COMMON") == 0) {

					Hookup* fx_hookup =  NEW(Hookup, (char*)id, NULL);
					ListAdd(tempory->sources, fx_hookup);

					RCBC_MiniXML_ProcessTextureEffects_Profile(tempory, child, fx_hookup);
				}
			}

		}
	}
}
开发者ID:dcbishop,项目名称:rcbc,代码行数:32,代码来源:rcbc_xml_minixml_textures.c


示例15: QMkExpCond

struct Expression * QMkExpCond(struct Expression * cond, struct Expression * exp, struct Expression * elseExp)
{
struct __ecereNameSpace__ecere__sys__OldList * expList = MkList();

ListAdd(expList, exp);
return MkExpCondition(cond, expList, elseExp);
}
开发者ID:DBane,项目名称:sdk,代码行数:7,代码来源:shortcuts.c


示例16: ListInsert

// return 0 (success) or -1 (fail)
int ListInsert(LIST *list, void *item) {
	list->curr = list->curr->prev;
	if (list->curr == list->head) {
		list->boundary = -1;
	}
	return ListAdd(list, item);
}
开发者ID:kepang,项目名称:os-simulator,代码行数:8,代码来源:list.c


示例17: HashMapAdd

void HashMapAdd(struct HashMap* HashMap, Data dat)
{
    int datHash = (HashMap->HashFunction)(dat);
    if(datHash >= HashMap->MaxHashValue)
        datHash %= HashMap->MaxHashValue;
    dat.c = HashMapDeleteAll(HashMap, dat, cmpData) + 1;
    ListAdd( (HashMap->Map)[datHash], dat);
}
开发者ID:Avi2011class,项目名称:Test,代码行数:8,代码来源:database.c


示例18: MonEnter

/* Enter Monitor Status
 * If it is locked add to queue and add
 * to the enter semaphore's sleep counter */
void MonEnter(){
  if(isLocked){
    ListAdd(enterQueue, MyPid());
    P(enterSem);
  }else{
    isLocked = 1;
  }
}
开发者ID:AngryShrimp,项目名称:CMPT332,代码行数:11,代码来源:Monitor.c


示例19: ServerCreate

int ServerCreate(TServer *srv,POOL *pool,char *name,uint16 port,char *filespath,
				  char *modulepath, char *logfilename)
{
	/* sanity */
	if (!srv) {
		return FALSE;
	}

	srv->name = (name ? strdup(name) : 0);
	srv->port=port;
	srv->defaulthandler=(void *)ServerDefaultHandlerFunc;
	srv->rootpath =  strdup( DEFAULT_ROOT );
	srv->filespath = (filespath ? strdup(filespath) : 0);
	srv->modulepath = ( modulepath ? strdup(modulepath) : 0 );
	srv->keepalivetimeout=15;
	srv->keepalivemaxconn=100000;
	srv->timeout=15;
	srv->stopped = 0;
	srv->pool = ap_make_sub_pool( pool );

        srv->uri_handlers = 0;
        srv->uri_wildcard_handlers = 0;
        srv->content_handlers = 0;
        srv->content_wildcard_handlers = 0;

	if( srv->max_conn == 0 )
		srv->max_conn = DEFAULT_MAX_CONN;

	srv->conn = (TConn *)malloc( sizeof(TConn)*srv->max_conn );
	memset(srv->conn, 0, sizeof(TConn) * srv->max_conn);

	srv->stat_data_time = 0;
	srv->stat_conns = 0;
	srv->stat_inbytes = 0;
	srv->stat_outbytes = 0;

#ifdef _UNIX
	srv->pidfile.fd=srv->uid=srv->gid=(-1);
#endif	/* _UNIX */

	ListInitAutoFree(&srv->defaultfilenames);

	if (logfilename) {
		if( srv->error_fname )
			free( srv->error_fname );
		srv->error_fname = strdup( logfilename );
	} else 
		srv->error_fname=NULL;

	srv->conf_fname = NULL;
	srv->diag_fname = NULL;
	srv->configDB_fname = NULL;

        /* enter into the global serv list */
        ListAdd( &srv_list,srv );

	return TRUE;
}
开发者ID:cmjonze,项目名称:anacapa,代码行数:58,代码来源:server.c


示例20: MonSignal

/* Monitor Signal
 * If we have something in the condition variable
 * list then remove it from that list and add it to 
 * the urguentQueue list and we release the condition
 * variable semaphore and add to the urguentQueue's semaphore */
void MonSignal(int cv){

  if(ListCount(condLists[cv]) > 0){
    ListRemove(condLists[cv]);
    ListAdd(urgentQueue, MyPid());
    V(condSems[cv]);
    P(urgentSem);
  }
}
开发者ID:AngryShrimp,项目名称:CMPT332,代码行数:14,代码来源:Monitor.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ ListBox_AddString函数代码示例发布时间:2022-05-30
下一篇:
C++ List函数代码示例发布时间: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