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


C++ LIST函数代码示例

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


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

示例1: clrCgsFonts

/*
 * Discard all of the font information, e.g., we are resizing the font.
 * Keep the GC's so we can simply change them rather than creating new ones.
 */
void
clrCgsFonts(XtermWidget xw, VTwin *cgsWin, XTermFonts * font)
{
    CgsCache *me;
    int j, k;

    if (HaveFont(font)) {
        for_each_gc(j) {
            if ((me = myCache(xw, cgsWin, (CgsEnum) j)) != 0) {
                for (k = 0; k < DEPTH; ++k) {
                    if (SameFont(LIST(k).font, font)) {
                        TRACE2(("clrCgsFonts %s gc %p(%d) %s\n",
                                traceCgsEnum((CgsEnum) j),
                                LIST(k).gc,
                                k,
                                traceFont(font)));
                        LIST(k).font = 0;
                        LIST(k).cset = 0;
                    }
                }
                if (SameFont(NEXT(font), font)) {
                    TRACE2(("clrCgsFonts %s next %s\n",
                            traceCgsEnum((CgsEnum) j),
                            traceFont(font)));
                    NEXT(font) = 0;
                    NEXT(cset) = 0;
                    me->mask &= (unsigned) ~(GCFont | GC_CSet);
                }
            }
        }
    }
}
开发者ID:jcvernaleo,项目名称:bitrig-xenocara,代码行数:36,代码来源:cachedGCs.c

示例2: font_drop_one

void    font_drop_one(DviFontRef *ref)
{
    DviFont *font;
    
    font = ref->ref;
    mdvi_free(ref);
    /* drop all children */
    for(ref = font->subfonts; ref; ref = ref->next) {
        /* just adjust the reference counts */
        ref->ref->links--;
    }
    if(--font->links == 0) {
        /* 
         * this font doesn't have any more references, but
         * we still keep it around in case a virtual font
         * requests it.
         */
        if(font->in) {
            fclose(font->in);
            font->in = NULL;
        }
        if(LIST(font) != fontlist.tail) {
            /* move it to the end of the list */
            listh_remove(&fontlist, LIST(font));
            listh_append(&fontlist, LIST(font));
        }
    }
    DEBUG((DBG_FONTS, "%s: reference dropped, %d more left\n",
        font->fontname, font->links));
}
开发者ID:yourealwaysbe,项目名称:zathura-dvi-mdvi,代码行数:30,代码来源:font.c

示例3: _audit_activity

/*
 * la_activity() caller.  Traverse through all audit libraries and call any
 * la_activity() entry points found.
 */
static void
_audit_activity(APlist *list, Rt_map *clmp, uint_t flags, Boolean client)
{
	Audit_list	*alp;
	Aliste		idx;
	Lm_list		*clml = LIST(clmp);

	for (APLIST_TRAVERSE(list, idx, alp)) {
		Audit_client	*acp;
		Rt_map		*almp = alp->al_lmp;
		Lm_list		*alml = LIST(almp);
		uintptr_t	*cookie;

		if (alp->al_activity == 0)
			continue;

		/*
		 * Determine what cookie is required.  Any auditing that
		 * originates from the object that heads the link-map list has
		 * its own cookie.  Local auditors must obtain the cookie that
		 * represents the object that heads the link-map list.
		 */
		if (client)
			acp = _audit_client(AUDINFO(clmp), almp);
		else
			acp = _audit_get_head_client(clml->lm_head, almp);

		if (acp == NULL)
			continue;
		cookie = &(acp->ac_cookie);

		/*
		 * Make sure the audit library only sees one addition/deletion
		 * at a time.  This ensures the library doesn't see numerous
		 * events from lazy loading a series of libraries.  Keep track
		 * of this caller having called an auditor, so that the
		 * appropriate "consistent" event can be supplied on leaving
		 * ld.so.1.
		 */
		if ((flags == LA_ACT_ADD) || (flags == LA_ACT_DELETE)) {
			if (alml->lm_flags & LML_FLG_AUDITNOTIFY)
				continue;

			alml->lm_flags |= LML_FLG_AUDITNOTIFY;
			clml->lm_flags |= LML_FLG_ACTAUDIT;
		} else {
			if ((alml->lm_flags & LML_FLG_AUDITNOTIFY) == 0)
				continue;

			alml->lm_flags &= ~LML_FLG_AUDITNOTIFY;
		}

		DBG_CALL(Dbg_audit_activity(clml, alp->al_libname,
		    NAME(clml->lm_head), flags));

		leave(alml, thr_flg_reenter);
		(*alp->al_activity)(cookie, flags);
		(void) enter(thr_flg_reenter);
	}
}
开发者ID:AlainODea,项目名称:illumos-gate,代码行数:64,代码来源:audit.c

