예제 #1
0
/* ================================================================= */
void
GncSqlTaxTableBackend::create_tables (GncSqlBackend* sql_be)
{
    gint version;

    g_return_if_fail (sql_be != NULL);

    version = sql_be->get_table_version( TT_TABLE_NAME);
    if (version == 0)
    {
        sql_be->create_table(TT_TABLE_NAME, TT_TABLE_VERSION, tt_col_table);
    }
    else if (version < m_version)
    {
        /* Upgrade 64 bit int handling */
        sql_be->upgrade_table(TT_TABLE_NAME, tt_col_table);
        sql_be->set_table_version (TT_TABLE_NAME, TT_TABLE_VERSION);
        PINFO ("Taxtables table upgraded from version 1 to version %d\n",
               TT_TABLE_VERSION);
    }

    version = sql_be->get_table_version( TTENTRIES_TABLE_NAME);
    if (version == 0)
    {
        sql_be->create_table(TTENTRIES_TABLE_NAME, TTENTRIES_TABLE_VERSION,
                              ttentries_col_table);
    }
    else if (version < TTENTRIES_TABLE_VERSION)
    {
        /* Upgrade 64 bit int handling */
        sql_be->upgrade_table(TTENTRIES_TABLE_NAME, ttentries_col_table);
        sql_be->set_table_version (TTENTRIES_TABLE_NAME, TTENTRIES_TABLE_VERSION);
        PINFO ("Taxtable entries table upgraded from version 1 to version %d\n",
               TTENTRIES_TABLE_VERSION);
    }
}
예제 #2
0
/* This detects the OV6620, OV6630, OV6630AE, or OV6630AF chip. */
static int ov6xx0_detect(struct i2c_client *c)
{
	struct ovcamchip *ov = i2c_get_clientdata(c);
	int rc;
	unsigned char val;

	PDEBUG(4, "");

	/* Detect chip (sub)type */
	rc = ov_read(c, GENERIC_REG_COM_I, &val);
	if (rc < 0) {
		PERROR("Error detecting ov6xx0 type");
		return -1;
	}

	if ((val & 3) == 0) {
		ov->subtype = CC_OV6630;
		PINFO("Camera chip is an OV6630");
	} else if ((val & 3) == 1) {
		ov->subtype = CC_OV6620;
		PINFO("Camera chip is an OV6620");
	} else if ((val & 3) == 2) {
		ov->subtype = CC_OV6630;
		PINFO("Camera chip is an OV6630AE");
	} else if ((val & 3) == 3) {
		ov->subtype = CC_OV6630;
		PINFO("Camera chip is an OV6630AF");
	}

	if (ov->subtype == CC_OV6620)
		ov->sops = &ov6x20_ops;
	else
		ov->sops = &ov6x30_ops;

	return 0;
}
예제 #3
0
static void timer_event(unsigned long data) 
{
	/* TODO Auto-generated Function */
	PINFO("my_input_dev_timer executing\n");
	//
	input_report_key(my_input_dev_priv->dev,KEY_A ,1);
	input_report_key(my_input_dev_priv->dev,KEY_A ,0);
	input_report_key(my_input_dev_priv->dev,KEY_B ,1);
	input_report_key(my_input_dev_priv->dev,KEY_B ,0);
	input_sync(my_input_dev_priv->dev);
	//
	my_input_dev_timer.expires = jiffies + MY_INPUT_DEV_DELAY_MS * HZ / 1000;
	add_timer(&my_input_dev_timer);

}
예제 #4
0
파일: ctrlg.c 프로젝트: marvelliu/lilacsrc
void ctrl_g_defence_original()
{
	char buf[200];
	if (RINFO.turn==mypos&& (PINFO(mypos).flag & PEOPLE_ALIVE))
	{
		if (PINFO(mypos).flag & PEOPLE_BAD)
		{
			if (RINFO.voted[mypos]!=-2)
			{
				sprintf (buf, "\33[31m你想崩溃了\33[m");
				RINFO.voted[mypos]=-2;
			}
			else
			{
				sprintf(buf,"\33[31m你不想崩溃了\33[m");
				RINFO.voted[mypos]=-1;
			}
		}
		else
			sprintf(buf,"不能崩溃");
		send_msg(mypos,buf);
		kill_msg(mypos);
	}
}
예제 #5
0
static int __init my_uart_init(void)
{
    /* TODO Auto-generated Function Stub */

    int res;
    int i;

    my_uart_tty = alloc_tty_driver(MY_UART_N_MINORS);
    if (!my_uart_tty) {
        PERR("TTY Driver allocation failed\n");
        return -ENOMEM;
    }

    my_uart_tty_initialization();

    tty_set_operations(my_uart_tty, &my_uart_tops);

    res= tty_register_driver(my_uart_tty);
    if(res) {
        PERR("Failed to register the tty driver\n");
        return res;
    }

    for (i = 0; i < MY_UART_N_MINORS; i++) {

        init_timer(&devices[i].my_uart_timer1);
        devices[i].my_uart_timer1.data = &devices[i]; //TODO
        devices[i].my_uart_timer1.function = my_timer;
        devices[i].my_uart_timer1.expires = jiffies + MY_UART_DELAY_MS * HZ / 1000;

        tty_port_init(&devices[i].port);

#if LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0)
        tty_register_device(my_uart_tty, i, NULL);
#else
        tty_port_register_device(&devices[i].port, my_uart_tty, i, NULL);
#endif
    }

    PINFO("INIT\n");

    init_timer(&my_uart_timer);
    my_uart_timer.data = 100; //TODO
    my_uart_timer.function = my_timer;
    my_uart_timer.expires = jiffies + MY_UART_DELAY_MS * HZ / 1000;

    return 0;
}
예제 #6
0
static GncHook *
gnc_hook_lookup (const gchar *name)
{
    GncHook *hook;

    ENTER("name %s", name);
    if (gnc_hooks_list == NULL)
    {
        PINFO("no hook lists");
        gnc_hooks_init();
    }

    hook = g_hash_table_lookup(gnc_hooks_list, name);
    LEAVE("hook list %p", hook);
    return(hook);
}
예제 #7
0
bool
qof_object_compliance (QofIdTypeConst type_name, bool warn)
{
    const QofObject *obj;

    obj = qof_object_lookup(type_name);
    if ((obj->create == NULL) || (obj->foreach == NULL))
    {
        if (warn)
        {
            PINFO (" Object type %s is not fully QOF compliant", obj->e_type);
        }
        return false;
    }
    return true;
}
/**
 * KEXT Module BSD entry point
 */
