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

C++ prop_destroy函数代码示例

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

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



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

示例1: playtrack_dtor

static void
playtrack_dtor(event_t *e)
{
  event_playtrack_t *ep = (event_playtrack_t *)e;
  prop_destroy(ep->track);
  if(ep->source != NULL)
    prop_destroy(ep->source);
}
开发者ID:kshostak,项目名称:showtime,代码行数:8,代码来源:event.c


示例2: js_appendItem0

static JSBool 
js_appendItem0(JSContext *cx, js_model_t *model, prop_t *parent,
	       const char *url, const char *type, JSObject *metaobj,
	       jsval *data, jsval *rval, int enabled,
	       const char *metabind)
{
  prop_t *item = prop_create_root(NULL);

  if(url != NULL)
    prop_set_string(prop_create(item, "url"), url);

  if(data != NULL)
    js_prop_set_from_jsval(cx, prop_create(item, "data"), *data);

  *rval = JSVAL_VOID;

  if(metabind != NULL)
    metadb_bind_url_to_prop(NULL, metabind, item);

  if(type != NULL) {
    prop_set_string(prop_create(item, "type"), type);

    if(metaobj)
      js_prop_from_object(cx, metaobj, prop_create(item, "metadata"));

  } else if(url != NULL) {

    if(backend_resolve_item(url, item)) {
      prop_destroy(item);
      return JS_TRUE;
    }
  }

  prop_set_int(prop_create(item, "enabled"), enabled);

  prop_t *p = prop_ref_inc(item);

  if(prop_set_parent(item, parent)) {
    prop_destroy(item);
    prop_ref_dec(p);
  } else {
    JSObject *robj =
      JS_NewObjectWithGivenProto(cx, &item_class,
				 JSVAL_TO_OBJECT(model->jm_item_proto), NULL);

    *rval =  OBJECT_TO_JSVAL(robj);
    js_item_t *ji = calloc(1, sizeof(js_item_t));
    ji->ji_model = model;
    ji->ji_root =  p;
    LIST_INSERT_HEAD(&model->jm_items, ji, ji_link);
    JS_SetPrivate(cx, robj, ji);
    ji->ji_enable_set_property = 1; 
  }
  return JS_TRUE;
}
开发者ID:RedSquirrel87,项目名称:showtime,代码行数:55,代码来源:js_page.c


示例3: news_sink

static void
news_sink(void *opaque, prop_event_t event, ...)
{
  prop_t *p = opaque;
  event_t *e;
  va_list ap;

  va_start(ap, event);

  switch(event) {
  case PROP_DESTROYED:
    prop_unsubscribe(va_arg(ap, prop_sub_t *));
    prop_ref_dec(p);
    break;

  case PROP_EXT_EVENT:
    e = va_arg(ap, event_t *);
    if(event_is_type(e, EVENT_DYNAMIC_ACTION)) {
      const event_payload_t *ep = (const event_payload_t *)e;
      if(!strcmp(ep->payload, "dismiss")) {
	rstr_t *id = prop_get_string(p, "id", NULL);
	dismis_news(rstr_get(id));
	rstr_release(id);
	prop_destroy(opaque);
      }
    }
    break;

  default:
    break;
  }
  va_end(ap);
}
开发者ID:tajmouati,项目名称:showtime,代码行数:33,代码来源:notifications.c


示例4: js_item_addOptAction

