!C99Shell v. 1.0 pre-release build #16!

Software: Apache/2.0.54 (Fedora). PHP/5.0.4 

uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 

uid=48(apache) gid=48(apache) groups=48(apache)
context=system_u:system_r:httpd_sys_script_t
 

Safe-mode: OFF (not secure)

/usr/share/doc/db4-devel-4.3.27/examples_c/   drwxr-xr-x
Free 3.8 GB of 27.03 GB (14.06%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     ex_sequence.c (2.6 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1997-2004
*    Sleepycat Software.  All rights reserved.
*
* $Id: ex_sequence.c,v 1.3 2004/10/14 18:12:13 bostic Exp $
*/

#include <sys/types.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef _WIN32
extern int getopt(int, char * const *, const char *);
#else
#include <unistd.h>
#endif

#include <db.h>

#define    DATABASE    "sequence.db"
#define    SEQUENCE    "my_sequence"
int main __P((int, char *[]));
int usage __P((void));

int
main(argc, argv)
    int argc;
    char *argv[];
{
    extern int optind;
    DB *dbp;
    DB_SEQUENCE *seq;
    DBT key;
    int i, ret, rflag;
    db_seq_t seqnum;
    char ch;
    const char *database, *progname = "ex_sequence";

    rflag = 0;
    while ((ch = getopt(argc, argv, "r")) != EOF)
        switch (ch) {
        case 'r':
            rflag = 1;
            break;
        case '?':
        default:
            return (usage());
        }
    argc -= optind;
    argv += optind;

    /* Accept optional database name. */
    database = *argv == NULL ? DATABASE : argv[0];

    /* Optionally discard the database. */
    if (rflag)
        (void)remove(database);

    /* Create and initialize database object, open the database. */
    if ((ret = db_create(&dbp, NULL, 0)) != 0) {
        fprintf(stderr,
            "%s: db_create: %s\n", progname, db_strerror(ret));
        return (EXIT_FAILURE);
    }
    dbp->set_errfile(dbp, stderr);
    dbp->set_errpfx(dbp, progname);
    if ((ret = dbp->open(dbp,
        NULL, database, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
        dbp->err(dbp, ret, "%s: open", database);
        goto err1;
    }

    if ((ret = db_sequence_create(&seq, dbp, 0)) != 0) {
        dbp->err(dbp, ret, "db_sequence_create");
        goto err1;
    }

    memset(&key, 0, sizeof(DBT));
    key.data = SEQUENCE;
    key.size = (u_int32_t)strlen(SEQUENCE);

    if ((ret = seq->open(seq, NULL, &key, DB_CREATE)) != 0) {
        dbp->err(dbp, ret, "%s: DB_SEQUENCE->open", SEQUENCE);
        goto err2;
    }

    for (i = 0; i < 10; i++) {
        if ((ret = seq->get(seq, NULL, 1, &seqnum, 0)) != 0) {
            dbp->err(dbp, ret, "DB_SEQUENCE->get");
            goto err2;
        }

        /* We don't have a portable way to print 64-bit numbers. */
        printf("Got sequence number (%x, %x)\n",
            (int)(seqnum >> 32), (unsigned)seqnum);
    }

    /* Close everything down. */
    if ((ret = seq->close(seq, 0)) != 0) {
        dbp->err(dbp, ret, "DB_SEQUENCE->close");
        goto err1;
    }
    if ((ret = dbp->close(dbp, 0)) != 0) {
        fprintf(stderr,
            "%s: DB->close: %s\n", progname, db_strerror(ret));
        return (EXIT_FAILURE);
    }
    return (EXIT_SUCCESS);

err2:    (void)seq->close(seq, 0);
err1:    (void)dbp->close(dbp, 0);
    return (EXIT_FAILURE);
}

int
usage()
{
    (void)fprintf(stderr, "usage: ex_sequence [-r] [database]\n");
    return (EXIT_FAILURE);
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0033 ]--