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

C++ prop_ref_inc函数代码示例

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

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



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

示例1: 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:MatChung,项目名称:showtime,代码行数:31,代码来源:search.c


示例2: 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:Cy-4AH,项目名称:showtime,代码行数:33,代码来源:notifications.c


示例3: 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


示例4: setting_create_leaf

static setting_t *
setting_create_leaf(prop_t *parent, prop_t *title, const char *type,
		    const char *valuename, int flags)
{
  setting_t *s = calloc(1, sizeof(setting_t));
  s->s_root = prop_ref_inc(setting_add(parent, title, type, flags));
  s->s_val = prop_ref_inc(prop_create(s->s_root, valuename));
  return s;
}
开发者ID:Rautz,项目名称:showtime,代码行数:9,代码来源:settings.c


示例5: notify_add

void *
notify_add(prop_t *root, notify_type_t type, const char *icon, int delay,
	   rstr_t *fmt, ...)
{
  char msg[256];
  prop_t *p;
  const char *typestr;
  int tl;
  va_list ap, apx;

  switch(type) {
  case NOTIFY_INFO:    typestr = "info";    tl = TRACE_INFO;  break;
  case NOTIFY_WARNING: typestr = "warning"; tl = TRACE_INFO;  break;
  case NOTIFY_ERROR:   typestr = "error";   tl = TRACE_ERROR; break;
  default: return NULL;
  }
  
  va_start(ap, fmt);
  va_copy(apx, ap);

  tracev(0, tl, "notify", rstr_get(fmt), ap);

  vsnprintf(msg, sizeof(msg), rstr_get(fmt), apx);

  va_end(ap);
  va_end(apx);

  rstr_release(fmt);

  p = prop_create_root(NULL);

  prop_set_string(prop_create(p, "text"), msg);
  prop_set_string(prop_create(p, "type"), typestr);

  if(icon != NULL)
    prop_set_string(prop_create(p, "icon"), icon);

  p = prop_ref_inc(p);

  if(prop_set_parent(p, root ?: notify_prop_entries))
    prop_destroy(p);

  if(delay != 0) {
    prop_t *r = NULL;
    if(delay < 0) {
      r = prop_ref_inc(p);
      delay = -delay;
    }
    callout_arm(NULL, notify_timeout, p, delay);
    return r;
  }
  return p;
}
开发者ID:Cy-4AH,项目名称:showtime,代码行数:53,代码来源:notifications.c


示例6: event_create_openurl

event_t *
event_create_openurl(const char *url, const char *view, prop_t *origin,
		     prop_t *model, const char *how)
{
  event_openurl_t *e = event_create(EVENT_OPENURL, sizeof(event_openurl_t));

  e->url      = url    ? strdup(url)          : NULL;
  e->view     = view   ? strdup(view)         : NULL;
  e->origin   = prop_ref_inc(origin);
  e->model    = prop_ref_inc(model);
  e->how      = how    ? strdup(how)          : NULL;
  e->h.e_dtor = event_openurl_dtor;
  return &e->h;
}
开发者ID:kshostak,项目名称:showtime,代码行数:14,代码来源:event.c


示例7: event_create_openurl_args

event_t *
event_create_openurl_args(const event_openurl_args_t *args)
{
  event_openurl_t *e = event_create(EVENT_OPENURL, sizeof(event_openurl_t));
  e->h.e_dtor = event_openurl_dtor;

  e->url          = args->url    ? strdup(args->url)            : NULL;
  e->view         = args->view   ? strdup(args->view)           : NULL;
  e->item_model   = prop_ref_inc(args->item_model);
  e->parent_model = prop_ref_inc(args->parent_model);
  e->how          = args->how    ? strdup(args->how)            : NULL;
  e->parent_url   = args->parent_url ? strdup(args->parent_url) : NULL;
  return &e->h;
}
开发者ID:supersn0b,项目名称:movian,代码行数:14,代码来源:event.c


示例8: prop_callback

static void
prop_callback(void *opaque, prop_event_t event, ...)
{
  glw_keyintercept_t *ki = opaque;
  const char *str;
  prop_t *p;
  int c;
  va_list ap;
  va_start(ap, event);

  switch(event) {
  case PROP_SET_VOID:
    ki->buflen = 0;
    str = NULL;
    p = va_arg(ap, prop_t *);
    break;

  case PROP_SET_RSTRING:
    str = rstr_get(va_arg(ap, const rstr_t *));

    ki->buflen = 0;
    while((c = utf8_get(&str)) != 0 && ki->buflen < 64)
      ki->buf[ki->buflen++] = c;
    p = va_arg(ap, prop_t *);
    break;

  default:
    return;
  }

  prop_ref_dec(ki->prop);
  ki->prop = prop_ref_inc(p);
}
开发者ID:aznboi665,项目名称:showtime,代码行数:33,代码来源:glw_keyintercept.c