static kern_return_t VBoxVFSModuleLoad(struct kmod_info *pKModInfo, void *pvData)
{
    int rc;

    /* Initialize the R0 guest library. */
#if 0
    rc = vboxInit();
    if (RT_FAILURE(rc))
        return KERN_FAILURE;
#endif

    PINFO("VirtualBox " VBOX_VERSION_STRING " shared folders "
          "driver is loaded");

    return KERN_SUCCESS;
}
예제 #9
0
void
ap_assistant_finish (GtkAssistant *assistant, gpointer user_data)
{
    AcctPeriodInfo *info = user_data;
    GtkTextBuffer * buffer;
    GtkTextIter startiter, enditer;
    gint len;
    const char *btitle;
    char *bnotes;

    ENTER("info=%p", info);

    btitle = gtk_entry_get_text (GTK_ENTRY(info->book_title));
    buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(info->book_notes));
    len = gtk_text_buffer_get_char_count (buffer);
    gtk_text_buffer_get_iter_at_offset(buffer, &startiter, 0);
    gtk_text_buffer_get_iter_at_offset(buffer, &enditer, len);

    bnotes = gtk_text_buffer_get_text(buffer, &startiter, &enditer , 0);
    PINFO("Book title is - %s\n", btitle);

    g_free(bnotes);

    /* Report the status back to the user. */
    info->close_status = 0;  /* XXX fixme success or failure? */

    /* Find the next closing date ... */
    info->prev_closing_date = info->closing_date;
    recurrenceListNextInstance (info->period, &info->prev_closing_date,
				&info->closing_date);


    /* FIXME Test for valid closing date, not sure why it won't be!!! */
    if (g_date_valid(&info->closing_date) == TRUE)
    {
        /* If the next closing date is in the future, then we are done. */
        if (gnc_time (NULL) >
	    gnc_time64_get_day_end_gdate (&info->closing_date))
        {
            /* Load up the GUI for the next closing period. */
            gnc_frequency_setup_recurrence (info->period_menu, NULL,
					    &info->closing_date);
            /* Jump back to the Close Book page. */
            gtk_assistant_set_current_page (GTK_ASSISTANT(info->window), 1);
        }
    }
}
예제 #10
0
/* A helper function intended to be called only from set_column_type_price */
void GncPriceImport::update_price_props (uint32_t row, uint32_t col, GncPricePropType prop_type)
{
    if (prop_type == GncPricePropType::NONE)
        return; /* Only deal with price related properties. */

    auto price_props = std::make_shared<GncImportPrice> (*(std::get<PL_PREPRICE>(m_parsed_lines[row])).get());

    if (col >= std::get<PL_INPUT>(m_parsed_lines[row]).size())
        price_props->reset (prop_type); //reset errors
    else
    {
        auto value = std::get<PL_INPUT>(m_parsed_lines[row]).at(col);
        bool enable_test_empty = true;
        try
        {
            // set the from_commodity based on combo so we can test for same.
            if (prop_type == GncPricePropType::TO_CURRENCY)
            {
                if (m_settings.m_from_commodity)
                    price_props->set_from_commodity (m_settings.m_from_commodity);

                if (m_settings.m_to_currency)
                    enable_test_empty = false;
            }
            // set the to_currency based on combo so we can test for same.
            if (prop_type == GncPricePropType::FROM_COMMODITY)
            {
                if (m_settings.m_to_currency)
                    price_props->set_to_currency (m_settings.m_to_currency);

                if (m_settings.m_from_commodity)
                    enable_test_empty = false;
            }
            price_props->set(prop_type, value, enable_test_empty);
        }
        catch (const std::exception& e)
        {
            /* Do nothing, just prevent the exception from escalating up
             * However log the error if it happens on a row that's not skipped
             */
            if (!std::get<PL_SKIP>(m_parsed_lines[row]))
                PINFO("User warning: %s", e.what());
        }
    }
    /* Store the result */
    std::get<PL_PREPRICE>(m_parsed_lines[row]) = price_props;
}
예제 #11
0
int init_cdev(void)
{
	int result = 0;	
	dev_t dev = 0;	
	struct device *nmc_dev;		
	
	PINFO("%s\n", __FUNCTION__);	
	/*	
	*	create the character device	
	*/	
	result = alloc_chrdev_region(&dev, nmc_cdev_minor, 1, NMC_DEV_NAME);	
	nmc_cdev_major = MAJOR(dev);		
	if (result < 0) {		
		PERR("%s: fail to register cdev\n", __FUNCTION__);		
		return result;	
	}	
	
	printk("%s: nmc_cdev_major %d\n", __FUNCTION__, nmc_cdev_major);		
	
	cdev_init(&nmc_device_cdev, &nmc_dev_fops);	
	result = cdev_add (&nmc_device_cdev, dev, 1);	
	if (result) {		
		PERR("%s: fail cdev_add, err=%d\n", __FUNCTION__, result);		
		goto fail;	
	}	
	/*
	*	create the device node	
	*/	
	nmc_device_class = class_create(THIS_MODULE, NMC_DEV_NAME);	
	if(IS_ERR(nmc_device_class)) {		
		PERR("%s:  class create failed\n", __FUNCTION__);		
		result = -EFAULT;		
		goto fail;	
	}	
	nmc_dev = device_create(nmc_device_class, NULL, MKDEV(nmc_cdev_major, nmc_cdev_minor), NULL, NMC_DEV_NAME);	
	if(IS_ERR(nmc_dev)) {		
		PERR("%s:  device create failed\n", __FUNCTION__);		
		result = -EFAULT;		
		goto fail;	
	}		
	
	return 0;
fail:	
	deinit_cdev();	
	return result;
}
예제 #12
0
static irqreturn_t me8200_do_isr(int irq, void *dev_id, struct pt_regs *regs)
#endif
{
	me8200_do_subdevice_t *instance;
	uint16_t ctrl;
	uint8_t irq_status;

	instance = (me8200_do_subdevice_t *) dev_id;

	if (irq != instance->irq) {
		PERROR("Incorrect interrupt num: %d.\n", irq);
		return IRQ_NONE;
	}

	irq_status = inb(instance->irq_status_reg);
	if (!
	    (irq_status &
	     (ME8200_DO_IRQ_STATUS_BIT_ACTIVE << instance->do_idx))) {
		PINFO
		    ("%ld Shared interrupt. %s(): idx=%d irq_status_reg=0x%04X\n",
		     jiffies, __func__, instance->do_idx, irq_status);
		return IRQ_NONE;
	}

	PDEBUG("executed.\n");

	spin_lock(&instance->subdevice_lock);
	instance->rised = 1;
	instance->count++;

	spin_lock(instance->irq_mode_lock);
	ctrl = inw(instance->irq_ctrl_reg);
	ctrl |= ME8200_IRQ_MODE_BIT_CLEAR_POWER << instance->do_idx;
	outw(ctrl, instance->irq_ctrl_reg);
	PDEBUG_REG("irq_ctrl_reg outw(0x%lX+0x%lX)=0x%x\n", instance->reg_base,
		   instance->irq_ctrl_reg - instance->reg_base, ctrl);
	ctrl &= ~(ME8200_IRQ_MODE_BIT_CLEAR_POWER << instance->do_idx);
	outw(ctrl, instance->irq_ctrl_reg);
	PDEBUG_REG("irq_ctrl_reg outw(0x%lX+0x%lX)=0x%x\n", instance->reg_base,
		   instance->irq_ctrl_reg - instance->reg_base, ctrl);
	spin_unlock(instance->irq_mode_lock);
	spin_unlock(&instance->subdevice_lock);
	wake_up_interruptible_all(&instance->wait_queue);

	return IRQ_HANDLED;
}
/**
 * Wait for VBoxGuest.kext to be started
 */
