Files

70 lines
1.4 KiB
C
Raw Permalink Normal View History

2016-03-08 22:14:30 +01:00
#ifndef GB_SITEGETTER_H
#define GB_SITEGETTER_H
2013-08-02 13:12:24 -07:00
#include "gb-include.h"
#include "Msg0.h"
#include "Tagdb.h"
#define MAX_SITE_LEN 256
#define MAX_SCHEME_LEN 16
2013-08-02 13:12:24 -07:00
class SiteGetter {
public:
SiteGetter();
~SiteGetter();
// . returns false if blocked, true otherwise
// . sets g_errno on erorr
bool getSite ( char *url, class TagRec *gr, int32_t timestamp, collnum_t collnum, int32_t niceness,
void *state = NULL, void (* callback)(void *) = NULL ) ;
2013-08-02 13:12:24 -07:00
bool setRecognizedSite ( );
2016-05-19 18:37:26 +02:00
char *getSite ( ) { return m_site ; }
int32_t getSiteLen ( ) { return m_siteLen; }
2013-08-02 13:12:24 -07:00
bool getSiteList ( ) ;
bool gotSiteList ( ) ;
bool setSite ( ) ;
char *m_url;
collnum_t m_collnum;
2013-08-02 13:12:24 -07:00
void *m_state;
void (*m_callback) (void *state );
RdbList m_list;
2014-11-10 14:45:11 -08:00
int32_t m_sitePathDepth;
2013-08-02 13:12:24 -07:00
// use Msg0 for getting the no-split termlist that combines
// gbpathdepth: with the site hash in a single termid
Msg0 m_msg0;
2014-11-10 14:45:11 -08:00
int32_t m_pathDepth;
int32_t m_maxPathDepth;
int32_t m_niceness;
int32_t m_oldSitePathDepth;
2013-08-02 13:12:24 -07:00
char m_allDone;
2014-11-10 14:45:11 -08:00
int32_t m_timestamp;
2013-08-02 13:12:24 -07:00
bool m_hasSubdomain;
// points into provided "u->m_url" buffer
char m_site[MAX_SITE_LEN+1];
2014-11-10 14:45:11 -08:00
int32_t m_siteLen;
2013-08-02 13:12:24 -07:00
char m_scheme[MAX_SCHEME_LEN+1];
int32_t m_schemeLen;
2013-08-02 13:12:24 -07:00
bool m_tryAgain;
2014-11-10 14:45:11 -08:00
int32_t m_errno;
2013-08-02 13:12:24 -07:00
// the tag rec we add
TagRec m_addedTag;
};
2016-03-08 22:14:30 +01:00
#endif // GB_SITEGETTER_H