示例4: _audit_objopen

/*
 * la_objopen() caller.  Create an audit information structure for the indicated
 * link-map, regardless of an la_objopen() entry point.  This structure is used
 * to supply information to various audit interfaces (see LML_MSK_AUDINFO).
 * Traverses through all audit library and calls any la_objopen() entry points
 * found.
 */
static int
_audit_objopen(List *list, Rt_map *nlmp, Lmid_t lmid, Audit_info *aip,
    int *ndx)
{
	Audit_list	*alp;
	Listnode	*lnp;

	for (LIST_TRAVERSE(list, lnp, alp)) {
		uint_t		flags;
		Audit_client	*acp;

		/*
		 * Associate a cookie with the audit library, and assign the
		 * initial cookie as the present link-map.
		 */
		acp = &aip->ai_clients[(*ndx)++];
		acp->ac_lmp = alp->al_lmp;
		acp->ac_cookie = (uintptr_t)nlmp;

		if (alp->al_objopen == 0)
			continue;

		DBG_CALL(Dbg_audit_object(LIST(alp->al_lmp), alp->al_libname,
		    NAME(nlmp)));

		leave(LIST(alp->al_lmp));
		flags = (*alp->al_objopen)((Link_map *)nlmp, lmid,
			&(acp->ac_cookie));
		(void) enter();

		if (flags & LA_FLG_BINDTO)
			acp->ac_flags |= FLG_AC_BINDTO;

		if (flags & LA_FLG_BINDFROM) {
			ulong_t		pltcnt;

			acp->ac_flags |= FLG_AC_BINDFROM;
			/*
			 * We only need dynamic plt's if a pltenter and/or a
			 * pltexit() entry point exist in one of our auditing
			 * libraries.
			 */
			if (aip->ai_dynplts || (JMPREL(nlmp) == 0) ||
			    ((audit_flags & (AF_PLTENTER | AF_PLTEXIT)) == 0))
				continue;

			/*
			 * Create one dynplt for every 'PLT' that exists in the
			 * object.
			 */
			pltcnt = PLTRELSZ(nlmp) / RELENT(nlmp);
			if ((aip->ai_dynplts = calloc(pltcnt,
			    dyn_plt_ent_size)) == 0)
				return (0);
		}
	}
	return (1);
}
开发者ID:andreiw,项目名称:polaris,代码行数:65,代码来源:audit.c

示例5: LIS2

//---------------------------------------------------------------------------
void File_Ibi::Data_Parse()
{
    #define LIS2(_ATOM, _NAME) \
        case Elements::_ATOM : \
                if (Level==Element_Level) \
                { \
                    Element_Name(_NAME); \
                    _ATOM(); \
                    Element_ThisIsAList(); \
                } \

    #define ATO2(_ATOM, _NAME) \
                case Elements::_ATOM : \
                        if (Level==Element_Level) \
                        { \
                            if (Element_IsComplete_Get()) \
                            { \
                                Element_Name(_NAME); \
                                _ATOM(); \
                            } \
                            else \
                            { \
                                Element_WaitForMoreData(); \
                                return; \
                            } \
                        } \
                        break; \

    #define ATOM_END_MK \
        ATOM(Zero) \
        ATOM(CRC32) \
        ATOM(Void) \
        ATOM_END

    //Parsing
    DATA_BEGIN
    LIST(Ebml)
        ATOM_BEGIN
        ATOM(Ebml_Version)
        ATOM(Ebml_ReadVersion)
        ATOM(Ebml_MaxIDLength)
        ATOM(Ebml_MaxSizeLength)
        ATOM(Ebml_DocType)
        ATOM(Ebml_DocTypeVersion)
        ATOM(Ebml_DocTypeReadVersion)
        ATOM_END_MK
    LIST(Stream)
        ATOM_BEGIN
            ATOM(Stream_Header)
            ATOM(Stream_ByteOffset)
            ATOM(Stream_FrameNumber)
            ATOM(Stream_Dts)
        ATOM_END_MK
    ATOM(CompressedIndex)
    DATA_DEFAULT
        Finish("Ibi");
    DATA_END_DEFAULT
}
开发者ID:thespooler,项目名称:mediainfo-code,代码行数:59,代码来源:File_Ibi.cpp

