本文整理汇总了C++中slist_add函数的典型用法代码示例。如果您正苦于以下问题:C++ slist_add函数的具体用法?C++ slist_add怎么用?C++ slist_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了slist_add函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: pppoed_pppoe_session_close_notify
/* it called when the PPPoE session was closed */
void
pppoed_pppoe_session_close_notify(pppoed *_this, pppoe_session *session)
{
slist_add(&_this->session_free_list,
(void *)(intptr_t)session->session_id);
if (_this->acookie_hash != NULL)
hash_delete(_this->acookie_hash,
(void *)(intptr_t)session->acookie, 0);
if (_this->session_hash != NULL)
hash_delete(_this->session_hash,
(void *)(intptr_t)session->session_id, 0);
pppoe_session_fini(session);
free(session);
}
开发者ID:marctmiller,项目名称:bitrig,代码行数:17,代码来源:pppoed.c
示例2: save_addr_port
int save_addr_port(struct netscan_result *result, unsigned int addr, unsigned short port)
{
struct addr_port *save = NULL;
save = (struct addr_port *)malloc(sizeof(struct addr_port));
if(!save)
return -1;
save->addr = addr;
save->port = port;
INIT_SLIST_NODE(&save->slist);
pthread_mutex_lock(&(result->list_lock));
slist_add(&result->addr_port_list, &save->slist);
++result->num;
pthread_mutex_unlock(&(result->list_lock));
return 0;
}
开发者ID:program-fans,项目名称:shiyan,代码行数:16,代码来源:netscan.c
示例3: fake_classsym
Symbol *AggregateDeclaration::toInitializer()
{
if (!sinit)
{
Classsym *stag = fake_classsym(Id::ClassInfo);
Symbol *s = toSymbolX("__init", SCextern, stag->Stype, "Z");
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
StructDeclaration *sd = isStructDeclaration();
if (sd)
s->Salignment = sd->alignment;
slist_add(s);
sinit = s;
}
return sinit;
}
开发者ID:OpenFlex,项目名称:dmd,代码行数:16,代码来源:tocsym.c
示例4: visit
void visit(ClassDeclaration *cd)
{
if (!cd->csym)
{
if (!scc)
scc = fake_classsym(Id::ClassInfo);
Symbol *s = cd->toSymbolX("__Class", SCextern, scc->Stype, "Z");
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
cd->csym = s;
slist_add(s);
}
result = cd->csym;
}
开发者ID:AlbertLkn,项目名称:dmd,代码行数:16,代码来源:tocsym.c
示例5: fake_classsym
Symbol *TypedefDeclaration::toInitializer()
{
Symbol *s;
Classsym *stag;
if (!sinit)
{
stag = fake_classsym(Id::ClassInfo);
s = toSymbolX("__init", SCextern, stag->Stype, "Z");
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
slist_add(s);
sinit = s;
}
return sinit;
}
开发者ID:Govelius,项目名称:dmd,代码行数:16,代码来源:tocsym.c
示例6: visit
void visit(InterfaceDeclaration *id)
{
if (!id->csym)
{
if (!scc)
scc = fake_classsym(Id::ClassInfo);
Symbol *s = toSymbolX(id, "__Interface", SCextern, scc->Stype, "Z");
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
id->csym = s;
slist_add(s);
}
result = id->csym;
}
开发者ID:Arpit007,项目名称:dmd,代码行数:16,代码来源:tocsym.c
示例7: check_dependencies
/* all jobs must have successors except the end job, and all jobs must have predeccessors except the start job */
int check_dependencies(struct rcps_problem *p) {
int result = RCPS_CHECK_OK;
int end_count = 0;
int i, k;
struct rcps_job *start_job;
struct slist *visited;
struct slist *has_predecessor = slist_new(job_compare);
for (i = 0; i < p->job_count; ++i) {
struct rcps_job *j = p->jobs[ i ];
//printf("check_dependencies: job %s successors: %i\n", j->name, j->successor_count);
if (j->successor_count == 0) {
++end_count;
} else {
for (k = 0; k < j->successor_count; ++k) {
//printf("check_dependencies: job %s successor[%i] = %s\n", j->name, k, j->successors[k]->name);
slist_add(has_predecessor, slist_node_new(j->successors[k]));
}
}
}
if (end_count > 1) {
result += RCPS_CHECK_MULTIPLE_END_JOBS;
} else if (end_count == 0) {
result += RCPS_CHECK_END_JOB_MISSING;
}
if (result == RCPS_CHECK_OK) {
start_job = 0;
for (i = 0; i < p->job_count; ++i) {
if (!slist_find(has_predecessor, p->jobs[i])) {
start_job = p->jobs[i];
}
}
if (start_job) {
/* All other jobs should be successors of the start job */
//printf("check_dependencies: check circular\n");
visited = slist_new(job_compare);
result += check_circulardependencies(start_job, visited);
slist_free(visited, NULL);
} else {
result += RCPS_CHECK_START_JOB_MISSING;
}
}
slist_free(has_predecessor, NULL);
//printf("check_dependencies: result=%i\n", result);
return result;
}
开发者ID:KDE,项目名称:calligra,代码行数:48,代码来源:librcps.c
示例8: fake_classsym
Symbol *toInitializer(EnumDeclaration *ed)
{
if (!ed->sinit)
{
Classsym *stag = fake_classsym(Id::ClassInfo);
Identifier *ident_save = ed->ident;
if (!ed->ident)
ed->ident = Identifier::generateId("__enum");
Symbol *s = toSymbolX(ed, "__init", SCextern, stag->Stype, "Z");
ed->ident = ident_save;
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
slist_add(s);
ed->sinit = s;
}
return ed->sinit;
}
开发者ID:Arpit007,项目名称:dmd,代码行数:17,代码来源:tocsym.c
示例9: fake_classsym
Symbol *ClassDeclaration::toSymbol()
{
if (!csym)
{
Symbol *s;
if (!scc)
scc = fake_classsym(Id::ClassInfo);
s = toSymbolX("__Class", SCextern, scc->Stype, "Z");
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
csym = s;
slist_add(s);
}
return csym;
}
开发者ID:andralex,项目名称:dmd,代码行数:17,代码来源:tocsym.c
示例10: toSymbol
Symbol *toVtblSymbol(ClassDeclaration *cd)
{
if (!cd->vtblsym)
{
if (!cd->csym)
toSymbol(cd);
TYPE *t = type_allocn(TYnptr | mTYconst, tsvoid);
t->Tmangle = mTYman_d;
Symbol *s = toSymbolX(cd, "__vtbl", SCextern, t, "Z");
s->Sflags |= SFLnodebug;
s->Sfl = FLextern;
cd->vtblsym = s;
slist_add(s);
}
return cd->vtblsym;
}
开发者ID:Arpit007,项目名称:dmd,代码行数:17,代码来源:tocsym.c
示例11: fake_classsym
Symbol *InterfaceDeclaration::toSymbol()
{
if (!csym)
{
Symbol *s;
if (!scc)
scc = fake_classsym("ClassInfo");
s = toSymbolX("_Interface_", SCextern, scc->Stype);
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
csym = s;
slist_add(s);
}
return csym;
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:17,代码来源:tocsym.c
示例12: symbol_calloc
type *TypeClass::toCtype()
{ type *t;
Symbol *s;
//printf("TypeClass::toCtype() %s\n", toChars());
if (ctype)
return ctype;
/* Need this symbol to do C++ name mangling
*/
const char *name = sym->isCPPinterface() ? sym->ident->toChars()
: sym->toPrettyChars();
s = symbol_calloc(name);
s->Sclass = SCstruct;
s->Sstruct = struct_calloc();
s->Sstruct->Sflags |= STRclass;
s->Sstruct->Salignsize = sym->alignsize;
s->Sstruct->Sstructalign = sym->structalign;
s->Sstruct->Sstructsize = sym->structsize;
t = type_alloc(TYstruct);
t->Ttag = (Classsym *)s; // structure tag name
t->Tcount++;
s->Stype = t;
slist_add(s);
t = type_allocn(TYnptr, t);
t->Tcount++;
ctype = t;
/* Add in fields of the class
* (after setting ctype to avoid infinite recursion)
*/
if (global.params.symdebug)
for (int i = 0; i < sym->fields.dim; i++)
{ VarDeclaration *v = sym->fields.tdata()[i];
Symbol *s2 = symbol_name(v->ident->toChars(), SCmember, v->type->toCtype());
s2->Smemoff = v->offset;
list_append(&s->Sstruct->Sfldlst, s2);
}
return t;
}
开发者ID:ZHANITEST,项目名称:pspemu,代码行数:45,代码来源:toctype.c
示例13: type_alloc
Symbol* ClassReferenceExp::toSymbol()
{
if (value->sym) return value->sym;
TYPE *t = type_alloc(TYint);
t->Tcount++;
Symbol *s = symbol_calloc("internal");
s->Sclass = SCstatic;
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
s->Stype = t;
value->sym = s;
dt_t *d = NULL;
toInstanceDt(&d);
s->Sdt = d;
slist_add(s);
outdata(s);
return value->sym;
}
开发者ID:andralex,项目名称:dmd,代码行数:18,代码来源:tocsym.c
示例14: freq_recv
int freq_recv(char *fn)
{
FILE *f;
char s[MAX_PATH],*p;
slist_t *reqs=NULL;
f=fopen(fn,"rt");
if(!f){write_log("can't open '%s' for reading: %s",fn,strerror(errno));return 0;}
while(fgets(s,MAX_PATH-1,f)) {
p=s+strlen(s)-1;
while(*p=='\r'||*p=='\n')*p--=0;
slist_add(&reqs,s);
}
fclose(f);
freq_ifextrp(reqs);
slist_kill(&reqs);
got_req=1;
return 1;
}
开发者ID:ftnapps,项目名称:qico,代码行数:18,代码来源:freq.c
示例15: type_alloc
Symbol *static_sym()
{
Symbol *s;
type *t;
t = type_alloc(TYint);
t->Tcount++;
s = symbol_calloc("internal");
s->Sclass = SCstatic;
s->Sfl = FLextern;
s->Sflags |= SFLnodebug;
s->Stype = t;
#if ELFOBJ // Burton
s->Sseg = DATA;
#endif /* ELFOBJ */
slist_add(s);
return s;
}
开发者ID:MrPhil,项目名称:ShortHike,代码行数:18,代码来源:tocsym.c
示例16: type_alloc
Symbol *Module::toModuleUnittest()
{
if (!munittest)
{
type *t;
t = type_alloc(TYjfunc);
t->Tflags |= TFprototype | TFfixed;
t->Tmangle = mTYman_d;
t->Tnext = tsvoid;
tsvoid->Tcount++;
munittest = toSymbolX("__unittest_fail", SCextern, t, "FiZv");
munittest->Sfl = FLextern;
munittest->Sflags |= SFLnodebug;
slist_add(munittest);
}
return munittest;
}
开发者ID:Govelius,项目名称:dmd,代码行数:19,代码来源:tocsym.c
示例17: assert
Symbol *aaGetSymbol(TypeAArray *taa, const char *func, int flags)
{
#ifdef DEBUG
assert((flags & ~1) == 0);
#endif
// Dumb linear symbol table - should use associative array!
static Symbols *sarray = NULL;
//printf("aaGetSymbol(func = '%s', flags = %d, key = %p)\n", func, flags, key);
char *id = (char *)alloca(3 + strlen(func) + 1);
sprintf(id, "_aa%s", func);
if (!sarray)
sarray = Symbols_create();
// See if symbol is already in sarray
for (size_t i = 0; i < sarray->dim; i++)
{
Symbol *s = (*sarray)[i];
if (strcmp(id, s->Sident) == 0)
{
#ifdef DEBUG
assert(s);
#endif
return s; // use existing Symbol
}
}
// Create new Symbol
Symbol *s = symbol_calloc(id);
slist_add(s);
s->Sclass = SCextern;
s->Ssymnum = -1;
symbol_func(s);
type *t = type_function(TYnfunc, NULL, 0, false, Type_toCtype(taa->next));
t->Tmangle = mTYman_c;
s->Stype = t;
sarray->push(s); // remember it
return s;
}
开发者ID:Arpit007,项目名称:dmd,代码行数:43,代码来源:tocsym.c
示例18: main
int main()
{
struct node_info *phead = NULL;
struct node_info s[] = {
{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8},
};
int i;
for (i = 0; i < N_ELEMT(s); ++i) {
slist_add( &phead, s + i);
}
slist_for_each(phead);
return 0;
}
开发者ID:Shimejing,项目名称:demo_class,代码行数:19,代码来源:03nohead_noloop_slist.c
示例19: type_alloc
Symbol *Module::toModuleAssert()
{
if (!massert)
{
type *t;
t = type_alloc(TYjfunc);
t->Tflags |= TFprototype | TFfixed;
t->Tmangle = mTYman_d;
t->Tnext = tsvoid;
tsvoid->Tcount++;
massert = toSymbolX("__assert", SCextern, t, "FiZv");
massert->Sfl = FLextern;
massert->Sflags |= SFLnodebug;
slist_add(massert);
}
return massert;
}
开发者ID:DinrusGroup,项目名称:DRC,代码行数:19,代码来源:tocsym.c
示例20: scalloc
NickAlias *makenick(const char *nick)
{
NickAlias *na;
NickCore *nc;
/* First make the core */
nc = scalloc(1, sizeof(NickCore));
nc->display = sstrdup(nick);
slist_init(&nc->aliases);
insert_core(nc);
alog("%s: group %s has been created", s_NickServ, nc->display);
/* Then make the alias */
na = scalloc(1, sizeof(NickAlias));
na->nick = sstrdup(nick);
na->nc = nc;
slist_add(&nc->aliases, na);
alpha_insert_alias(na);
return na;
}
开发者ID:GeekShed,项目名称:anope-modules,代码行数:20,代码来源:ns_saregister.c
注:本文中的slist_add函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论