IOService * org_virtualbox_VBoxVFS::waitForCoreService(void)
{
    IOService *service;

    OSDictionary *serviceToMatch = serviceMatching("org_virtualbox_VBoxGuest");
    if (!serviceToMatch)
    {
        PINFO("unable to create matching dictionary");
        return false;
    }

    /* Wait 10 seconds for VBoxGuest to be started */
    service = waitForMatchingService(serviceToMatch, 10ULL * 1000000000ULL);
    serviceToMatch->release();

    return service;
}
예제 #14
0
static void
ap_show_menu (GnomeDruidPage *druidpage,
              GtkWidget *druid,
              gpointer user_data)
{
    AcctPeriodInfo *info = user_data;
    ENTER("info=%p", info);

    /* Find the date of the earliest transaction in the current book.
     * Note that this could have changed since last time, since
     * we may have closed books since last time. */
    info->earliest = get_earliest_in_book (gnc_get_current_book());
    info->earliest_str = qof_print_date(info->earliest);
    PINFO ("date of earliest is %ld %s", info->earliest, ctime (&info->earliest));

    prepare_remarks (info);
}
예제 #15
0
/* ================================================================= */
static void
create_slots_tables( GncSqlBackend* be )
{
    gint version;
    gboolean ok;

    g_return_if_fail( be != NULL );

    version = gnc_sql_get_table_version( be, TABLE_NAME );
    if ( version == 0 )
    {
        (void)gnc_sql_create_table( be, TABLE_NAME, TABLE_VERSION, col_table );

        ok = gnc_sql_create_index( be, "slots_guid_index", TABLE_NAME, obj_guid_col_table );
        if ( !ok )
        {
            PERR( "Unable to create index\n" );
        }
    }
    else if ( version < TABLE_VERSION )
    {
        /* Upgrade:
            1->2: 64-bit int values to proper definition, add index
            2->3: Add gdate field
        */
        if ( version == 1 )
        {
            gnc_sql_upgrade_table( be, TABLE_NAME, col_table );
            ok = gnc_sql_create_index( be, "slots_guid_index", TABLE_NAME, obj_guid_col_table );
            if ( !ok )
            {
                PERR( "Unable to create index\n" );
            }
        }
        else if ( version == 2 )
        {
            ok = gnc_sql_add_columns_to_table( be, TABLE_NAME, gdate_col_table );
            if ( !ok )
            {
                PERR( "Unable to add gdate column\n" );
            }
        }
        (void)gnc_sql_set_table_version( be, TABLE_NAME, TABLE_VERSION );
        PINFO("Slots table upgraded from version %d to version %d\n", version, TABLE_VERSION);
    }
}
예제 #16
0
파일: joker2.c 프로젝트: marvelliu/lilacsrc
void joker2_timeout_skip()
{
    int who;
    who=RINFO.secretvotelist[RINFO.turn];
    if (RINFO.round==-1)
    {
        send_msg(RINFO.turn, "该你出牌了,快一点!");
        kill_msg(RINFO.turn);
    }
    else
    {
        send_msg(RINFO.turn, "超时了,放弃出牌。");
        kill_msg(RINFO.turn);
        joker2_pass_msg(RINFO.turn);
        PINFO(RINFO.turn).flag |=PEOPLE_VOTED;
        joker2_next_player(0);
    }
}
예제 #17
0
static void
prepare_remarks (AcctPeriodInfo *info)
{
    int nperiods;
    GDate period_begin, period_end, date_now;
    const char *remarks_text;
    char * str;
    ENTER ("info=%p", info);

    /* Pull info from widget, push into freq spec */
    //gnc_frequency_save_state (info->period_menu, info->period, &info->closing_date);
    recurrenceListFree(&info->period);
    gnc_frequency_save_to_recurrence(info->period_menu, &info->period, &info->closing_date);

    /* Count the number of periods that would be generated. */
    g_date_clear (&period_begin, 1);
    g_date_clear (&period_end, 1);
    g_date_clear (&date_now, 1);
    nperiods = 0;
    period_end = info->closing_date;
    g_date_set_time_t (&date_now, time(NULL));

    while (0 > g_date_compare(&period_end, &date_now ))
    {
        nperiods ++;
        PINFO ("period=%d end date=%d/%d/%d", nperiods,
               g_date_get_month(&period_end),
               g_date_get_day(&period_end),
               g_date_get_year(&period_end));
        period_begin = period_end;
        recurrenceListNextInstance(info->period, &period_begin, &period_end);
    }

    /* Display the results */
    remarks_text =
        _("The earliest transaction date found in this book is %s. "
          "Based on the selection made above, this book will be split "
          "into %d books.  Click on 'Forward' to start closing the "
          "earliest book.");
    str = g_strdup_printf (remarks_text, info->earliest_str, nperiods);
    gtk_label_set_text (info->period_remarks, str);
    g_free (str);
}
예제 #18
0
void time_init()
{
	char utc_time[32] = "";
	int err;

	gettimeofday(&g_start_time, NULL);

	g_cp_dft = &g_cp_hr;
	err = g_cp_dft->init(g_cp_dft);

	get_curr_time_str(utc_time, sizeof(utc_time));
	PINFO("cp init rslt: %d tick start: %ld:%ld, tick resolution: %ld:%ld utc_time: %s",
			err,
			g_cp_dft->start.tv_sec,
			g_cp_dft->start.tv_nsec,
			g_cp_dft->res.tv_sec,
			g_cp_dft->res.tv_nsec,
			utc_time);
}
예제 #19
0
static int read_values_from_flash( int i_iAreaNum, unsigned long *o_pulDataBuf, unsigned short i_usDataSize )
{
	int iCurrentBlock = -1;
	int iAreaBaseOffset;
	off_t iBlockStartAddress;
	int iAddress = 0;
	int iItr = 0;

	// Check out arguments			 
	if( i_iAreaNum < MIN_AREA_NUM || MAX_AREA_NUM < i_iAreaNum
		|| o_pulDataBuf == NULL
		|| i_usDataSize > ( BUP_BLOCK_SIZE - 8 ) ){
		PERROR( "RomMgr: Invalid argument : Area Number = %d, Request Size = %d", i_iAreaNum, i_usDataSize );
		return 10;
	}

	// Search latest block			 
	search_current_block( &iCurrentBlock, i_iAreaNum );
	if( iCurrentBlock < 0 ){
		PERROR( "RomMgr: FAIL to find Current Block : Area Number = %d", i_iAreaNum );
		return 11;
	}

	// Calcurate start address of the area	 
	iAreaBaseOffset = AREA_SIZE*( i_iAreaNum - 1 );

	// Calcurate offset address of the block
	iBlockStartAddress = iAreaBaseOffset + BUP_BLOCK_SIZE*iCurrentBlock;

	// Seek to the start address of the block
	// 8 = size of INDEX & CRC
	iAddress = iBlockStartAddress + 8 + (BASE_ADDRESS + 0x80000000);

	// Read values form memory
	for ( iItr = 0; iItr < (int)(i_usDataSize/4); iItr+=1 ) {
		o_pulDataBuf[iItr] = *(unsigned long *)(iAddress+ iItr * 4);
		PINFO( "RomMgr: read data : Address[%08x] = %08x ",
			(iAddress + iItr * 4), (*(unsigned long *)(iAddress+iItr*4)) );
	}

	return 0;
}
예제 #20
0
/* gnc_configure_date_completion
 *    sets dateCompletion to the current value on the scheme side.
 *    QOF_DATE_COMPLETION_THISYEAR: use current year
 *    QOF_DATE_COMPLETION_SLIDING: use a sliding 12-month window
 *    backmonths 0-11: windows starts this many months before current month
 *
 * Args: Nothing
 * Returns: Nothing
 */
