package dbase4

  1. Overview
  2. Docs

Module Dbase4.BaseSource

Sourcetype dbf_file = {
  1. name : string;
    (*

    name of dBASE table or filename

    *)
  2. fin : in_channel;
    (*

    opened database file channel

    *)
  3. memo : in_channel option;
    (*

    opened database memo file channel

    *)
  4. info : dbf_info;
    (*

    description of table structure

    *)
  5. cri : int;
    (*

    current record index

    *)
}

Database file descriptor

Sourceand dbf_info = {
  1. version : dbfile_format;
    (*

    version/format of the database

    *)
  2. mdate : date;
    (*

    modification date

    *)
  3. num_records : int;
    (*

    number of records (include deleted)

    *)
  4. hdr_size : int;
    (*

    header size (in bytes) of the database file

    *)
  5. rec_size : int;
    (*

    the record size in bytes

    *)
  6. fields : dbf_field_descriptor array;
    (*

    array of the field descriptors

    *)
}

Type dbf_info describes the DBF file structure

Sourceand date = {
  1. year : int;
  2. month : int;
  3. day : int;
}

Type date describes date in format (year , month , day)

Sourceand dbf_field_descriptor = {
  1. name : string;
    (*

    name of field

    *)
  2. ftype : dbf_data_type;
    (*

    data type of field

    *)
  3. faddr : int;
    (*

    offset of the field in a memory chunk

    *)
  4. flen : int;
    (*

    length of the field in bytes

    *)
  5. fdec : int;
    (*

    position of decimal point

    *)
  6. work_area_id : int;
    (*

    work ared identity - IT IS NOT USED

    *)
  7. flags : int;
    (*

    internally used flags

    *)
}

Database filed descriptor

Sourceand dbf_data_type =
  1. | Character
    (*

    one char or ASCII-string up to 255 character

    *)
  2. | Number
    (*

    represents any number: integer or real

    *)
  3. | Float
    (*

    represents floating-point number

    *)
  4. | Date
    (*

    represents DATE in format YYYYMMDD

    *)
  5. | Logical
    (*

    logical (boolean) value

    *)
  6. | Memo
    (*

    reference to the MEMO file record/chunk

    *)
  7. | General of int
    (*

    general purpose

    *)
Sourceand dbfile_format =
  1. | DBASE2
  2. | DBASE3_no_memo
  3. | DBASE3_with_memo
  4. | VisualFoxPro
  5. | VisualFoxPro_autoincrement
  6. | VisualFoxPro_Varbinary
  7. | DBASE4_with_memo
  8. | DBASE4_SQL_table_files_no_memo
  9. | DBASE4_SQL_table_files_with_memo
  10. | DBASE4_SQL_system_files_no_memo
Sourceexception DbfDataInvalid of string
Sourceval string_of_zstring : string -> string
Sourceval dbf_open : string -> dbf_file
Sourceval dbf_close : dbf_file -> unit
Sourceval db_goto : dbf_file -> int -> dbf_file
Sourceval db_skip : dbf_file -> int -> dbf_file
Sourceval db_go_top : dbf_file -> dbf_file
Sourceval db_go_bottom : dbf_file -> dbf_file
Sourceval db_bof : dbf_file -> bool
Sourceval read_raw_record : dbf_file -> string
Sourceval read_record : ?with_deleted:bool -> dbf_file -> Bitstring.bitstring option
Sourceval is_deleted : Bitstring.bitstring option -> bool
Sourceval db_next : dbf_file -> dbf_file
Sourceval db_struct : dbf_file -> dbf_field_descriptor array
Sourceval db_lastrec : dbf_file -> int
Sourceval db_find_record : dbf_file -> (Bitstring.bitstring option -> bool) -> int option
Sourceval db_find_record_simple : dbf_file -> (Bitstring.bitstring option -> 'a) -> 'a -> int option
Sourceval db_has_memo_fields : dbf_file -> bool
OCaml

Innovation. Community. Security.