static JSBool 
js_item_addOptAction(JSContext *cx, JSObject *obj,
		     uintN argc, jsval *argv, jsval *rval)
{
  js_item_t *ji = JS_GetPrivate(cx, obj);
  const char *title;
  const char *action;

  if (!JS_ConvertArguments(cx, argc, argv, "ss", &title, &action))
    return JS_FALSE;
  
  prop_t *p = prop_create_root(NULL);
  prop_set_string(prop_create(p, "type"), "action");
  prop_set_string(prop_create(prop_create(p, "metadata"), "title"), title);
  prop_set_int(prop_create(p, "enabled"), 1);
  prop_set_string(prop_create(p, "action"), action);

  prop_t *opts = prop_create_r(ji->ji_root, "options");
  if(prop_set_parent(p, opts))
    prop_destroy(p);
  prop_ref_dec(opts);

  *rval = JSVAL_VOID;
  return JS_TRUE;
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:25,代码来源:js_page.c


示例5: trace_prop

static void
trace_prop(int l, const char *pfx, const char *msg, const char *sev)
{
  trace_entry_t *te = malloc(sizeof(trace_entry_t));
  te->p = prop_create_root(NULL);

  prop_set_string(prop_create(te->p, "prefix"), pfx);
  prop_set_string(prop_create(te->p, "message"), msg);
  prop_set_string(prop_create(te->p, "severity"), sev);

  TAILQ_INSERT_TAIL(&traces, te, link);


  if(prop_set_parent(te->p, log_root))
    abort();

  entries++;

  if(entries > 50) {
    te = TAILQ_FIRST(&traces);
    TAILQ_REMOVE(&traces, te, link);
    prop_destroy(te->p);
    free(te);
    entries--;
  }
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:26,代码来源:trace.c


示例6: add_news_locked

static prop_t *
add_news_locked(const char *id, const char *message,
                const char *location, const char *caption,
                const char *action)
{
  prop_t *p, *ret = NULL;
  prop_t *root = prop_create(prop_get_global(), "news");

  if(dismissed_news_out != NULL) {

    if(htsmsg_get_u32_or_default(dismissed_news_in, id, 0)) {
      dismis_news(id);
    } else {

      p = prop_create_root(id);
      prop_set(p, "message",  PROP_SET_STRING, message);
      prop_set(p, "id",       PROP_SET_STRING, id);
      prop_set(p, "location", PROP_SET_STRING, location);
      prop_set(p, "caption",  PROP_SET_STRING, caption);
      prop_set(p, "action",   PROP_SET_STRING, action);

      prop_subscribe(PROP_SUB_TRACK_DESTROY,
		     PROP_TAG_CALLBACK, news_sink, prop_ref_inc(p),
		     PROP_TAG_ROOT, prop_create(p, "eventSink"),
		     PROP_TAG_MUTEX, &news_mutex,
		     NULL);
      ret = prop_ref_inc(p);
      if(prop_set_parent(p, root))
	prop_destroy(p);
    }
  }
  return ret;
}
开发者ID:tajmouati,项目名称:showtime,代码行数:33,代码来源:notifications.c


示例7: nav_reload_current

static void
nav_reload_current(navigator_t *nav)
{
  nav_page_t *np;

  if((np = nav->nav_page_current) == NULL)
    return;

  plugins_reload_dev_plugin();

  TRACE(TRACE_INFO, "navigator", "Reloading %s", np->np_url);

  prop_unsubscribe(np->np_close_sub);
  prop_unsubscribe(np->np_direct_close_sub);
  prop_destroy(np->np_prop_root);
  nav_page_setup_prop(nav, np, NULL);

  if(prop_set_parent(np->np_prop_root, nav->nav_prop_pages)) {
    /* nav->nav_prop_pages is a zombie, this is an error */
    abort();
  }

  nav_select(nav, np, NULL);
    
  if(backend_open(np->np_prop_root, np->np_url))
    nav_open_errorf(np->np_prop_root, _("No handler for URL"));
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:27,代码来源:navigator.c


示例8: message_popup

int
message_popup(const char *message, int flags)
{
  prop_t *p;
  int rval;

  p = prop_create_root(NULL);

  prop_set_string(prop_create(p, "type"), "message");
  prop_set_string_ex(prop_create(p, "message"), NULL, message,
		     flags & MESSAGE_POPUP_RICH_TEXT ?
		     PROP_STR_RICH : PROP_STR_UTF8);
  if(flags & MESSAGE_POPUP_CANCEL)
    prop_set_int(prop_create(p, "cancel"), 1);
  if(flags & MESSAGE_POPUP_OK)
    prop_set_int(prop_create(p, "ok"), 1);

  event_t *e = popup_display(p);
  prop_destroy(p);
  
  if(event_is_action(e, ACTION_OK))
    rval = MESSAGE_POPUP_OK;
  else if(event_is_action(e, ACTION_CANCEL))
    rval = MESSAGE_POPUP_CANCEL;
  else
    rval = 0;

  event_release(e);
  return rval;
}
开发者ID:Sinster,项目名称:showtime,代码行数:30,代码来源:notifications.c


示例9: add_news

prop_t *
add_news(const char *message, const char *location, const char *caption)
{
  prop_t *p, *ret = NULL;

  prop_t *root = prop_create(prop_get_global(), "news");

  hts_mutex_lock(&news_mutex);

  if(dismissed_news_out != NULL) {

    if(htsmsg_get_u32_or_default(dismissed_news_in, message, 0)) {
      dismis_news(message);
    } else {
      
      p = prop_create_root(NULL);
      prop_set_string(prop_create(p, "message"), message);
      prop_set_string(prop_create(p, "location"), location);
      prop_set_string(prop_create(p, "caption"), caption);
		       
      prop_subscribe(PROP_SUB_TRACK_DESTROY,
		     PROP_TAG_CALLBACK, news_sink, prop_ref_inc(p),
		     PROP_TAG_ROOT, prop_create(p, "eventSink"),
		     PROP_TAG_MUTEX, &news_mutex,
		     NULL);
      ret = prop_ref_inc(p);
      if(prop_set_parent(p, root))
	prop_destroy(p);
    }
  }
  hts_mutex_unlock(&news_mutex);
  return ret;
}
开发者ID:dev-life,项目名称:showtime,代码行数:33,代码来源:notifications.c


示例10: nav_close

static void
nav_close(nav_page_t *np, int with_prop)
{
  navigator_t *nav = np->np_nav;

  prop_unsubscribe(np->np_close_sub);
  prop_unsubscribe(np->np_url_sub);
  prop_unsubscribe(np->np_direct_close_sub);

  if(nav->nav_page_current == np)
    nav->nav_page_current = NULL;

  if(np->np_inhistory)
    nav_remove_from_history(nav, np);

  TAILQ_REMOVE(&nav->nav_pages, np, np_global_link);

  if(with_prop) {
    prop_destroy(np->np_prop_root);
    nav_update_cango(nav);
  }
  free(np->np_url);
  free(np->np_view);
  free(np);
}
开发者ID:MatChung,项目名称:showtime,代码行数:25,代码来源:navigator.c


示例11: search_class_create

int
search_class_create(prop_t *parent, prop_t **nodesp, prop_t **entriesp,
		    const char *title, const char *icon)
{
  prop_t *p = prop_create_root(NULL);
  prop_t *m = prop_create(p, "metadata");
  prop_t *n, *e;
  
  char url[URL_MAX];

  backend_prop_make(p, url, sizeof(url));
  prop_set_string(prop_create(p, "url"), url);

  prop_set_string(prop_create(m, "title"), title);
  if(icon != NULL)
    prop_set_string(prop_create(m, "icon"), icon);
  prop_set_string(prop_create(p, "type"), "directory");
      
  n = prop_create(p, "nodes");
  e = prop_create(p, "entries");
  prop_set_int(e, 0);

  *nodesp = prop_ref_inc(n);
  *entriesp = prop_ref_inc(e);

  if(prop_set_parent(p, parent)) {
    prop_destroy(p);
    return 1;
  }
  return 0;
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:31,代码来源:search.c


示例12: mp_final_release

static void
mp_final_release(void *aux)
{
  media_pipe_t *mp = aux;
  prop_destroy(mp->mp_prop_root);
  free(mp);
}
开发者ID:RuralHunter,项目名称:showtime,代码行数:7,代码来源:media.c


示例13: prop_vec_destroy_entries

void
prop_vec_destroy_entries(prop_vec_t *pv)
{
  int i;

  for(i = 0; i < pv->pv_length; i++)
    prop_destroy(pv->pv_vec[i]);
}
开发者ID:Overx,项目名称:showtime,代码行数:8,代码来源:prop_vector.c


示例14: notify_timeout

static void
notify_timeout(callout_t *c, void *aux)
{
  prop_t *p = aux;
  prop_destroy(p);
  prop_ref_dec(p);
  free(c);
}
开发者ID:Sinster,项目名称:showtime,代码行数:8,代码来源:notifications.c


示例15: channel_destroy

static void
channel_destroy(htsp_connection_t *hc, htsp_channel_t *ch)
{
  prop_destroy(ch->ch_root);
  TAILQ_REMOVE(&hc->hc_channels, ch, ch_link);
  free(ch->ch_title);
  free(ch);
 }
开发者ID:bielorkut,项目名称:showtime,代码行数:8,代码来源:htsp.c


示例16: channel_destroy

static void
channel_destroy(htsp_channel_t *ch)
{
  prop_destroy(ch->ch_root);
  LIST_REMOVE(ch, ch_link);
  free(ch->ch_title);
  free(ch);
 }
开发者ID:PeteGashek,项目名称:showtime,代码行数:8,代码来源:htsp.c


示例17: js_subprovider_release

static void
js_subprovider_release(JSContext *cx, js_subprovider_t *sp)
{
  if(atomic_dec(&sp->sp_refcnt))
    return;
  JS_RemoveRoot(cx, &sp->sp_func);
  prop_destroy(sp->sp_title);
  free(sp);
}
开发者ID:Overx,项目名称:showtime,代码行数:9,代码来源:js_metaprovider.c


示例18: event_playurl_dtor

static void
event_playurl_dtor(event_t *e)
{
  event_playurl_t *ep = (event_playurl_t *)e;
  if(ep->model != NULL)
    prop_destroy(ep->model);
  free(ep->url);
  free(ep->how);
}
开发者ID:kshostak,项目名称:showtime,代码行数:9,代码来源:event.c


示例19: group_info_destroy

void group_info_destroy(group_info_t *ginfo) {
    mpr_hash_destroy(ginfo->ht_prom);
    mpr_hash_destroy(ginfo->ht_accd);
    
    if (ginfo->max_prop != NULL) {
        prop_destroy(ginfo->max_prop);
    }
    free(ginfo);
}
开发者ID:Abioy,项目名称:mpaxos,代码行数:9,代码来源:controller.c


示例20: setting_destroy

void
setting_destroy(setting_t *s)
{
  free(s->s_id);
  prop_unsubscribe(s->s_sub);
  prop_destroy(s->s_root);
  prop_ref_dec(s->s_val);
  free(s);
}
开发者ID:carlinx,项目名称:showtime,代码行数:9,代码来源:settings.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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