示例9: be_prop_open

static int
be_prop_open(prop_t *page, const char *url)
{
  proppage_t *pp;
  openpage_t *op;

  hts_mutex_lock(&pp_mutex);

  LIST_FOREACH(pp, &proppages, pp_link)
    if(!strcmp(rstr_get(pp->pp_url), url))
      break;

  if(pp == NULL) {
    hts_mutex_unlock(&pp_mutex);
    return 1;
  }

  op = calloc(1, sizeof(openpage_t));
  LIST_INSERT_HEAD(&pp->pp_pages, op, op_link);
  op->op_pp = pp;

  op->op_root = prop_ref_inc(page);
  op->op_page_sub = 
    prop_subscribe(PROP_SUB_TRACK_DESTROY,
		   PROP_TAG_CALLBACK, op_cb, op,
		   PROP_TAG_MUTEX, &pp_mutex,
		   PROP_TAG_ROOT, page,
		   NULL);

  prop_link(pp->pp_model, prop_create(page, "model"));
  hts_mutex_unlock(&pp_mutex);
  return 0;
}
开发者ID:Allba,项目名称:showtime,代码行数:33,代码来源:backend_prop.c


示例10: backend_prop_make

rstr_t *
backend_prop_make(prop_t *model, const char *suggest)
{
  proppage_t *pp;
  rstr_t *r;
  hts_mutex_lock(&pp_mutex);

  pp = calloc(1, sizeof(proppage_t));

  if(suggest == NULL) {
    char url[50];
    pp_tally++;
    snprintf(url, sizeof(url), "prop:%d", pp_tally);
    r = rstr_alloc(url);
  } else {
    r = rstr_alloc(suggest);
  }
  pp->pp_url = rstr_dup(r);

  pp->pp_model = prop_ref_inc(model);

  pp->pp_model_sub = 
    prop_subscribe(PROP_SUB_TRACK_DESTROY,
		   PROP_TAG_CALLBACK, pp_cb, pp,
		   PROP_TAG_MUTEX, &pp_mutex,
		   PROP_TAG_ROOT, model,
		   NULL);

  LIST_INSERT_HEAD(&proppages, pp, pp_link);
  hts_mutex_unlock(&pp_mutex);
  return r;
}
开发者ID:Allba,项目名称:showtime,代码行数:32,代码来源:backend_prop.c


示例11: prop_callback

static void
prop_callback(void *opaque, prop_event_t event, ...)
{
  glw_text_bitmap_t *gtb = opaque;
  const char *caption;
  prop_t *p;
  prop_str_type_t type = 0;
  va_list ap;
  va_start(ap, event);

  switch(event) {
  case PROP_SET_VOID:
    caption = NULL;
    p = va_arg(ap, prop_t *);
    break;

  case PROP_SET_RSTRING:
    caption = rstr_get(va_arg(ap, const rstr_t *));
    p = va_arg(ap, prop_t *);
    type = va_arg(ap, prop_str_type_t);
    break;

  default:
    return;
  }

  prop_ref_dec(gtb->gtb_p);
  gtb->gtb_p = prop_ref_inc(p);

  caption_set_internal(gtb, caption, type);
}
开发者ID:Allba,项目名称:showtime,代码行数:31,代码来源:glw_text_bitmap.c


示例12: backend_prop_make

