load.h

来自「PB 熟悉的哥们希望大家可以互相学习一下」· C头文件 代码 · 共 81 行

H
81
字号
/************************************************************
 *                                                          *
 * Copyright (c) 2001-2007 McObject LLC. All Right Reserved.*
 *                                                          *
 ************************************************************/

/* Main header file for the test
 */

#ifndef LOAD_H__
    #define LOAD_H__

    #include "platform.h"
    #include <stdio.h>
    #include <stdlib.h>
    #include <string.h>
    #ifndef _VXWORKS
        #include <malloc.h>
    #endif 

    #include "mco.h"
    #include "dbtest.h"
    #include "strm.h"

    #define DBSIZE    1024 * 15000
    #ifndef MCO_PLATFORM_X64
        #define PAGESIZE  100
    #else 
        #define PAGESIZE  200
    #endif 

    /* #define USE_LISTS */

    #define STEP      20
    #define OBJCOUNT  100

    #define SUCCESS(x) ((x) == MCO_S_OK)

    #if defined (_VXWORKS)
        static char fname[] = "/tgtsvr/db.dat";
    #elif defined (_WIN32_WCE)
        static char fname[] = "windows\\db.dat";
    #else 
        static char fname[] = "db.dat";
    #endif 

    /* Counters */
    extern uint2 fv;
    extern uint2 dv;
    extern uint2 bv;
    extern uint2 bh;
    extern uint2 iv;

    extern uint2 nh;
    extern uint2 nb;
    extern uint2 nd;
    extern uint2 nf;
    extern uint2 ni;

    static int next_item_id = 1234;

    extern mco_runtime_info_t info;

    int init_database(mco_db_h db);

    int new_fixed(mco_db_h db, int count);
    int new_dynamic(mco_db_h db, int cnt);
    int new_blobs(mco_db_h db, int cnt);
    int new_idx(mco_db_h db, int count);

    int verify_db(mco_db_h db);

    MCO_RET set_cursor(mco_db_h db, mco_cursor_h c, const uint4 code);
    MCO_RET mov_cursor(mco_db_h db, mco_cursor_h c, const uint4 code);

    MCO_RET read_blob(mco_trans_h t, mco_cursor_h c);
    MCO_RET read_fixed(mco_trans_h t, mco_cursor_h c);
    MCO_RET read_dynamic(mco_trans_h t, mco_cursor_h c);
    MCO_RET read_idxs(mco_trans_h t, mco_cursor_h c);
#endif // LOAD_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?