示例6: LIST

//////////////////////////////////////////////////////////////////////////////
// Get all the ref constraints from this NATable, filter the ones that are to
// tables in this graph, and mark them on both tables. For example, use the
// RI on Orderes and Customers: O->C ( O is referencing C ). Because of the 
// semantics of the order of the tables in the join graph, in order for RI
// optimization to be utilized, C must appear in the graph solution AFTER O.
// The result is that C has an incoming bit for table O, and O has an 
// outgoing bit for table C.
// Other conditions that must be met for the RI to be usable:
// 1. C must have non-empty, insert only delta.
// 2. O must not be inner tables of left joins.
// 3. Each of the columns of the RI constraint must be covered by a predicate.
//    So if O(a,b) is referencing C(x,y) the join should use these two equal 
//    predicates: (O.a = C.x) AND (O.b = C.y).
// In this method, this table is O, and otherTable is C.
Lng32 MVJoinTable::markRiConstraints(BindWA *bindWA, MVInfo *mvInfo)
{
  LIST (MVUsedObjectInfo*)& usedObjects = mvInfo->getUsedObjectsList();
  if (usedObjects[tableIndex_]->isInnerTableOfLeftJoin())
    return 0;	// O must not be inner table of a left join.

  Lng32 howManyRIs=0;
  const AbstractRIConstraintList& refConstraints = 
    naTable_->getRefConstraints();

  for (CollIndex i=0; i<refConstraints.entries(); i++)
  {
    RefConstraint *const ref = (RefConstraint *const)(refConstraints[i]);
    CMPASSERT(ref->getOperatorType() == ITM_REF_CONSTRAINT);
    // Ignore self referencing RIs.
    if (ref->selfRef())
      continue;

    // Find the table the RI is referencing.
    const NAString& otherTableName = 
      ref->getOtherTableName().getQualifiedNameAsString();
    MVJoinTable *otherTable =
      mvInfo->getJoinGraph()->getTableObjectFor(&otherTableName);
    if (otherTable == NULL)
      continue;	 // The other table must be on the graph.

    if (otherTable->deltaType_ != INSERTONLY_DELTA)
      continue;  // C must be insert only.

    Lng32 otherTableIndex = otherTable->getTableIndex();

    // The RI must be covered by equal predicates on the same columns
    LIST(Lng32) myCols;
    LIST(Lng32) otherCols;
    ref->getMyKeyColumns(myCols);
    ref->getOtherTableKeyColumns(bindWA, otherCols);
    CMPASSERT(myCols.entries() == otherCols.entries());

    NABoolean matchingPredicatesExist=TRUE;
    for (CollIndex currentCol=0; currentCol<myCols.entries(); currentCol++)
    {
      if (!mvInfo->isEqPredicateBetween(naTable_->getTableName(),
					myCols[currentCol],
					ref->getOtherTableName(),
					otherCols[currentCol]))
	matchingPredicatesExist = FALSE;
    }
    if (!matchingPredicatesExist)
      continue;

    // OK - we found a qualifying RI that we can use for optimization.
    // Now mark the bits.
    markRiTo(otherTableIndex);
    otherTable->markRiFrom(getTableIndex());
    howManyRIs++;
  }
  return howManyRIs;
}	
开发者ID:RuoYuHP,项目名称:incubator-trafodion,代码行数:73,代码来源:MVJoinGraph.cpp

