1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133
|
/* (PD) 2001 The Bitzi Corporation
* Please see file COPYING or http://bitzi.com/publicdomain
* for more info.
*
* $Id: bitcollider.h,v 1.7 2001/04/05 23:38:13 mayhemchaos Exp $
*/
#ifndef BITCOLLIDER_H
#define BITCOLLIDER_H
#ifdef WIN32
#include <windows.h>
#define strcasecmp stricmp
#endif
#include "plugin.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef int b_bool;
#ifndef true
#define true 1
#endif
#ifndef false
#define false 0
#endif
#define SUBMIT_URL "http://bitzi.com/lookup/"
#define MAX_PLUGINS 256
#ifndef MAX_PATH
#define MAX_PATH 1024
#endif
typedef struct _PluginInfo
{
PluginMethods *methods;
SupportedFormat *formats;
#ifdef WIN32
HANDLE handle;
#else
void *handle;
#endif
char *file;
} PluginInfo;
typedef struct _Bitcollider
{
PluginInfo plugins[MAX_PLUGINS];
int numPluginsLoaded;
char *warning;
char *error;
void (*progressCallback)(int, const char *, const char *);
b_bool preview;
b_bool exitNow;
} Bitcollider;
typedef struct _BitcolliderSubmission
{
Bitcollider *bc;
Attribute **attrList;
int numBitprints;
int numItems;
int numAllocated;
char *fileName; // The current filename and filesize
unsigned long fileSize;
b_bool autoSubmit;
char *checkAsExt;
int percentComplete;
} BitcolliderSubmission;
typedef enum
{
eBrowserNetscape = 0,
eBrowserMozilla,
eBrowserKonqueror,
eBrowserOpera,
eBrowserLynx
} BrowserEnum;
Bitcollider *bitcollider_init (b_bool printDebugInfo);
void bitcollider_shutdown(Bitcollider *bc);
char *get_error (Bitcollider *bc);
char *get_warning (Bitcollider *bc);
void set_progress_callback(Bitcollider *bc,
void (*progress_func)(int,
const char *,
const char *));
void set_preview (Bitcollider *bc,
b_bool enable);
void set_exit (Bitcollider *bc,
b_bool enable);
BitcolliderSubmission *create_submission (Bitcollider *bc);
void delete_submission (BitcolliderSubmission *tag);
void set_auto_submit (BitcolliderSubmission *tag,
b_bool autoSubmit);
void set_check_as (BitcolliderSubmission *tag,
const char *extension);
b_bool analyze_file (BitcolliderSubmission *tag,
const char *fileName,
b_bool matchingExtsOnly);
b_bool submit_submission (BitcolliderSubmission *tag,
const char *url,
BrowserEnum browser);
int get_num_bitprints (BitcolliderSubmission *sub);
void print_submission (BitcolliderSubmission *tag);
void convert_to_hex (const unsigned char *buffer,
int size,
char *hexBuffer);
void add_attribute (BitcolliderSubmission *tag,
const char *key,
const char *value);
const char *get_attribute (BitcolliderSubmission *tag,
const char *key);
void get_agent_string (char *agentString);
/* For debugging */
void set_plugin_debug (BitcolliderSubmission *tag,
b_bool debug);
/* Misc Win32 Support stuff */
#ifdef _WIN32
void getLongPathName(const char *shortName, int len, char *longName);
#endif
#ifdef __cplusplus
}
#endif
#endif
|