Exemplo n.º 1
0
/* execute a stand-alone statement with no % formatting of the string */
bool
sql_execNF(const char *stmt)
{
    bool ok = execInternal(stmt, 1);
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    exclist = 0;
    return ok;
}				/* sql_execNF */
Exemplo n.º 2
0
/* run a select statement with no % formatting of the string */
bool
sql_selectNF(const char *stmt, ...)
{
    bool rowfound;
    va_start(sqlargs, stmt);
    rowfound = execInternal(stmt, 2);
    retsFromOdbc();
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    return rowfound;
}				/* sql_selectNF */
Exemplo n.º 3
0
/* return true if the row was found */
bool
sql_select(const char *stmt, ...)
{
    bool rowfound;
    va_start(sqlargs, stmt);
    stmt = lineFormatStack(stmt, 0, &sqlargs);
    rowfound = execInternal(stmt, 2);
    retsFromOdbc();
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    return rowfound;
}				/* sql_select */
Exemplo n.º 4
0
/* run a stored procedure with no % formatting */
static bool
sql_procGo(const char *stmt)
{
    bool rowfound;
    char *s = allocMem(20 + strlen(stmt));
    strcpy(s, "execute procedure ");
    strcat(s, stmt);
    rowfound = execInternal(s, 3);
    /* if execInternal doesn't return, we have a memory leak */
    nzFree(s);
    return rowfound;
}				/* sql_procGo */
Exemplo n.º 5
0
/* execute a stand-alone statement with % formatting */
bool
sql_exec(const char *stmt, ...)
{
    bool ok;
    va_start(sqlargs, stmt);
    stmt = lineFormatStack(stmt, 0, &sqlargs);
    ok = execInternal(stmt, 1);
    SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
    exclist = 0;
    va_end(sqlargs);
    return ok;
}				/* sql_exec */
Exemplo n.º 6
0
/* run a select statement with one return value */
int
sql_selectOne(const char *stmt, ...)
{
    bool rowfound;
    va_start(sqlargs, stmt);
    stmt = lineFormatStack(stmt, 0, &sqlargs);
    rowfound = execInternal(stmt, 2);
    if(!rowfound) {
	SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
	exclist = 0;
	va_end(sqlargs);
	return nullint;
    }
    return oneRetValue(0, 0);
}				/* sql_selectOne */
Exemplo n.º 7
0
void PDF2PPT::exec()
{
    QString command = "pdftoppm";
    QStringList args;
    args << "-jpeg";
    if (getStopPage() > 0) {
        if (getStartPage() == 0)
            this->setStartPage("1");
        args << "-f" << QString::number(getStartPage()) << "-l" << QString::number(getStopPage());
    }
    args << "-rx" << "600" << "-ry" << "600" << this->getSourcePDF();
    setOutputPrefix(getOutputDir().append("page"));
    args << getOutputPrefix();
    setOutputExtension("jpg");
    execInternal(command, args);
}
Exemplo n.º 8
0
void GhostScr::exec()
{
    QString command = "gs";
    QStringList args;
    args << "-SDEVICE=jpeg" << "-r1200x1200" << "-sPAPERSIZE=letter" << "-dNOPAUSE" << "-dBATCH";
    if ((!getStopPage().isEmpty()) || (getStopPage().toInt() > 0)) {
        if (getStartPage().toInt() == 0)
              this->setStartPage("1");
        args << QString("-dFirstPage=").append(getStartPage()) << QString("-dLastPage=").append(getStopPage());
    }
    if (!getOutputDir().endsWith("/"))
        setOutputDir(getOutputDir().append('/'));
    setOutputPrefix(getOutputDir().append("page"));
    args << QString("-sOutputFile=").append(getOutputPrefix()).append("_%04d.jpg");
    args << "--" << this->getSourcePDF();
    setOutputExtension("jpg");
    execInternal(command, args);
}