Source: kdbx/libdbx.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          libdbx.h  -  Header file for DBX handling Library
                             -------------------
    begin                : April 2001
    copyright            : (C) 2001 by David Smith
    email                : Dave.S@Earthcorp.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

/*
	libdbx - read dbx files as used by Outlook Express 5.0

*/

#ifndef _LIBDBX_H_
#define _LIBDBX_H_

#include <stdio.h>

#define LIBDBX_VERSION "0.1"

/* Control Structure */
struct dbxcontrolstruct {
	FILE *fd; //file descriptor of the dbx file
	int indexCount; //number of elements in the following array
	int * indexes; //array of indexes
	int type; //type of DBX file
};

typedef struct dbxcontrolstruct DBX;

/* Folder Entity - Extracted from folders.dbx */
struct dbxfolderstruct {
	char *name; //name of folder
	char *fname; //filename of the folder
	int id; //numeric id of the folder
	int parentid; //numeric id of the parent folder
};

typedef struct dbxfolderstruct DBXFOLDER;

/* Email Entity - Extracted from a mail type .dbx file */
struct dbxemailstruct {
  char *email;
  char *subject;
  char *messageid;
  char *parent_message_ids;
  char *sender_name;
  char *sender_address;
  char *recip_name;
  char *recip_address;
  int  id;
};

typedef struct dbxemailstruct DBXEMAIL;

/* Global Variables */
extern int dbx_errno;

/* DBX Errors */
/*0 - No error. i.e. Success */
#define DBX_NOERROR 0
/*1 - dbx file operation failed (open or close)*/
#define DBX_BADFILE 1
/*2 - Reading of Item Count from dbx file failed */
#define DBX_ITEMCOUNT 2
/*3 - Reading of Index Pointer from dbx file failed */
#define DBX_INDEX_READ 3
/*4 - Number of indexes read from dbx file is less than expected*/
#define DBX_INDEX_UNDERREAD 4
/*5 - Number of indexes read from dbx file is greater than expected*/
#define DBX_INDEX_OVERREAD 5
/*6 - Request was made for index reference greater than exists (subscript out of range)*/
#define DBX_INDEXCOUNT 6
/*7 - Reading of data from dbx file failed */
#define DBX_DATA_READ 7
/*8 - Item is a news item not an email*/
#define DBX_NEWS_ITEM 8

/* Prototypes */
#ifdef __cplusplus
extern "C" {
#endif

DBX *dbx_open(char*);
DBX *dbx_open_stream(FILE *fp);
int dbx_close(DBX*);
int dbx_free(DBX *dbx, void *item);
void* dbx_get(DBX*, int);
int dbx_perror(char*);

#ifdef __cplusplus
}
#endif

/*Types of DBX file*/
/*0 - Contains emails*/
#define DBX_TYPE_EMAIL 0
/*1 - Contains news group items*/
#define DBX_TYPE_NEWS 1
/*2 - Contains the folder structure of Outlook*/
#define DBX_TYPE_FOLDER 2

#endif //_LIBDBX_H_

Generated by: dave@davepc on Sun May 13 17:03:35 2001, using kdoc 2.0a42.