Example #1
0
static void arg_node_set_ptr(arg_node_type * node , void * ptr , arg_node_copyc_ftype * copyc , arg_node_free_ftype * destructor) {
  node->ctype      = CTYPE_VOID_POINTER;
  node->destructor = destructor;
  node->copyc      = copyc; 
  if (copyc != NULL)
    node->buffer = copyc( ptr );
  else
    node->buffer = ptr;
}
Example #2
0
File: structs.c Project: 4rkiel/c
    void mirror (char tab[], int n){
        int k;
        char tab2[n];
        copyc(tab, tab2, n);

        for(k=0; k<n-1; k++){
            tab[k]=tab2[n-k-2];
        }

        return ;
    }
Example #3
0
QueryView::QueryView(Database *database, QString command)
{
    this->database = database;

    //Identify this object with thisTableViewId for constructing database connection
    //specific to this object and this object alone.
    thisQueryViewId = queryViewObjectId++;

    //Thread busy indicator to avoid crashing of app when
    //QueryView receives a close signal before data retrieval.
    thread_busy = false;

    //Start the timer.
    t.start();

    errors_model = new QStandardItemModel(0,1);
    query_model = new QueryModel;
    qview = new QTableView(this);
    qview->resizeColumnsToContents();
    setCentralWidget(qview);
    statusBar()->showMessage(QApplication::translate("QueryView", "Fetching data...", 0, QApplication::UnicodeUTF8));
    //qview->setModel(model);
    //setWindowTitle(name);
    qview->setStyleSheet("QTableView {font-weight: 400;}");
    qview->setAlternatingRowColors(true);
    //setGeometry(100,100,640,480);

    //Create Ctrl+Shift+C key combo to copy selected table contents with headers.
    QShortcut *shortcut_ctrl_c = new QShortcut(QKeySequence::Copy, this);
    connect(shortcut_ctrl_c, SIGNAL(activated()), this, SLOT(copyc()));

    //Create Ctrl+Shift+C key combo to copy selected table contents with headers.
    QShortcut *shortcut_ctrl_shft_c = new QShortcut(QKeySequence("Ctrl+Shift+C"), this);
    connect(shortcut_ctrl_shft_c, SIGNAL(activated()), this, SLOT(copych()));

    //Create key-sequences for fullscreen and restore.
    shortcut_fullscreen = new QShortcut(QKeySequence(Qt::Key_F11), this);
    connect(shortcut_fullscreen, SIGNAL(activated()), this, SLOT(fullscreen()));
    shortcut_restore = new QShortcut(QKeySequence(Qt::Key_Escape), this);
    connect(shortcut_restore, SIGNAL(activated()), this, SLOT(restore()));

    //Tie thread finish to an update slot that refreshes meta-information.
    connect(this, SIGNAL(updRowCntSignal(QString)), this, SLOT(updRowCntSlot(QString)));

    //Tie a busy signal to a slot that changes the cursor to wait cursor.
    connect(this, SIGNAL(busySignal()), this, SLOT(busySlot()));

    QFuture<void> future = QtConcurrent::run(this, &QueryView::fetchData, command);
}
Example #4
0
interact()

{

	int	i, intrpt();
	char	cmd[80], *rest, *index();

	for (;;) {
		if (firsttime++ == 0) {
			signal(SIGINT, intrpt, -1);
			 setret(env);
		}
		if (cmdinp(cmd) < 0)
			return (0);
		rest = index(cmd, ' ');
		if (rest)
			*rest++ = '\0';
		i = chkcmd(cmd);
#ifdef DEBUG
		printf("command: %s, ind: %d\n", cmd, i);
#endif

		switch (i) {
		default:
			errinp;
			break;
		case CMD_DIR:
		case CMD_LS:
			dispdir();
			break;

		case CMD_RENAME:
			rename(rest);
			break;

		case CMD_OCOPY:
			copyc(rest, 0);
			break;

		case CMD_ICOPY:
			pip(rest, 0);
			break;

		case CMD_DELETE:
		case CMD_ERASE:
			delete(rest);
			break;

		case CMD_EXIT:
		case CMD_LOGOUT:
			return(0);

		case CMD_TYPE:
			copy(rest, stdout, 0);
			break;

		case CMD_HELP:
			help();
			break;

		case CMD_OCCOPY:
			copyc(rest, 1);
			break;

		case CMD_ICCOPY:
			pip(rest,1);
			break;

		case CMD_DUMP:
			dump(rest);
			break;

		case CMD_UNIX:
			system(rest);
			break;

		case CMD_DISK:
			disk();
			break;

		}
	}
}