static void
gnc_configure_date_completion (void)
{
    char *date_completion = gnc_gconf_get_string(GCONF_GENERAL,
                            KEY_DATE_COMPLETION, NULL);
    int backmonths = gnc_gconf_get_float(GCONF_GENERAL,
                                         KEY_DATE_BACKMONTHS, NULL);
    QofDateCompletion dc;

    if (backmonths < 0)
    {
        backmonths = 0;
    }
    else if (backmonths > 11)
    {
        backmonths = 11;
    }

    if (date_completion && strcmp(date_completion, "sliding") == 0)
    {
        dc = QOF_DATE_COMPLETION_SLIDING;
    }
    else if (date_completion && strcmp(date_completion, "thisyear") == 0)
    {
        dc = QOF_DATE_COMPLETION_THISYEAR;
    }
    else
    {
        /* No preference has been set yet */
        PINFO("Incorrect date completion code, using defaults");
        dc = QOF_DATE_COMPLETION_THISYEAR;
        backmonths = 6;
        gnc_gconf_set_string (GCONF_GENERAL, KEY_DATE_COMPLETION, "thisyear", NULL);
        gnc_gconf_set_float (GCONF_GENERAL, KEY_DATE_BACKMONTHS, 6.0, NULL);
    }
    qof_date_completion_set(dc, backmonths);

    if (date_completion != NULL)
    {
        free(date_completion);
    }
}
예제 #21
0
/* get called when device node "open" by user thread */
static int chrdev_framework_open(struct inode *inode,struct file *filp)
{
	/* inode->i_cdev 就是 cdev_add() 添加到内核到 cdev 数据实例;
	 * 本模块定义来一个私有到数据结构 chrdev_framework_private, 包含一个 cdev 成员, 通过 open 传回到 cdev 实例, 使用 container_of()
	 * 反向查找 chrdev_framework_private 实例
	 * 通常使用 filp->private_data 成员来存储 chrdev_framework_private 实例,以便其他 file operation 方法使用, 每个方法都有 filp 参数*/

	/* TODO Auto-generated Function */

	chrdev_framework_private *priv = container_of(inode->i_cdev ,
									chrdev_framework_private ,cdev);
	filp->private_data = priv;

//	memset(priv->buff, 0, CHRDEV_FRAMEWORK_BUFF_SIZE);
	priv->pointer = 0;

	PINFO("In char driver open() function\n");

	return 0;
}					
예제 #22
0
/* 在内核模块卸载时被调用 */
static void __exit chrdev_framework_exit(void)
{	
	/* 卸载模块之前的释放操作, 是 _init 函数到逆过程 */

	/* TODO Auto-generated Function Stub */

	int i;

	PINFO("EXIT\n");

	for(i=0;i<CHRDEV_FRAMEWORK_N_MINORS;i++) {
		chrdev_framework_device_num= MKDEV(chrdev_framework_major ,CHRDEV_FRAMEWORK_FIRST_MINOR+i);

		cdev_del(&devices[i].cdev);

	}

	unregister_chrdev_region(chrdev_framework_device_num ,CHRDEV_FRAMEWORK_N_MINORS);	

}
예제 #23
0
파일: Scrub.c 프로젝트: CAARNICL/gnucash
void
xaccAccountScrubOrphans (Account *acc)
{
    GList *node;
    const char *str;

    if (!acc) return;

    str = xaccAccountGetName (acc);
    str = str ? str : "(null)";
    PINFO ("Looking for orphans in account %s \n", str);

    for (node = xaccAccountGetSplitList(acc); node; node = node->next)
    {
        Split *split = node->data;

        TransScrubOrphansFast (xaccSplitGetParent (split),
                               gnc_account_get_root (acc));
    }
}
예제 #24
0
파일: spd_drct.c 프로젝트: kierank/p2card
int drct_read(spd_dev_t *dev)
{
  int retval;
  u32 sector;
  u16 count;
  unsigned long flags = 0;
  struct request *req = dev->bdev->req;
  PTRACE();

  dev->bdev->hard_nr_sectors = req->hard_nr_sectors;

  retval = drct_make_sg(dev);
  if(unlikely(retval < 0)){
    PERROR("<spd%c>drct_make_sg() failed(%d)", dev->id+'a', retval);
    goto ABORT;
  }

  sector                = req->sector;
  count                 = req->hard_nr_sectors;
  dev->retry            = dev->dma_retry;
  dev->timeout          = dev->dma_timeout;
  dev->complete_handler = drct_read_complete_handler;
  retval = spd_read_sector(dev, sector, count, dev->sg);
  if(unlikely(retval < 0)){
    PERROR("<spd%c>spd_read_sector() failed(%d)", dev->id+'a', retval);
    goto ABORT;
  }

  return 0;

ABORT:
  PINFO("<spd%c>ABORT at %s", dev->id+'a', __FUNCTION__);
  spin_lock_irqsave(&dev->bdev->rq_lock, flags);
  bdev_end_request(dev, retval);
  spin_unlock_irqrestore(&dev->bdev->rq_lock, flags);

  dev->complete_handler = NULL;
  spd_io_unlock(dev);

  return retval;
}
예제 #25
0
static void __exit my_uart_exit(void)
{
    /* TODO Auto-generated Function Stub */

    int i;

    del_timer(&my_uart_timer);

    PINFO("EXIT\n");

    for (i = 0; i < MY_UART_N_MINORS; i++) {

        del_timer(&devices[i].my_uart_timer1);

        tty_unregister_device(my_uart_tty, i);
    }

    tty_unregister_driver(my_uart_tty);
    put_tty_driver(my_uart_tty);

}
예제 #26
0
/**
 * test_request_free_channels - Tests request_dma for all the channels. It
 * assumes all channels are free. It requests all the channels and expect to
 * get 0 as return value
 *
 * returns: 	0 - success
 * 		-1 - failure
 */
