/*
 *  ARchive iDentifier
 *
 *  Copyright (c) 2006-2008, Veacheslav Patkov.
 *  aLL rigths reserved.
 *
 *  plugin.h : plugin interface
 *
 */

#ifndef _PLUGIN_H_
#define _PLUGIN_H_

#include <windows.h>

#define PLUGINS_VERSION_BYTE 1

#define PLUGIN_EXPORT __declspec(dllexport)

#define ARID_ERROR_SUCCESS 0
#define ARID_ERROR_FILEOPEN 1

#define ARID_OP_NONE 0x00
#define ARID_OP_FORCESFX 0x01

#pragma pack(push,1)

typedef struct {
    char *name;
    char *extension;
    char *copyright;
} arinfo;

typedef struct {
    unsigned char arid_version;
    unsigned char plug_version;
    char *fname;
    HWND hwnd;
    int (*processfile)(char *fname, arinfo *info, unsigned int opt);
} plug_interface;

#pragma pack(pop)

#ifdef __cplusplus
extern "C" {
#endif

PLUGIN_EXPORT char *pname(void);
PLUGIN_EXPORT void pmain(plug_interface *pi);

#ifdef __cplusplus
}
#endif

#define ARID_IDC_FILENAME 1007
#define ARID_IDC_TYPE 1008
#define ARID_IDC_EXTENSION 1009
#define ARID_IDC_COPYRIGHT 1010

#endif /* _PLUGIN_H_ */