示例7: dummy_proc_

// -----------------------------------------------------------------------
// For those templates that are just used in .C files or that are used
// in header files not sourced into this file, make a dummy variable and
// force the instantiation system to instantiate it here.
// NOTE: we expect this file to be compiled with the -ptf -pta flags.
// NOTE: this file is designed for cfront-based compilers; it may not
// work in other environments, like c89.
// -----------------------------------------------------------------------
static void dummy_proc_()
{

  LIST(ExprNode *)		dummy01_;  // see DisplayTree.C
  LIST(NAString)		dummy18_;  // see DisplayTree.C
  LIST(ItemExpr *)		dummy19_;  // see SimpleParser.y
  LIST(RelExpr *)               dummy20_;  // see memo.C
  LIST(CollIndex)               dummy21_;  // see ColStatDesc.C
  LIST(NAType *)                dummy22_;  // see generator/GenKey.C
  NAList<ControlTableOptions*>  dummy33_;
}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:19,代码来源:Sqlci_templ.cpp

示例8: TCOD_list_duplicate

TCOD_list_t TCOD_list_duplicate(TCOD_list_t l) {
	int i=0;
	void **t;
	TCOD_list_int_t *ret=(TCOD_list_int_t *)TCOD_list_new();
	while ( ret->allocSize < LIST(l)->allocSize ) TCOD_list_allocate_int((TCOD_list_t)ret);
	ret->fillSize=LIST(l)->fillSize;
	for (t=TCOD_list_begin(l); t != TCOD_list_end(l); t++) {
		ret->array[i++]=*t;
	}
	return (TCOD_list_t)ret;
}
开发者ID:Beliaar,项目名称:DCPUToolchain,代码行数:11,代码来源:list_c.c

示例9: font_reference

/* used from context: params and device */
DviFontRef *
font_reference(
    DviParams *params,     /* rendering parameters */
    Int32 id,         /* external id number */
    const char *name,     /* font name */
    Int32 sum,         /* checksum (from DVI of VF) */
    int hdpi,         /* resolution */
    int vdpi,
    Int32 scale)        /* scaling factor (from DVI or VF) */
{
    DviFont    *font;
    DviFontRef *ref;
    DviFontRef *subfont_ref;
    
    /* see if there is a font with the same characteristics */
    for(font = (DviFont *)fontlist.head; font; font = font->next) {
        if(strcmp(name, font->fontname) == 0
           && (!sum || !font->checksum || font->checksum == sum)
           && font->hdpi == hdpi
           && font->vdpi == vdpi
           && font->scale == scale)
               break;
    }
    /* try to load the font */
    if(font == NULL) {
        font = mdvi_add_font(name, sum, hdpi, vdpi, scale);
        if(font == NULL)
            return NULL;
        listh_append(&fontlist, LIST(font));
    }
    if(!font->links && !font->chars && load_font_file(params, font) < 0) {
        DEBUG((DBG_FONTS, "font_reference(%s) -> Error\n", name));
        return NULL;
    }
    ref = xalloc(DviFontRef);
    ref->ref = font;

    font->links++;
    for(subfont_ref = font->subfonts; subfont_ref; subfont_ref = subfont_ref->next) {
        /* just adjust the reference counts */
        subfont_ref->ref->links++;
    }

    ref->fontid = id;

    if(LIST(font) != fontlist.head) {
        listh_remove(&fontlist, LIST(font));
        listh_prepend(&fontlist, LIST(font));
    }

    DEBUG((DBG_FONTS, "font_reference(%s) -> %d links\n",
        font->fontname, font->links));
    return ref;
}
开发者ID:yourealwaysbe,项目名称:zathura-dvi-mdvi,代码行数:55,代码来源:font.c

示例10: SAC_list_push_front

