本文整理汇总了C++中PRIV函数的典型用法代码示例。如果您正苦于以下问题:C++ PRIV函数的具体用法?C++ PRIV怎么用?C++ PRIV使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PRIV函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: surface_update_mfn_list
static void surface_update_mfn_list (surfman_surface_t * surface)
{
struct surface_priv *p = PRIV(surface);
xen_pfn_t *pfns;
int rc;
int domid = surface->pages_domid;
size_t i, n = surface->page_count;
/* p2m translation is only performed for lfb given by qemu,
* so PFN_LINEAR or abort. */
assert(p->type == TYPE_PFN_LINEAR);
pfns = xcalloc(n, sizeof (xen_pfn_t));
for (i = 0; i < n; ++i)
pfns[i] = p->u.pfn_linear.base + i;
if (xc_translate_gpfn_to_mfn (domid, n, pfns, surface->mfns))
surfman_error ("Failed to translate pfns for dom%d (base:%#lx).",
domid, p->u.pfn_linear.base);
free(pfns);
}
示例2: gom_noodle_replace_child
static GomNode *
gom_noodle_replace_child (GomNode *node,
GomNode *new_child,
GomNode *ref_child,
GError **error)
{
GomNoodlePrivate *priv = PRIV (node);
GList *li;
li = find_node (node, ref_child, error);
if (li) {
li->data = g_object_ref (new_child);
priv->dirty_children = 1;
if (GOM_IS_NODE_INTERNAL (ref_child)) {
gom_node_internal_set_parent (GOM_NODE_INTERNAL (ref_child), NULL);
}
g_object_unref (ref_child);
if (GOM_IS_NODE_INTERNAL (new_child)) {
gom_node_internal_set_parent (GOM_NODE_INTERNAL (new_child), node);
}
}
return ref_child;
}
示例3: idt77105_ioctl
static int idt77105_ioctl(struct atm_dev *dev,unsigned int cmd,void *arg)
{
printk(KERN_NOTICE "%s(%d) idt77105_ioctl() called\n",dev->type,dev->number);
switch (cmd) {
case IDT77105_GETSTATZ:
if (!capable(CAP_NET_ADMIN)) return -EPERM;
/* fall through */
case IDT77105_GETSTAT:
return fetch_stats(dev,(struct idt77105_stats *) arg,
cmd == IDT77105_GETSTATZ);
case ATM_SETLOOP:
return set_loopback(dev,(int) (long) arg);
case ATM_GETLOOP:
return put_user(PRIV(dev)->loop_mode,(int *) arg) ?
-EFAULT : 0;
case ATM_QUERYLOOP:
return put_user(ATM_LM_LOC_ATM | ATM_LM_RMT_ATM,
(int *) arg) ? -EFAULT : 0;
default:
return -ENOIOCTLCMD;
}
}
示例4: dclock_destructor
/* Plugin destructor. */
static void dclock_destructor(Plugin * p)
{
DClockPlugin * dc = PRIV(p);
/* Remove the timer. */
if (dc->timer != 0)
g_source_remove(dc->timer);
/* Ensure that the calendar is dismissed. */
if (dc->calendar_window != NULL)
gtk_widget_destroy(dc->calendar_window);
/* Deallocate all memory. */
g_free(dc->clock_format);
g_free(dc->tooltip_format);
g_free(dc->action);
g_free(dc->font);
g_free(dc->prev_clock_value);
g_free(dc->prev_tooltip_value);
g_free(dc->timezone);
g_free(dc->timezones);
g_free(dc);
}
示例5: button_release_event
static gboolean
button_release_event (GtkWidget * widget,
GdkEventButton* event)
{
GList* iter;
update_hits (widget, (GdkEvent*) event);
for (iter = PRIV (widget)->hits; iter; iter = iter->next)
{
if (gtk_widget_event (iter->data, (GdkEvent*) event))
{
return TRUE;
}
}
if (GTK_WIDGET_CLASS (progress_path_bar_parent_class)->button_release_event)
{
return GTK_WIDGET_CLASS (progress_path_bar_parent_class)->button_release_event (widget, event);
}
return FALSE;
}
示例6: PRIV
void
PRIV(jit_free)(void *executable_jit, pcre2_memctl *memctl)
{
#ifndef SUPPORT_JIT
(void)executable_jit;
(void)memctl;
#else /* SUPPORT_JIT */
executable_functions *functions = (executable_functions *)executable_jit;
void *allocator_data = memctl;
int i;
for (i = 0; i < JIT_NUMBER_OF_COMPILE_MODES; i++)
{
if (functions->executable_funcs[i] != NULL)
sljit_free_code(functions->executable_funcs[i]);
PRIV(jit_free_rodata)(functions->read_only_data_heads[i], allocator_data);
}
SLJIT_FREE(functions, allocator_data);
#endif /* SUPPORT_JIT */
}
示例7: gom_noodle_set_property
static void
gom_noodle_set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
GomNoodlePrivate *priv = PRIV (object);
switch (property_id) {
case PROP_OWNER_DOCUMENT:
GOM_SET_WEAK (priv->owner_document, g_value_get_object (value));
break;
case PROP_NAMESPACE_URI:
case PROP_PREFIX:
case PROP_LOCAL_NAME:
if (!g_value_get_string (value)) {
break;
}
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
示例8: main
static void main(uint8_t view, const app_t *app, svc_main_proc_event_t event) {
hal_lcd_clear();
if(event & SVC_MAIN_PROC_EVENT_KEY_UP) {
INC_MOD(PRIV(app)->countdown_current, svc_countdowns_n);
}
else if (event & SVC_MAIN_PROC_EVENT_KEY_DOWN) {
DEC_MOD(PRIV(app)->countdown_current, svc_countdowns_n);
}
else if(event & SVC_MAIN_PROC_EVENT_KEY_ENTER_LONG) {
app_exit();
}
else if(event & SVC_MAIN_PROC_EVENT_KEY_DOWN_LONG) {
svc_countdown_t cd;
svc_countdown_get(PRIV(app_current)->countdown_current, &cd);
if(cd.state == SVC_COUNTDOWN_STATE_STOP) {
svc_countdown_start(PRIV(app_current)->countdown_current);
}
else {
svc_countdown_stop(PRIV(app_current)->countdown_current);
}
}
svc_countdown_t cd;
svc_countdown_get(PRIV(app)->countdown_current, &cd);
svc_lcd_puti(0, 2, cd.h);
svc_lcd_puti(2, 2, cd.m);
svc_lcd_puti(4, 2, cd.s);
hal_lcd_seg_set(HAL_LCD_SEG_COLON, 1);
hal_lcd_seg_set_blink(HAL_LCD_SEG_COLON, cd.state == SVC_COUNTDOWN_STATE_RUN);
if(cd.state == SVC_COUNTDOWN_STATE_RUN) {
svc_lcd_puts(8, "ru");
}
else {
svc_lcd_puts(8, "st");
}
svc_lcd_puti(6, 2, PRIV(app)->countdown_current);
if(event & SVC_MAIN_PROC_EVENT_KEY_ENTER) {
app_set_view(app, 1);
}
}
示例9: resized
Window::Window(uword width, uword height, const char *title,bool fullscreen,
word xpos, word ypos) : resized(true)
{
data = (void *) new WindowData;
PRIV(WindowData, wd);
wd->width = width;
wd->height = height;
wd->aspect = (double) width / (double) height;
wd->fullscreen = fullscreen;
glutInitWindowPosition(xpos, ypos);
glutInitWindowSize(width, height);
glutCreateWindow(title);
if(fullscreen){
glutHideWindow();
glutDestroyWindow(glutGetWindow());
char gameModeString [50];
sprintf (gameModeString, "%dx%d",width,height);
glutGameModeString(gameModeString);
glutSetWindow(glutEnterGameMode());
}
wd->wid = glutGetWindow();
glClearColor(0, 0, 0, 0);
glEnable(GL_DEPTH_TEST);
glEnable(GL_CULL_FACE);
glShadeModel(GL_SMOOTH);
glEnable(GL_LIGHTING);
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//Clearing screen to get a black screen while loading..
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
glutSwapBuffers();
windows.insert(this);
}
示例10: dclock_configure
/* Callback when the configuration dialog is to be shown. */
static void dclock_configure(Plugin * p, GtkWindow * parent)
{
DClockPlugin * dc = PRIV(p);
const char * clock_format_tooltip = _(
"See the manual page strftime(3) for possible format codes.\n\n"
"You can use the Pango markup to adjust text color, font size and other text properties.\n\n"
"Additionaly you can use:\n"
"\\n for line break\n"
"\\t for column break"
);
const char * tooltip_format_tooltip = _(
"See the manual page strftime(3) for possible format codes.\n\n"
"You can use the Pango markup to adjust text color, font size and other text properties."
);
GtkWidget * dialog = wtl_create_generic_config_dialog(
_(plugin_class(p)->name),
GTK_WIDGET(parent),
(GSourceFunc) dclock_apply_configuration, (gpointer) p,
"", 0, (GType)CONF_TYPE_BEGIN_TABLE,
_("Clock Format") , &dc->clock_format , (GType)CONF_TYPE_STR,
"tooltip-text", clock_format_tooltip, (GType)CONF_TYPE_SET_PROPERTY,
_("Tooltip Format"), &dc->tooltip_format, (GType)CONF_TYPE_STR,
"tooltip-text", tooltip_format_tooltip, (GType)CONF_TYPE_SET_PROPERTY,
_("Font") , &dc->font , (GType)CONF_TYPE_STR,
_("Action when clicked"), &dc->action, (GType)CONF_TYPE_STR,
"tooltip-text", _("Default action: display calendar"), (GType)CONF_TYPE_SET_PROPERTY,
_("Timezone") , &dc->timezone , (GType)CONF_TYPE_STR,
"completion-list", (gpointer)dclock_get_timezones(dc), (GType)CONF_TYPE_SET_PROPERTY,
"", 0, (GType)CONF_TYPE_END_TABLE,
NULL);
if (dialog)
gtk_window_present(GTK_WINDOW(dialog));
}
示例11: tcf_gact
static int
tcf_gact(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res)
{
struct tcf_gact *p = PRIV(a, gact);
int action = TC_ACT_SHOT;
spin_lock(&p->lock);
#ifdef CONFIG_GACT_PROB
if (p->ptype && gact_rand[p->ptype] != NULL)
action = gact_rand[p->ptype](p);
else
action = p->action;
#else
action = p->action;
#endif
p->bstats.bytes += skb->len;
p->bstats.packets++;
if (action == TC_ACT_SHOT)
p->qstats.drops++;
p->tm.lastuse = jiffies;
spin_unlock(&p->lock);
return action;
}
示例12: dclock_run_command_calendar_visible
static void dclock_run_command_calendar_visible(Plugin * p, char ** argv, int argc)
{
DClockPlugin * dc = PRIV(p);
gboolean visible = dc->calendar_window != NULL;
gboolean old_visible = visible;
visible = !visible;
if (argc >= 1)
{
if (strcmp(argv[0], "true") == 0 || strcmp(argv[0], "1") == 0)
visible = TRUE;
else if (strcmp(argv[0], "false") == 0 || strcmp(argv[0], "0") == 0)
visible = FALSE;
}
if (visible != old_visible)
{
if (visible)
dclock_show_calendar(dc);
else
dclock_hide_calendar(dc);
}
}
示例13: gom_noodle_append_child
static GomNode *
gom_noodle_append_child (GomNode *node,
GomNode *new_child,
GError **error)
{
GomNoodlePrivate *priv = PRIV (node);
GomNode *parent;
GError *err = NULL;
g_object_get (new_child, "parent-node", &parent, NULL);
if (parent) {
gom_node_remove_child (parent, new_child, &err);
g_object_unref (parent);
if (err) {
g_propagate_error (error, err);
return new_child;
}
}
priv->children = g_list_append (priv->children, g_object_ref (new_child));
priv->dirty_children = 1;
if (GOM_IS_NODE_INTERNAL (new_child)) {
gom_node_internal_set_parent (GOM_NODE_INTERNAL (new_child), node);
}
return new_child;
}
示例14: cherokee_logger_init_base
ret_t
cherokee_logger_init_base (cherokee_logger_t *logger,
cherokee_plugin_info_t *info,
cherokee_config_node_t *config)
{
ret_t ret;
CHEROKEE_NEW_TYPE(priv, struct cherokee_logger_private);
/* Init the base class
*/
cherokee_module_init_base (MODULE(logger), NULL, info);
/* Pure virtual methods
*/
logger->priv = priv;
logger->write_access = NULL;
logger->utc_time = false;
/* Private
*/
logger->priv->backup_mode = false;
CHEROKEE_MUTEX_INIT (&PRIV(logger)->mutex, NULL);
cherokee_x_real_ip_init (&logger->priv->x_real_ip);
/* Read the configuration
*/
ret = cherokee_x_real_ip_configure (&logger->priv->x_real_ip, config);
if (ret != ret_ok) {
return ret_error;
}
cherokee_config_node_read_bool (config, "utc_time", &logger->utc_time);
return ret_ok;
}
示例15: clip6_create
int clip6_create(int number)
{
struct net_device *dev;
struct clip6_priv *clip6_priv;
int error;
DPRINTK("clip6_create\n");
if (number != -1) {
for (dev = clip6_devs; dev; dev = PRIV(dev)->next)
if (PRIV(dev)->number == number) return -EEXIST;
}
else {
number = 0;
for (dev = clip6_devs; dev; dev = PRIV(dev)->next)
if (PRIV(dev)->number >= number)
number = PRIV(dev)->number+1;
DPRINTK("clip6_create number %d\n", number);
}
dev = kmalloc(sizeof(struct net_device)+sizeof(struct clip6_priv),
GFP_KERNEL);
DPRINTK("clip6_create mem\n");
if (!dev) return -ENOMEM;
DPRINTK("clip6_create mem ok\n");
memset(dev,0,sizeof(struct net_device)+sizeof(struct clip6_priv));
clip6_priv = PRIV(dev);
sprintf(dev->name,"atm%d",number);
dev->init = clip6_init;
spin_lock_init(&clip6_priv->xoff_lock);
clip6_priv->number = number;
error = register_netdev(dev);
if (error) {
kfree(dev);
DPRINTK("clip6_create error %d\n",error);
return error;
}
clip6_priv->next = clip6_devs;
clip6_devs = dev;
clip6_priv->vccs = NULL;
clip6_priv->vcc = NULL;
DPRINTK("registered (net:%s)\n",dev->name);
return number;
}