open-source-search-engine/Msg2a.h

87 lines
1.6 KiB
C
Raw Normal View History

2013-08-03 00:12:24 +04:00
//
// Copyright Gigablast, March 2005
// Author: Javier Olivares <jolivares@gigablast.com>
//
// Message to remake the catdb, filling it with dmoz category info
//
#ifndef _MSG2A_H_
#define _MSG2A_H_
#include "Url.h"
#include "Hostdb.h"
#include "Msg9b.h"
#define NUM_MINIMSG2AS 8
class Msg2a;
struct MiniMsg2a {
//Multicast m_mcast;
2014-11-11 01:45:11 +03:00
int32_t m_index;
2013-08-03 00:12:24 +04:00
Msg2a *m_parent;
};
class Msg2a {
public:
Msg2a();
~Msg2a();
2014-11-11 01:45:11 +03:00
int32_t fileRead ( int fileid, void *buf, size_t count );
2013-08-03 00:12:24 +04:00
bool registerHandler ( );
// main call to make catdb
bool makeCatdb ( char *coll,
2014-11-11 01:45:11 +03:00
int32_t collLen,
2013-08-03 00:12:24 +04:00
bool updateFromNew,
void *state,
void (*callback)(void *st) );
2014-11-11 01:45:11 +03:00
//bool insertNextUrl ( int32_t num );
2013-08-03 00:12:24 +04:00
bool gotAllReplies();
2014-11-11 01:45:11 +03:00
bool sendSwitchCatdbMsgs ( int32_t num );
2013-08-03 00:12:24 +04:00
// state
void *m_state;
void (*m_callback)(void *st);
// coll
char *m_coll;
2014-11-11 01:45:11 +03:00
int32_t m_collLen;
2013-08-03 00:12:24 +04:00
// locals
bool m_updateFromNew;
2014-11-11 01:45:11 +03:00
int32_t m_numUrls;
int32_t m_numUrlsSent;
int32_t m_numUrlsDone;
2013-08-03 00:12:24 +04:00
// Msg9 buffer
//Msg9 m_msg9s[NUM_MSG9S];
Msg9b m_msg9b;
// file stream
//ifstream m_inStream;
int m_inStream;
// buffers
char *m_urls;
2014-11-11 01:45:11 +03:00
int32_t m_urlsBufferSize;
int32_t *m_catids;
int32_t m_catidsBufferSize;
2013-08-03 00:12:24 +04:00
unsigned char *m_numCatids;
2014-11-11 01:45:11 +03:00
int32_t m_numNumCatids;
int32_t *m_updateIndexes;
int32_t m_numUpdateIndexes;
int32_t m_numRemoveUrls;
2013-08-03 00:12:24 +04:00
// mini msg2as for switching to the updated catdb and categories
MiniMsg2a m_miniMsg2as[NUM_MINIMSG2AS];
2014-11-11 01:45:11 +03:00
int32_t m_msgsSent;
int32_t m_msgsReplied;
int32_t m_numMsgsToSend;
2013-08-03 00:12:24 +04:00
char m_msgData;
};
#endif