void* SAC_list_push_front(SAC_List list, SAC_MPool mpool, void *obj) {
  struct _SAC_ListItem *item;

  item = SAC_list_item_alloc(mpool, obj);

  if (item == NULL) return NULL;

  item->next = LIST(list)->head->next;
  LIST(list)->head->next = item;
  ++LIST(list)->size;
  return obj;
}
开发者ID:VasilyStepanov,项目名称:libsacc,代码行数:12,代码来源:list.c

示例11: SAC_list_push_back

void* SAC_list_push_back(SAC_List list, SAC_MPool mpool, void *obj) {
  struct _SAC_ListItem *item;

  item = SAC_list_item_alloc(mpool, obj);
  
  if (item == NULL) return NULL;

  LIST(list)->tail->next = item;
  LIST(list)->tail = item;
  ++LIST(list)->size;
  return obj;
}
开发者ID:VasilyStepanov,项目名称:libsacc,代码行数:12,代码来源:list.c

示例12: echoListAdd

void
echoListAdd(echoObject *list, echoObject *child) {
  int idx;
  
  if (!( list && child &&
         (echoTypeList == list->type ||
          echoTypeAABBox == list->type) ))
    return;
  
  idx = airArrayLenIncr(LIST(list)->objArr, 1);
  LIST(list)->obj[idx] = child;

  return;
}
开发者ID:ryanfb,项目名称:teem-parallel,代码行数:14,代码来源:list.c

示例13: compute_ldf

value compute_ldf(variable *v, value **data, size_t users, size_t days) {

	value w;

	if (list_size(LIST(v->agents)) == 1)
		w = 1;
	else {
		value *num_maxes = calloc(users, sizeof(value));
		value num_sum = 0;
		value den_sum;
		value den_max = 0;
		size_t id, t;

		for (t = 0; t < days * SLOTS_PER_DAY; t++) {

			den_sum = 0;

			agent_list *agents = v->agents;

			while (agents) {

				id = agents->a->id;

				if (data[id][t] > num_maxes[id]) {
					num_sum += data[id][t] - num_maxes[id];
					num_maxes[id] = data[id][t];
				}

				den_sum += data[id][t];
				agents = agents->n;
			}

			den_max = den_sum > den_max ? den_sum : den_max;
		}

		free(num_maxes);
		w = num_sum / den_max + list_size(LIST(v->agents)) - 1;
	}

#if WORTH_MESSAGES > 0
	char *str = variable_to_string(v);
	printf("\033[1;37m[INFO] W(%s) = %f\033[m\n", str, w);
	free(str);
#endif

	v->w = w;
	return w;
}
开发者ID:filippobistaffa,项目名称:SCFC,代码行数:48,代码来源:worth.c

示例14: TCOD_list_clear_and_delete

void TCOD_list_clear_and_delete(TCOD_list_t l) {
	void **curElt;
	for ( curElt = TCOD_list_begin(l); curElt != TCOD_list_end(l); curElt ++ ) {
		free(*curElt);
	}
	LIST(l)->fillSize=0;
}
开发者ID:Beliaar,项目名称:DCPUToolchain,代码行数:7,代码来源:list_c.c

示例15: get_mdh4trg

GSList *
get_mdh4trg(	t_obj *	trg_obj,		 /* The trigger object	      */
                t_obj *	par_obj)		 /* The hook parent object    */
/*
 * This is effectively a reverse lookup, called by a trigger to find the
 * hook for the trigger and parent object. It's used for output triggers -
 * internal routines that want to call a hook to output something.
 */
{
    GSList *	list = NULL;		 /* List of MIDI hooks	      */
    GSList *	node;			 /* Node in triggers list     */

    if(!midihooks)
        return NULL;

    for(	node = LIST(midihooks);		 /* Start of triggers list    */
            node;
            node = node->next)
    {
        if(	(MDH(node->data)->par_obj == par_obj) &&
                (trg_obj == MDH(node->data)->trg_obj) &&
                (MDH(node->data)->dis & HOOK_OP_ENABLED))
            list = g_slist_append(list, node->data);
    }

    return list;
}						 /* get_mdh4trg()	      */
开发者ID:Prichy,项目名称:SoundDesk,代码行数:27,代码来源:midi_hooks.c


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