本文整理汇总了C++中dynarray_add函数的典型用法代码示例。如果您正苦于以下问题:C++ dynarray_add函数的具体用法?C++ dynarray_add怎么用?C++ dynarray_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dynarray_add函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: dynarray_assoc
static struct import_symbol *pe_add_import(struct pe_info *pe, int sym_index) {
int i;
int dll_index;
struct pe_import_info *p;
struct import_symbol *s;
dll_index = ((Elf32_Sym *) pe->s1->dynsymtab_section->data + sym_index)->st_value;
if (dll_index == 0) return NULL;
i = dynarray_assoc((void **) pe->imp_info, pe->imp_count, dll_index);
if (i != -1) {
p = pe->imp_info[i];
goto found_dll;
}
p = tcc_mallocz(sizeof *p);
p->dll_index = dll_index;
dynarray_add((void ***) &pe->imp_info, &pe->imp_count, p);
found_dll:
i = dynarray_assoc((void **) p->symbols, p->sym_count, sym_index);
if (i != -1) return p->symbols[i];
s = tcc_mallocz(sizeof *s);
dynarray_add((void ***) &p->symbols, &p->sym_count, s);
s->sym_index = sym_index;
return s;
}
开发者ID:HarryR,项目名称:sanos,代码行数:27,代码来源:pe.c
示例2: out_blk_mustgen
void out_blk_mustgen(out_ctx *octx, out_blk *blk, char *force_lbl)
{
if(force_lbl)
blk->force_lbl = force_lbl;
dynarray_add(&octx->mustgen, blk);
}
开发者ID:bobrippling,项目名称:ucc-c-compiler,代码行数:7,代码来源:blk.c
示例3: av_mallocz
static struct variant *new_variant(struct list_mgt *mgt, int bandwidth, const char *url, const char *base)
{
struct variant *var = av_mallocz(sizeof(struct variant));
if (!var)
return NULL;
var->bandwidth = bandwidth;
char* ptr = NULL;
int has_prefix = 0;
if(!av_strstart(url,"https://",ptr)) {
if(base!=NULL&&av_strstart(base,"https://",ptr)) { //change to shttps for using android streaming framework.
snprintf(var->url,1,"s");
has_prefix = 1;
}
if(has_prefix>0) {
ff_make_absolute_url(var->url+1, sizeof(var->url)-1, base, url);
} else {
ff_make_absolute_url(var->url, sizeof(var->url), base, url);
}
} else { //change to shttps for using android streaming framework.
snprintf(var->url,sizeof(var->url),"s%s",url);
}
//av_log(NULL,AV_LOG_INFO,"returl=%s\nbase=%s\nurl=%s\n",var->url,base,url);
dynarray_add(&mgt->variants, &mgt->n_variants, var);
return var;
}
开发者ID:Pivosgroup,项目名称:buildroot-linux,代码行数:26,代码来源:m3u.c
示例4: st_en_set_spel
enum_st *enum_add( enum_st ***ens, char *spel, enum_st *en)
{
st_en_set_spel(&en->spel, spel, "enum");
dynarray_add((void ***)ens, en);
return en;
}
开发者ID:mtexier,项目名称:ucc,代码行数:7,代码来源:enum.c
示例5: RTADVSocketCreate
PRIVATE_EXTERN RTADVSocketRef
RTADVSocketCreate(interface_t * if_p)
{
RTADVSocketRef sock;
RTADVSocketGlobalsRef globals;
globals = RTADVSocketGetGlobals();
if (globals == NULL) {
my_log(LOG_NOTICE, "RTADVSocketCreate: could not allocate globals");
return (NULL);
}
sock = RTADVSocketFind(if_link_index(if_p));
if (sock != NULL) {
my_log(LOG_NOTICE, "RTADVSocketCreate(%s): socket already allocated",
if_name(if_p));
return (NULL);
}
sock = malloc(sizeof(*sock));
if (sock == NULL) {
return (NULL);
}
bzero(sock, sizeof(*sock));
if (dynarray_add(&globals->sockets, sock) == FALSE) {
free(sock);
return (NULL);
}
sock->if_p = if_p;
return (sock);
}
开发者ID:carriercomm,项目名称:osx-2,代码行数:29,代码来源:RTADVSocket.c
示例6: tkword_direct_insert
/**operator */
TkWord * tkword_direct_insert(TkWord *tp){
int keyno;
dynarray_add(&tktable,tp);
keyno = elf_hash(tp->spelling);
tp->next = tk_hashtable[keyno];
tk_hashtable[keyno] = tp;
return tp;
}
开发者ID:bingone,项目名称:my_compiler,代码行数:9,代码来源:TkWord.cpp
示例7: new_playlist
static struct variant *new_variant(HLSContext *c, int bandwidth,
const char *url, const char *base)
{
struct variant *var;
struct playlist *pls;
pls = new_playlist(c, url, base);
if (!pls)
return NULL;
var = av_mallocz(sizeof(struct variant));
if (!var)
return NULL;
var->bandwidth = bandwidth;
dynarray_add(&c->variants, &c->n_variants, var);
dynarray_add(&var->playlists, &var->n_playlists, pls);
return var;
}
开发者ID:18565773346,项目名称:android-h264-decoder,代码行数:19,代码来源:hls.c
示例8: enum_vals_add
void enum_vals_add(enum_st *en, char *sp, expr *e)
{
enum_member *mem = umalloc(sizeof *mem);
if(!e)
e = (expr *)-1;
mem->spel = sp;
mem->val = e;
dynarray_add((void ***)&en->members, mem);
}
开发者ID:mtexier,项目名称:ucc,代码行数:11,代码来源:enum.c
示例9: av_mallocz
static struct playlist *new_playlist(HLSContext *c, const char *url,
const char *base)
{
struct playlist *pls = av_mallocz(sizeof(struct playlist));
if (!pls)
return NULL;
reset_packet(&pls->pkt);
ff_make_absolute_url(pls->url, sizeof(pls->url), base, url);
dynarray_add(&c->playlists, &c->n_playlists, pls);
return pls;
}
开发者ID:18565773346,项目名称:android-h264-decoder,代码行数:11,代码来源:hls.c
示例10: new_active_thread
static int new_active_thread(thread_list_t *act_th, pthread_t *th)
{
pthread_mutex_lock(&act_th->mutex);
/* append hls_obj_th to global struct thread_list, need a mutex lock */
dynarray_add(&act_th->th, &act_th->n_ths, th);
pthread_mutex_unlock(&act_th->mutex);
return 0;
}
开发者ID:bigbluebutton86,项目名称:hls_proxy,代码行数:11,代码来源:main_live.c
示例11: pe_load_def_file
/* ------------------------------------------------------------- */
PUB_FN int pe_load_def_file(TCCState *s1, int fd)
{
DLLReference *dllref;
int state = 0, ret = -1;
char line[400], dllname[80], *p;
FILE *fp = fdopen(dup(fd), "rb");
if (NULL == fp)
goto quit;
for (;;) {
p = get_line(line, sizeof line, fp);
if (NULL == p)
break;
if (0 == *p || ';' == *p)
continue;
switch (state) {
case 0:
if (0 != strnicmp(p, "LIBRARY", 7))
goto quit;
strcpy(dllname, trimfront(p+7));
++state;
continue;
case 1:
if (0 != stricmp(p, "EXPORTS"))
goto quit;
++state;
continue;
case 2:
dllref = tcc_malloc(sizeof(DLLReference) + strlen(dllname));
strcpy(dllref->name, dllname);
dllref->level = 0;
dynarray_add((void ***) &s1->loaded_dlls, &s1->nb_loaded_dlls, dllref);
++state;
default:
add_elf_sym(s1->dynsymtab_section,
s1->nb_loaded_dlls, 0,
ELF32_ST_INFO(STB_GLOBAL, STT_FUNC), 0,
text_section->sh_num, p);
continue;
}
}
ret = 0;
quit:
if (fp)
fclose(fp);
if (ret)
error_noabort("unrecognized export definition file format");
return ret;
}
开发者ID:AbdelghaniDr,项目名称:mirror,代码行数:54,代码来源:tccpe.c
示例12: av_mallocz
static struct variant *new_variant(HLSContext *c, int bandwidth,
const char *url, const char *base)
{
struct variant *var = av_mallocz(sizeof(struct variant));
if (!var)
return NULL;
reset_packet(&var->pkt);
var->bandwidth = bandwidth;
ff_make_absolute_url(var->url, sizeof(var->url), base, url);
dynarray_add(&c->variants, &c->n_variants, var);
return var;
}
开发者ID:yfli,项目名称:ffmpeg-hls,代码行数:12,代码来源:hls.c
示例13: pe_load_def_file
int pe_load_def_file(TCCState *s1, int fd) {
DLLReference *dllref;
int state = 0, ret = -1, hint;
char line[400], dllname[80], *p, *ordinal;
FILE *fp = fdopen(dup(fd), "rb");
if (fp == NULL) goto quit;
for (;;) {
p = get_line(line, sizeof line, fp);
if (p == NULL) break;
if (*p == 0 || *p == ';') continue;
switch (state) {
case 0:
if (strncasecmp(p, "LIBRARY", 7) != 0) goto quit;
strcpy(dllname, trimfront(p + 7));
++state;
continue;
case 1:
if (strcasecmp(p, "EXPORTS") != 0) goto quit;
++state;
continue;
case 2:
dllref = tcc_malloc(sizeof(DLLReference) + strlen(dllname));
strcpy(dllref->name, dllname);
dllref->level = 0;
dynarray_add((void ***) &s1->loaded_dlls, &s1->nb_loaded_dlls, dllref);
++state;
default:
hint = 0;
ordinal = strchr(p, '@');
if (ordinal) {
*ordinal = 0;
trimback(p, ordinal);
ordinal++;
hint = atoi(ordinal);
}
add_elf_sym(s1->dynsymtab_section, s1->nb_loaded_dlls, 0,
ELF32_ST_INFO(STB_GLOBAL, STT_FUNC), hint,
text_section->sh_num, p);
continue;
}
}
ret = 0;
quit:
if (fp) fclose(fp);
if (ret) error_noabort("unrecognized export definition file format");
return ret;
}
开发者ID:HarryR,项目名称:sanos,代码行数:52,代码来源:pe.c
示例14: decl_replace_with
void decl_replace_with(decl *to, decl *from)
{
attribute **i;
/* XXX: memleak of .ref */
memcpy_safe(&to->where, &from->where);
to->ref = from->ref;
to->spel_asm = from->spel_asm, from->spel_asm = NULL;
/* no point copying bitfield stuff */
memcpy_safe(&to->bits, &from->bits);
for(i = from->attr; i && *i; i++)
dynarray_add(&to->attr, RETAIN(*i));
}
开发者ID:bobrippling,项目名称:ucc-c-compiler,代码行数:14,代码来源:decl.c
示例15: traceslang_addtorefset
/*
* adds an event-reference to the given set of event references
* returns 0 on success (ref added), 1 if reference already here, < 0 on error
*/
int traceslang_addtorefset (traceslang_erefset_t *erset, tnode_t **eventp)
{
int i;
for (i=0; i<DA_CUR (erset->events); i++) {
tnode_t **evp = DA_NTHITEM (erset->events, i);
if (eventp == evp) {
/* same reference */
return 1;
}
}
dynarray_add (erset->events, eventp);
return 0;
}
开发者ID:concurrency,项目名称:nocc,代码行数:19,代码来源:traceslang_fe.c
示例16: section_new
/***********************************************************
* 功能: 新建节
* name: 节名称
* Characteristics: 节属性
* 返回值: 新增加节
**********************************************************/
Section * section_new(char *name, int Characteristics)
{
Section *sec;
int initsize = 8;
sec = mallocz(sizeof(Section));
strcpy(sec->sh.Name,name);
sec->sh.Characteristics = Characteristics;
sec->index = sections.count + 1; //one-based index
sec->data = mallocz(sizeof(char)*initsize);
sec->data_allocated = initsize;
if(!(Characteristics & IMAGE_SCN_LNK_REMOVE))
nsec_image++;
dynarray_add(§ions, sec);
return sec;
}
开发者ID:7ym0n,项目名称:note,代码行数:21,代码来源:outcoff.c
示例17: fold_stmt_goto
void fold_stmt_goto(stmt *s)
{
if(!symtab_func(s->symtab))
die_at(&s->where, "goto outside of a function");
if(s->expr){
FOLD_EXPR(s->expr, s->symtab);
}else{
(s->bits.lbl.label =
symtab_label_find_or_new(
s->symtab, s->bits.lbl.spel, &s->where))
->uses++;
dynarray_add(&s->bits.lbl.label->jumpers, s);
}
}
开发者ID:8l,项目名称:ucc-c-compiler,代码行数:16,代码来源:stmt_goto.c
示例18: av_mallocz
static struct variant *new_variant(struct list_mgt *mgt, int bandwidth,
const char *url, const char *base)
{
struct variant *var = av_mallocz(sizeof(struct variant));
if (!var)
return NULL;
var->bandwidth = bandwidth;
if(base){
av_strlcpy(var->url, base, sizeof(var->url));
}
av_strlcat(var->url, url, sizeof(var->url));
dynarray_add(&mgt->variants, &mgt->n_variants, var);
return var;
}
开发者ID:Aldwych,项目名称:buildroot-linux,代码行数:16,代码来源:m3u.c
示例19: printf
static MpegTSService *new_service(MpegTSContext *ts, int sid,
char *provider_name, char *name)
{
MpegTSService *service;
#ifdef DEBUG_SI
printf("new_service: sid=0x%04x provider='%s' name='%s'\n",
sid, provider_name, name);
#endif
service = av_mallocz(sizeof(MpegTSService));
if (!service)
return NULL;
service->sid = sid;
service->provider_name = provider_name;
service->name = name;
dynarray_add(&ts->services, &ts->nb_services, service);
return service;
}
开发者ID:DmitrySigaev,项目名称:DSMedia,代码行数:19,代码来源:mpegts.c
示例20: out_comment
const out_val *gen_expr_funcall(const expr *e, out_ctx *octx)
{
const out_val *fn_ret;
if(0){
out_comment(octx, "start manual __asm__");
ICE("same");
#if 0
fprintf(cc_out[SECTION_TEXT], "%s\n", e->funcargs[0]->data_store->data.str);
#endif
out_comment(octx, "end manual __asm__");
}else{
/* continue with normal funcall */
const out_val *fn, **args = NULL;
fn = gen_expr(e->expr, octx);
if(e->funcargs){
expr **aiter;
for(aiter = e->funcargs; *aiter; aiter++){
expr *earg = *aiter;
const out_val *arg;
/* should be of size int or larger (for integral types)
* or double (for floating types)
*/
arg = gen_expr(earg, octx);
dynarray_add(&args, arg);
}
}
/* consumes fn and args */
fn_ret = gen_call(e->expr, NULL, fn, args, octx, &e->expr->where);
dynarray_free(const out_val **, args, NULL);
if(!expr_func_passable(GEN_CONST_CAST(expr *, e)))
out_ctrl_end_undefined(octx);
}
return fn_ret;
}
开发者ID:bobrippling,项目名称:ucc-c-compiler,代码行数:43,代码来源:expr_funcall.c
注:本文中的dynarray_add函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论