static int test_request_free_channels(void)
{
	int status = 0;
	unsigned int i;
	int st;

	PDBG("inside test_request_free_channels\n");

	for (i = 0; i < TEST_MAX_CHANNELS; i++) {
		st = request_dma(i, DRIVER_NAME);
		if (st == 0) {
			PDBG("request_dma(%d) free = %d %s\n", i, st, PASS);
		} else {
			PDBG("request_dma(%d) free = %d %s\n", i, st, FAIL);
			status = -1;
		}
	}
	PINFO("test_request_free_channels %s\n", (status ? FAIL : PASS));

	return status;
}
예제 #27
0
static int __init my_watchdog_init(void)
{
	/* TODO Auto-generated Function Stub */

	int res;

	res = misc_register(&my_watchdog_misc);
	if(res<0) {
		PERR("misc device registration failed\n");
		return -1;
	}

	PINFO("INIT\n");

	init_timer(&my_watchdog_timer);
	my_watchdog_timer.data = 100; //TODO 
	my_watchdog_timer.function = timer_evt;
	my_watchdog_timer.expires = jiffies + MY_WATCHDOG_DELAY_MS * HZ / 1000;

	return 0;
}
예제 #28
0
template<> StrVec
GncDbiProviderImpl<DbType::DBI_PGSQL>::get_index_list (dbi_conn conn)
{
    StrVec retval;
    const char* errmsg;
    PINFO ("Retrieving postgres index list\n");
    auto result = dbi_conn_query (conn,
                                  "SELECT relname FROM pg_class AS a INNER JOIN pg_index AS b ON (b.indexrelid = a.oid) INNER JOIN pg_namespace AS c ON (a.relnamespace = c.oid) WHERE reltype = '0' AND indisprimary = 'f' AND nspname = 'public'");
    if (dbi_conn_error (conn, &errmsg) != DBI_ERROR_NONE)
    {
        PWARN("Index Table Retrieval Error: %s\n", errmsg);
        return retval;
    }
    while (dbi_result_next_row (result) != 0)
    {
        std::string index_name {dbi_result_get_string_idx (result, 1)};
        retval.push_back(index_name);
    }
    dbi_result_free (result);
    return retval;
}
예제 #29
0
/* ================================================================= */
static void
create_prices_tables (GncSqlBackend* be)
{
    gint version;

    g_return_if_fail (be != NULL);

    version = gnc_sql_get_table_version (be, TABLE_NAME);
    if (version == 0)
    {
        (void)gnc_sql_create_table (be, TABLE_NAME, TABLE_VERSION, col_table);
    }
    else if (version == 1)
    {
        /* Upgrade 64 bit int handling */
        gnc_sql_upgrade_table (be, TABLE_NAME, col_table);
        (void)gnc_sql_set_table_version (be, TABLE_NAME, TABLE_VERSION);

        PINFO ("Prices table upgraded from version 1 to version %d\n", TABLE_VERSION);
    }
}
예제 #30
0
/*
 *  Cleanup
 */
void exit_zion_vga(void)
{
	zion_params_t *params = find_zion(0);

	//Check Fireball
	if((params->revision & 0xF000) == 0xF000){
		return;
	}

	/*
	 * If your driver supports multiple boards, you should unregister and
	 * clean up all instances.
	 */
	unregister_framebuffer(&zion_fb_info.fb_info);

	free_pages(zion_fb_info.ram_address, ZIONVGA_VRAM_ORDER);

	fb_dealloc_cmap(&zion_fb_info.fb_info.cmap);

	PINFO("ZION VGA cleanup\n");
}