void
backend_prop_make(prop_t *model, char *url, size_t urllen)
{
  proppage_t *pp;

  hts_mutex_lock(&pp_mutex);

  pp = malloc(sizeof(proppage_t));

  pp_tally++;

  snprintf(url, urllen, "prop:%d", pp_tally);
  pp->pp_url = strdup(url);

  pp->pp_model = prop_ref_inc(model);

  pp->pp_model_sub = 
    prop_subscribe(PROP_SUB_TRACK_DESTROY,
		   PROP_TAG_CALLBACK, pp_cb, pp,
		   PROP_TAG_MUTEX, &pp_mutex,
		   PROP_TAG_ROOT, model,
		   NULL);

  LIST_INSERT_HEAD(&proppages, pp, pp_link);
  hts_mutex_unlock(&pp_mutex);
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:26,代码来源:backend_prop.c


示例13: notifications_update

static void
notifications_update(void *opaque, prop_event_t event, ...)
{
  statusbar_t *sb = opaque;
  prop_t *p, *txt;
  statusbar_entry_t *sbe;
  char *buf;
  rstr_t *msg;
  int i, l;
  va_list ap;
  va_start(ap, event);

  switch(event) {
  case PROP_ADD_CHILD:
    p = va_arg(ap, prop_t *);

    txt = prop_get_by_name(PNVEC("self", "text"), 1,
			   PROP_TAG_NAMED_ROOT, p, "self",
			   NULL);
    if(txt != NULL) {
      msg = prop_get_string(txt);

      if(msg != NULL) {
	buf = mystrdupa(rstr_get(msg));
	l = strlen(buf);
	for(i = 0; i < l; i++)
	  if(buf[i] < ' ')
	    buf[i] = ' ';

	sbe = calloc(1, sizeof(statusbar_entry_t));
	sbe->p = prop_ref_inc(p);
	sbe->id = gtk_statusbar_push(GTK_STATUSBAR(sb->bar), sb->ctxid, buf);
	LIST_INSERT_HEAD(&sb->entries, sbe, link);
	rstr_release(msg);
      }
      prop_ref_dec(txt);
    }
    break;

  case PROP_DEL_CHILD:
    p = va_arg(ap, prop_t *);

    LIST_FOREACH(sbe, &sb->entries, link)
      if(sbe->p == p)
	break;

    if(sbe == NULL)
      break;

    prop_ref_dec(sbe->p);
    gtk_statusbar_remove(GTK_STATUSBAR(sb->bar), sb->ctxid, sbe->id);
    LIST_REMOVE(sbe, link);
    free(sbe);
    break;

  default:
    break;
  }
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:59,代码来源:gu_statusbar.c


示例14: js_object_from_prop

JSObject *
js_object_from_prop(JSContext *cx, prop_t *p)
{
  JSObject *obj = JS_NewObjectWithGivenProto(cx, &prop_bridge_class,
					     NULL, NULL);
  JS_SetPrivate(cx, obj, prop_ref_inc(p));
  return obj;
}
开发者ID:CrashSerious,项目名称:showtime,代码行数:8,代码来源:js_prop.c


示例15: event_create_prop

event_t *
event_create_prop(event_type_t type, prop_t *p)
{
  event_prop_t *e = event_create(type, sizeof(event_prop_t));
  e->p = prop_ref_inc(p);
  e->h.e_dtor = event_prop_dtor;
  return &e->h;
}
开发者ID:TELE-TWIN,项目名称:showtime,代码行数:8,代码来源:event.c


示例16: setting_create_leaf

static setting_t *
setting_create_leaf(prop_t *parent, prop_t *title, const char *type,
		    const char *valuename)
{
  setting_t *s = calloc(1, sizeof(setting_t));
  s->s_root = setting_add(prop_create(parent, "model"), title, type);
  s->s_model = prop_create(s->s_root, "model");
  s->s_val = prop_ref_inc(prop_create(s->s_model, valuename));
  return s;
}
开发者ID:mla2,项目名称:showtime,代码行数:10,代码来源:settings.c


示例17: event_create_prop_action

event_t *
event_create_prop_action(prop_t *p, rstr_t *action)
{
  event_prop_action_t *e = event_create(EVENT_PROP_ACTION,
                                        sizeof(event_prop_action_t));
  e->p = prop_ref_inc(p);
  e->action = rstr_dup(action);
  e->h.e_dtor = event_prop_action_dtor;
  return &e->h;
}
开发者ID:supersn0b,项目名称:movian,代码行数:10,代码来源:event.c


示例18: message_popup

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

  p = prop_ref_inc(prop_create_root(NULL));

  TRACE(TRACE_DEBUG, "Notification", "%s", message);

  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(extra) {
    int cnt = 1;
    prop_t *btns = prop_create(p, "buttons");
    while(*extra) {
      prop_t *b = prop_create_root(NULL);
      prop_set_string(prop_create(b, "title"), *extra);
      char action[10];
      snprintf(action, sizeof(action), "btn%d", cnt);
      prop_set_string(prop_create(b, "action"), action);
      if(prop_set_parent(b, btns))
	abort();
      cnt++;
      extra++;
    }
  }

  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);
  prop_ref_dec(p);

  const event_payload_t *ep = (const event_payload_t *)e;

  if(event_is_action(e, ACTION_OK))
    rval = MESSAGE_POPUP_OK;
  else if(event_is_action(e, ACTION_CANCEL))
    rval = MESSAGE_POPUP_CANCEL;
  else if(event_is_type(e, EVENT_DYNAMIC_ACTION) &&
	  !strncmp(ep->payload, "btn", 3))
    rval = atoi(ep->payload + 3);
  else
    rval = 0;

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


示例19: 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


示例20: assert

prop_vec_t *prop_vec_append(prop_vec_t *pv, prop_t *p)
{
  assert(atomic_get(&pv->pv_refcount) == 1);

  if(pv->pv_length == pv->pv_capacity) {
    pv->pv_capacity++;
    pv = realloc(pv, sizeof(prop_vec_t) + sizeof(prop_t *) * pv->pv_capacity);
  }
  assert(pv->pv_length < pv->pv_capacity);
  pv->pv_vec[pv->pv_length] = prop_ref_inc(p);
  pv->pv_length++;
  return pv;
}
开发者ID:Overx,项目名称:showtime,代码行数:13,代码来源:prop_vector.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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