这篇教程C++ E_DEBUG函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中E_DEBUG函数的典型用法代码示例。如果您正苦于以下问题:C++ E_DEBUG函数的具体用法?C++ E_DEBUG怎么用?C++ E_DEBUG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了E_DEBUG函数的25个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: assert// call with *e lockedstatic store_page *_allocate_page(store_engine *e, unsigned int bucket, unsigned int free_bucket) { assert(!e->page_buckets[bucket] || e->page_buckets[bucket]->allocated == e->page_size); store_page *tmp = NULL; // if a specific free bucket was requested, check there first if (free_bucket != 0 && e->free_page_buckets[free_bucket] != NULL) { assert(e->page_free > 0); tmp = e->free_page_buckets[free_bucket]; e->free_page_buckets[free_bucket] = tmp->next; } // failing that, try the global list. if (tmp == NULL && e->page_freelist != NULL) { tmp = e->page_freelist; e->page_freelist = tmp->next; } E_DEBUG("EXTSTORE: allocating new page/n"); // page_freelist can be empty if the only free pages are specialized and // we didn't just request one. if (e->page_free > 0 && tmp != NULL) { tmp->next = e->page_buckets[bucket]; e->page_buckets[bucket] = tmp; tmp->active = true; tmp->free = false; tmp->closed = false; tmp->version = _next_version(e); tmp->bucket = bucket; e->page_free--; STAT_INCR(e, page_allocs, 1); } else { extstore_run_maint(e); } if (tmp) E_DEBUG("EXTSTORE: got page %u/n", tmp->id); return tmp;}
开发者ID:dormando,项目名称:memcached,代码行数:36,
示例2: mainintmain(int argc, char *argv[]){ logmath_t *lmath; cmd_ln_t *config; acmod_t *acmod; ps_mgau_t *ps; ptm_mgau_t *s; int i, lastcb; lmath = logmath_init(1.0001, 0, 0); config = cmd_ln_init(NULL, ps_args(), TRUE, "-compallsen", "yes", "-input_endian", "little", NULL); cmd_ln_parse_file_r(config, ps_args(), MODELDIR "/en-us/en-us/feat.params", FALSE); cmd_ln_set_str_extra_r(config, "_mdef", MODELDIR "/en-us/en-us/mdef"); cmd_ln_set_str_extra_r(config, "_mean", MODELDIR "/en-us/en-us/means"); cmd_ln_set_str_extra_r(config, "_var", MODELDIR "/en-us/en-us/variances"); cmd_ln_set_str_extra_r(config, "_tmat", MODELDIR "/en-us/en-us/transition_matrices"); cmd_ln_set_str_extra_r(config, "_sendump", MODELDIR "/en-us/en-us/sendump"); cmd_ln_set_str_extra_r(config, "_mixw", NULL); cmd_ln_set_str_extra_r(config, "_lda", NULL); cmd_ln_set_str_extra_r(config, "_senmgau", NULL); err_set_debug_level(3); TEST_ASSERT(config); TEST_ASSERT((acmod = acmod_init(config, lmath, NULL, NULL))); TEST_ASSERT((ps = acmod->mgau)); TEST_EQUAL(0, strcmp(ps->vt->name, "ptm")); s = (ptm_mgau_t *)ps; E_DEBUG(2,("PTM model loaded: %d codebooks, %d senones, %d frames of history/n", s->g->n_mgau, s->n_sen, s->n_fast_hist)); E_DEBUG(2,("Senone to codebook mappings:/n")); lastcb = s->sen2cb[0]; E_DEBUG(2,("/t%d: 0", lastcb)); for (i = 0; i < s->n_sen; ++i) { if (s->sen2cb[i] != lastcb) { lastcb = s->sen2cb[i]; E_DEBUGCONT(2,("-%d/n", i-1)); E_DEBUGCONT(2,("/t%d: %d", lastcb, i)); } } E_INFOCONT("-%d/n", i-1); run_acmod_test(acmod);#if 0 /* Replace it with ms_mgau. */ ptm_mgau_free(ps); cmd_ln_set_str_r(config, "-mixw", MODELDIR "/en-us/en-us/mixture_weights"); TEST_ASSERT((acmod->mgau = ms_mgau_init(acmod, lmath, acmod->mdef))); run_acmod_test(acmod); cmd_ln_free_r(config);#endif return 0;}
开发者ID:DanielSWolf,项目名称:rhubarb-lip-sync,代码行数:60,
示例3: fsg_model_add_altintfsg_model_add_alt(fsg_model_t * fsg, char const *baseword, char const *altword){ int i, basewid, altwid; int ntrans; /* FIXME: This will get slow, eventually... */ for (basewid = 0; basewid < fsg->n_word; ++basewid) if (0 == strcmp(fsg->vocab[basewid], baseword)) break; if (basewid == fsg->n_word) { E_ERROR("Base word %s not present in FSG vocabulary!/n", baseword); return -1; } altwid = fsg_model_word_add(fsg, altword); if (fsg->altwords == NULL) fsg->altwords = bitvec_alloc(fsg->n_word_alloc); bitvec_set(fsg->altwords, altwid); E_DEBUG(2,("Adding alternate word transitions (%s,%s) to FSG/n", baseword, altword)); /* Look for all transitions involving baseword and duplicate them. */ /* FIXME: This will also get slow, eventually... */ ntrans = 0; for (i = 0; i < fsg->n_state; ++i) { hash_iter_t *itor; if (fsg->trans[i].trans == NULL) continue; for (itor = hash_table_iter(fsg->trans[i].trans); itor; itor = hash_table_iter_next(itor)) { glist_t trans; gnode_t *gn; trans = hash_entry_val(itor->ent); for (gn = trans; gn; gn = gnode_next(gn)) { fsg_link_t *fl = gnode_ptr(gn); if (fl->wid == basewid) { fsg_link_t *link; /* Create transition object */ link = listelem_malloc(fsg->link_alloc); link->from_state = fl->from_state; link->to_state = fl->to_state; link->logs2prob = fl->logs2prob; /* FIXME!!!??? */ link->wid = altwid; trans = glist_add_ptr(trans, (void *) link); ++ntrans; } } hash_entry_val(itor->ent) = trans; } } E_DEBUG(2,("Added %d alternate word transitions/n", ntrans)); return ntrans;}
开发者ID:OmkarKirpan,项目名称:CMUSphinx,代码行数:60,
示例4: ee_do_commandint ee_do_command( u8 *Tx, int Tx_len, u8 *Rx, int Rx_len, int Send_skip ){ /* Execute this command string, including giving reset and setting to idle after command if Rx_len is set, we read out data from EEPROM */ int i; E_DEBUG("Command, Tx_len %d, Rx_len %d/n", Tx_len, Rx_len ); if(do_reset()){ /* Failed! */ return(-EIO); } if(Send_skip) /* Always send SKIP_ROM first to tell chip we are sending a command, except when we read out rom data for chip */ write_byte(SKIP_ROM); /* Always have Tx data */ for(i=0;i<Tx_len;i++){ write_byte(Tx[i]); } if(Rx_len){ for(i=0;i<Rx_len;i++){ Rx[i]=read_byte(); } } set_idle(); E_DEBUG("Command done/n"); return(0);}
开发者ID:12thmantec,项目名称:u-boot-novena-spl,代码行数:35,
示例5: namevoid Algorithm::shouldStop(bool stop) {#if DEBUGGING_ENABLED std::ostringstream msg; msg << "Streaming: " << name() << "::shouldStop[" << nProcess << "] = " << (stop ? "true" : "false"); E_DEBUG(EAlgorithm, msg.str());#else E_DEBUG(EAlgorithm, "Streaming: " << name() << "::shouldStop = " << (stop?"true":"false"));#endif _shouldStop = stop;}
开发者ID:Aldor007,项目名称:essentia,代码行数:11,
示例6: read_bytestatic u8read_byte(void){ /* Read a single byte from EEPROM Read LSb first */ int i; int Value; u8 Result=0;#ifndef CONFIG_SYS_IMMR u32 Flags;#endif E_DEBUG("Reading byte/n"); for(i=0;i<8;i++){ /* Small delay between pulses */ udelay(1);#ifndef CONFIG_SYS_IMMR /* Disable irq */ save_flags(Flags); cli();#endif /* Pull down pin short time to start read See page 26 in data sheet */ WRITE_PORT(0); udelay(READ_LOW); WRITE_PORT(1); /* Wait for chip to drive pin */ udelay(READ_TIMEOUT); Value = READ_PORT; if(Value) Value=1;#ifndef CONFIG_SYS_IMMR /* Enable irq */ restore_flags(Flags);#endif /* Wait for chip to release pin */ udelay(TOTAL_READ_LOW-READ_TIMEOUT); /* LSb first */ Result|=Value<<i; } E_DEBUG("Read byte 0x%x/n",Result); return(Result);}
开发者ID:12thmantec,项目名称:u-boot-novena-spl,代码行数:53,
示例7: E_WARNINGvoid SinkBase::detachProxy(SinkProxyBase* sproxy) { // TODO: verify me if (sproxy != _sproxy) { E_WARNING("Cannot detach " << fullName() << " from SinkProxy " << sproxy->fullName() << " as they are not attached"); return; } E_DEBUG(EConnectors, " SinkBase::detachProxy: " << fullName() << "::_sproxy = 0"); _sproxy = 0; E_DEBUG(EConnectors, " SinkBase::detachProxy: " << fullName() << "::_source = 0"); setSource(0); // also set source to 0 because the proxy set it for us when we attached, but now we're all alone}
开发者ID:AnasGhrab,项目名称:essentia,代码行数:13,
示例8: init/** * Initialize Essentia and fill the AlgorithmFactories with the Algorithms. */void init() { setDebugLevel(EUser1 | EUser2); E_DEBUG(EFactory, "essentia::init()"); standard::AlgorithmFactory::init(); standard::registerAlgorithm(); streaming::AlgorithmFactory::init(); streaming::registerAlgorithm(); TypeMap::init(); _initialized = true; E_DEBUG(EFactory, "essentia::init() ok!");}
开发者ID:Maplestorys,项目名称:essentia,代码行数:16,
示例9: state_align_search_finishstatic intstate_align_search_finish(ps_search_t *search){ state_align_search_t *sas = (state_align_search_t *)search; hmm_t *final_phone = sas->hmms + sas->n_phones - 1; ps_alignment_iter_t *itor; ps_alignment_entry_t *ent; int last_frame, cur_frame; state_align_hist_t last, cur; /* Best state exiting the last cur_frame. */ last.id = cur.id = hmm_out_history(final_phone); last.score = hmm_out_score(final_phone); if (last.score == 0xffff) { E_ERROR("Failed to reach final state in alignment/n"); return -1; } itor = ps_alignment_states(sas->al); last_frame = sas->frame + 1; for (cur_frame = sas->frame - 1; cur_frame >= 0; --cur_frame) { cur = sas->tokens[cur_frame * sas->n_emit_state + cur.id]; /* State boundary, update alignment entry for next state. */ if (cur.id != last.id) { itor = ps_alignment_iter_goto(itor, last.id); assert(itor != NULL); ent = ps_alignment_iter_get(itor); ent->start = cur_frame + 1; ent->duration = last_frame - ent->start; ent->score = last.score - cur.score; E_DEBUG(1,("state %d start %d end %d/n", last.id, ent->start, last_frame)); last = cur; last_frame = cur_frame + 1; } } /* Update alignment entry for initial state. */ itor = ps_alignment_iter_goto(itor, 0); assert(itor != NULL); ent = ps_alignment_iter_get(itor); ent->start = 0; ent->duration = last_frame; E_DEBUG(1,("state %d start %d end %d/n", 0, ent->start, last_frame)); ps_alignment_iter_free(itor); ps_alignment_propagate(sas->al); return 0;}
开发者ID:Bangybug,项目名称:pocketsphinx,代码行数:49,
示例10: acmod_read_scoresintacmod_read_scores(acmod_t *acmod){ int inptr, rv; if (acmod->grow_feat) { /* Grow to avoid wraparound if grow_feat == TRUE. */ inptr = acmod->feat_outidx + acmod->n_feat_frame; /* Has to be +1, otherwise, next time acmod_advance() is * called, this will wrap around. */ while (inptr + 1 >= acmod->n_feat_alloc) acmod_grow_feat_buf(acmod, acmod->n_feat_alloc * 2); } else { inptr = (acmod->feat_outidx + acmod->n_feat_frame) % acmod->n_feat_alloc; } if ((rv = acmod_read_scores_internal(acmod)) != 1) return rv; /* Set acmod->senscr_frame appropriately so that these scores get reused below in acmod_score(). */ acmod->senscr_frame = acmod->output_frame + acmod->n_feat_frame; E_DEBUG(1,("Frame %d has %d active states/n", acmod->senscr_frame, acmod->n_senone_active)); /* Increment the "feature frame counter" and record the file * position for the relevant frame in the (possibly circular) * buffer. */ ++acmod->n_feat_frame; acmod->framepos[inptr] = ftell(acmod->insenfh); return 1;}
开发者ID:OmkarKirpan,项目名称:CMUSphinx,代码行数:35,
示例11: checkSameTypeAsvoid SinkBase::attachProxy(SinkProxyBase* sproxy) { checkSameTypeAs(*sproxy); if (_source) throw EssentiaException("You cannot attach a SinkProxy to a Sink which is already connected: ", fullName(), " is already connected to ", _source->fullName()); if (_sproxy) throw EssentiaException("You cannot attach a SinkProxy to a Sink which is already attached to a SinkProxy: ", fullName(), " is attached to proxy ", _sproxy->fullName()); E_DEBUG(EConnectors, " SinkBase::attachProxy: " << fullName() << "::_sproxy = " << sproxy->fullName()); _sproxy = sproxy; E_DEBUG(EConnectors, " SinkBase::attachProxy: " << sproxy->fullName() << "::updateProxiedSink()"); _sproxy->updateProxiedSink();}
开发者ID:AnasGhrab,项目名称:essentia,代码行数:16,
示例12: E_DEBUGvoid Algorithm::reset() { E_DEBUG(EAlgorithm, "Streaming: " << name() << "::reset()"); shouldStop(false); // reset the buffers of the sources of this algorithm for (OutputMap::iterator it = _outputs.begin(); it != _outputs.end(); ++it) { E_DEBUG(EAlgorithm, "resetting buffer for " << it->second->fullName()); it->second->reset(); } // Note: we don't need to reset the inputs because they share a Multi-rate // buffer with the outputs E_DEBUG(EAlgorithm, "Streaming: " << name() << "::reset() ok!");}
开发者ID:Aldor007,项目名称:essentia,代码行数:16,
示例13: E_DEBUGvoid DesktopIcon::load_icon(int face) { const char* ic = NULL; if(face != ICON_FACE_TWO) { if(!settings->icon.empty()) ic = settings->icon.c_str(); } else { if(!settings->icon2.empty()) ic = settings->icon2.c_str(); } if(!ic) return; if(!IconLoader::set(this, ic, ICON_SIZE_HUGE)) { E_DEBUG(E_STRLOC ": Unable to load %s icon/n", ic); return; } /* fetch image object for sizes */ Fl_Image* img = image(); int img_w = img->w(); int img_h = img->h(); /* resize box if icon is larger */ if(img_w > ICON_SIZE_MIN_W || img_h > ICON_SIZE_MIN_H) size(img_w + OFFSET_W, img_h + OFFSET_H); /* darker icon version for selection */ delete darker_img; darker_img = img->copy(img->w(), img->h()); darker_img->color_average(FL_BLUE, 0.6);}
开发者ID:edeproject,项目名称:svn,代码行数:35,
示例14: load_theme_cbstatic void load_theme_cb(Fl_Widget*, void*) { E_RETURN_IF_FAIL(ThemeLoader::global()->load_with_path("theme-sample")); char buf[128]; if(ThemeLoader::global()->theme()->get_item("ede", "sample", buf, sizeof(buf))) E_DEBUG(E_STRLOC ": evaluated => %s/n", buf);}
开发者ID:GustavoMOG,项目名称:edelib,代码行数:7,
示例15: populate_lrdiphstatic voidpopulate_lrdiph(dict2pid_t *d2p, s3ssid_t ***rdiph_rc, s3cipid_t b){ bin_mdef_t *mdef = d2p->mdef; s3cipid_t l, r; for (l = 0; l < bin_mdef_n_ciphone(mdef); l++) { for (r = 0; r < bin_mdef_n_ciphone(mdef); r++) { s3pid_t p; p = bin_mdef_phone_id_nearest(mdef, (s3cipid_t) b, (s3cipid_t) l, (s3cipid_t) r, WORD_POSN_SINGLE); d2p->lrdiph_rc[b][l][r] = bin_mdef_pid2ssid(mdef, p); if (r == bin_mdef_silphone(mdef)) d2p->ldiph_lc[b][r][l] = bin_mdef_pid2ssid(mdef, p); if (rdiph_rc && l == bin_mdef_silphone(mdef)) rdiph_rc[b][l][r] = bin_mdef_pid2ssid(mdef, p); assert(IS_S3SSID(bin_mdef_pid2ssid(mdef, p))); E_DEBUG(2,("%s(%s,%s) => %d / %d/n", bin_mdef_ciphone_str(mdef, b), bin_mdef_ciphone_str(mdef, l), bin_mdef_ciphone_str(mdef, r), p, bin_mdef_pid2ssid(mdef, p))); } }}
开发者ID:10v,项目名称:cmusphinx,代码行数:30,
示例16: E_DEBUGDesktop::~Desktop() { E_DEBUG("Desktop::~Desktop()/n"); delete conf; delete icon_opts; delete selbox;}
开发者ID:GustavoMOG,项目名称:ede,代码行数:7,
示例17: acmod_scoreint16 const *acmod_score(acmod_t *acmod, int *inout_frame_idx){ int frame_idx, feat_idx; /* Calculate the absolute frame index to be scored. */ frame_idx = calc_frame_idx(acmod, inout_frame_idx); /* If all senones are being computed, or we are using a senone file, then we can reuse existing scores. */ if ((acmod->compallsen || acmod->insenfh) && frame_idx == acmod->senscr_frame) { if (inout_frame_idx) *inout_frame_idx = frame_idx; return acmod->senone_scores; } /* Calculate position of requested frame in circular buffer. */ if ((feat_idx = calc_feat_idx(acmod, frame_idx)) < 0) return NULL; /* If there is an input senone file locate the appropriate frame and read it. */ if (acmod->insenfh) { fseek(acmod->insenfh, acmod->framepos[feat_idx], SEEK_SET); if (acmod_read_scores_internal(acmod) < 0) return NULL; } else { /* Build active senone list. */ acmod_flags2list(acmod); /* Generate scores for the next available frame */ ps_mgau_frame_eval(acmod->mgau, acmod->senone_scores, acmod->senone_active, acmod->n_senone_active, acmod->feat_buf[feat_idx], frame_idx, acmod->compallsen); } if (inout_frame_idx) *inout_frame_idx = frame_idx; acmod->senscr_frame = frame_idx; /* Dump scores to the senone dump file if one exists. */ if (acmod->senfh) { if (acmod_write_scores(acmod, acmod->n_senone_active, acmod->senone_active, acmod->senone_scores, acmod->senfh) < 0) return NULL; E_DEBUG(1,("Frame %d has %d active states/n", frame_idx, acmod->n_senone_active)); } return acmod->senone_scores;}
开发者ID:OmkarKirpan,项目名称:CMUSphinx,代码行数:57,
示例18: E_DEBUGPtyProcess::~PtyProcess() { E_DEBUG(E_STRLOC " : killing pid %d/n",m_Pid); if(m_Pid) kill(m_Pid, SIGSTOP); // Terminate child process - Vedran if(m_TTY) free(m_TTY); if(m_Inbuf) free(m_Inbuf); delete m_pPTY; delete d;}
开发者ID:edeproject,项目名称:svn,代码行数:11,
示例19: switchint DesktopIcon::handle(int event) { switch(event) { case FL_FOCUS: case FL_UNFOCUS: case FL_ENTER: case FL_LEAVE: return 1; /* We have to handle FL_MOVE too, if want to get only once FL_ENTER when entered or FL_LEAVE when leaved */ case FL_MOVE: return 1; case FL_PUSH: if(Fl::event_button() == 3) { /* MenuItem::popup() by default does not call callbacks */ const MenuItem* m = imenu->menu()->popup(Fl::event_x(), Fl::event_y()); if(m && m->callback()) m->do_callback(0, this); } return 1; case FL_RELEASE: if(Fl::event_clicks() > 0) run_async("ede-launch %s", settings->cmd.c_str()); return 1; case FL_DND_ENTER: case FL_DND_DRAG: case FL_DND_LEAVE: return 1; case FL_DND_RELEASE: E_DEBUG(E_STRLOC ": FL_DND_RELEASE on icon/n"); return 1; case FL_PASTE: E_DEBUG(E_STRLOC ": FL_PASTE on icon with %s/n", Fl::event_text()); return 1; default: break; } return 0;}
开发者ID:edeproject,项目名称:svn,代码行数:41,
示例20: acmod_flags2listint32acmod_flags2list(acmod_t *acmod){ int32 w, l, n, b, total_dists, total_words, extra_bits; bitvec_t *flagptr; total_dists = bin_mdef_n_sen(acmod->mdef); if (acmod->compallsen) { acmod->n_senone_active = total_dists; return total_dists; } total_words = total_dists / BITVEC_BITS; extra_bits = total_dists % BITVEC_BITS; w = n = l = 0; for (flagptr = acmod->senone_active_vec; w < total_words; ++w, ++flagptr) { if (*flagptr == 0) continue; for (b = 0; b < BITVEC_BITS; ++b) { if (*flagptr & (1UL << b)) { int32 sen = w * BITVEC_BITS + b; int32 delta = sen - l; /* Handle excessive deltas "lossily" by adding a few extra senones to bridge the gap. */ while (delta > 255) { acmod->senone_active[n++] = 255; delta -= 255; } acmod->senone_active[n++] = delta; l = sen; } } } for (b = 0; b < extra_bits; ++b) { if (*flagptr & (1UL << b)) { int32 sen = w * BITVEC_BITS + b; int32 delta = sen - l; /* Handle excessive deltas "lossily" by adding a few extra senones to bridge the gap. */ while (delta > 255) { acmod->senone_active[n++] = 255; delta -= 255; } acmod->senone_active[n++] = delta; l = sen; } } acmod->n_senone_active = n; E_DEBUG(1, ("acmod_flags2list: %d active in frame %d/n", acmod->n_senone_active, acmod->output_frame)); return n;}
开发者ID:JonGBowen,项目名称:GoodVibes,代码行数:53,
示例21: do_resetstatic intdo_reset(void){ /* Release reset and verify that chip responds with presence pulse */ int Retries = 0; while(Retries<5){ udelay(RESET_LOW_TIME); /* Send reset */ WRITE_PORT(0); udelay(RESET_LOW_TIME); /* Release reset */ WRITE_PORT(1); /* Wait for EEPROM to drive output */ udelay(PRESENCE_TIMEOUT); if(!READ_PORT){ /* Ok, EEPROM is driving a 0 */ E_DEBUG("Presence detected/n"); if(Retries){ E_DEBUG("Retries %d/n",Retries); } /* Make sure chip releases pin */ udelay(PRESENCE_LOW_TIME); return 0; } Retries++; } printk(KERN_ERR"EEPROM did not respond when releasing reset/n"); /* Make sure chip releases pin */ udelay(PRESENCE_LOW_TIME); /* Set to idle again */ set_idle(); return(-EIO);}
开发者ID:12thmantec,项目名称:u-boot-novena-spl,代码行数:39,
示例22: icon_theme_load_oncestatic bool icon_theme_load_once(const char* theme) { if(seen_theme && strcmp(seen_theme, theme) == 0) return false; seen_theme = strdup(theme); E_DEBUG(E_STRLOC ": loading '%s' theme/n", theme); if(IconLoader::inited()) IconLoader::reload(theme); else IconLoader::init(theme); return true;}
开发者ID:GustavoMOG,项目名称:edelib,代码行数:13,
示例23: DesktopIconDesktopIcon *Desktop::read_desktop_file(const char *path, const char *base, DesktopConfig *pos) { DesktopIcon *ret = NULL; if(file_test(path, FILE_TEST_IS_DIR)) { ret = new DesktopIcon(_("No Name")); ret->set_icon_type(DESKTOP_ICON_TYPE_FOLDER); /* hardcoded */ ret->set_image("folder"); /* copy label explicitly, as DesktopIcon() will only store a pointer */ ret->copy_label(base); } else { /* * try to load it as plain .desktop file by looking only at extension * TODO: MimeType can be used here too */ if(!str_ends(path, EDE_DESKTOP_DESKTOP_EXT)) return ret; DesktopFile df; char buf[PATH_MAX]; E_RETURN_VAL_IF_FAIL(df.load(path), ret); E_RETURN_VAL_IF_FAIL(df.type() != DESK_FILE_TYPE_UNKNOWN, ret); ret = new DesktopIcon(_("No Name")); ret->set_icon_type(DESKTOP_ICON_TYPE_NORMAL); if(df.name(buf, sizeof(buf))) ret->copy_label(buf); ret->set_image(df.icon(buf, sizeof(buf)) ? buf : NULL); if(df.comment(buf, sizeof(buf))) ret->set_tooltip(buf); } /* try to put random icon position in the middle of the desktop, so it is easier to notice */ int X = (rand() % (w() / 4)) + (w() / 4); int Y = (rand() % (h() / 4)) + (h() / 4); /* lookup icons locations if possible */ if(base && pos && *pos) { pos->get(base, "X", X, X); pos->get(base, "Y", Y, Y); } E_DEBUG("Setting icon '%s' (%i,%i)/n", base, X, Y); ret->position(X, Y); /* use loaded icon options */ ret->set_options(icon_opts); ret->set_path(path); return ret;}
开发者ID:GustavoMOG,项目名称:ede,代码行数:51,
示例24: gq_appendvoid *gq_append(gq_t *q, void const *ent){ void *dest; if (q->count == gq_alloc_size(q)) gq_expand(q); ++q->count; E_DEBUG(2,("tail %d count %d size %d/n", gq_index(q, q->head + q->count - 1), q->count, gq_alloc_size(q))); dest = gq_tail_ptr(q); memcpy(dest, ent, garray_ent_size(&q->base)); return dest;}
开发者ID:Ankit77,项目名称:cmusphinx,代码行数:14,
示例25: xdg_mime_find_dataconst String& MimeType::comment(void) { // calling without mime loaded do nothing if(!(status & MIME_LOADED)) return mcmt; if(status & COMMENT_LOADED) return mcmt; String ttype = mtype; ttype += ".xml"; const char* p = xdg_mime_find_data(ttype.c_str()); if(!p) return mcmt; String path = p; TiXmlDocument doc(path.c_str()); if(!doc.LoadFile()) { E_DEBUG(E_STRLOC ": MimeType::comment() %s malformed/n", path.c_str()); return mcmt; } TiXmlNode* el = doc.FirstChild("mime-type"); /* * First element which does not have "xml:lang" attribute * is default one. So hunt that one :) * * Btw. TinyXML does not handle XML namespaces and will return * "<namespace>:<attribute>" value. This is not big deal as long * as correctly fetch attribute values. */ for(el = el->FirstChildElement(); el; el = el->NextSibling()) { if(strncmp(el->Value(), "comment", 7) == 0) { // TODO: add locale here if(!el->ToElement()->Attribute("xml:lang")) { TiXmlText* data = el->FirstChild()->ToText(); if(data) { mcmt = data->Value(); break; } } } } status |= COMMENT_LOADED; return mcmt;}
开发者ID:edeproject,项目名称:svn,代码行数:50,
注:本文中的E_DEBUG函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ E_ERROR函数代码示例 C++ EXYNOS4_GPX2函数代码示例 |