summaryrefslogtreecommitdiffstats
path: root/kaddressbook/xxport/pab_pablib.h
blob: c26cbdf23ffab061e0f8b5c6147189c2b9ea329d (plain)
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
/***************************************************************************
                          pablib.hxx  -  description
                             -------------------
    begin                : Tue Jul 4 2000
    copyright            : (C) 2000 by Hans Dijkema
    email                : kmailcvt@hum.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/


#ifndef PAB_LIB_HXX
#define PAB_LIB_HXX

#include <klocale.h>
#include <tqfile.h>

#include "pab_mapihd.h"

#define INDEX_OF_INDEX	0x000000c4
#define PAB_REC_OK	0xbcec
#define PAB_FILE_ID 0x4e444221

class pab
{
  friend class pabrec;

  private:
    TQFile in;
    const char *pabfile;
    TQString     cap;
    TQWidget    *parent;
  public:
    pab(const char *pabFile);
   ~pab();
  private:
    content_t  skip(int longwords) { return relative(longwords); }
    content_t  go(adr_t);
    content_t  relative(int longwords);
    content_t  relative(pabsize_t);
    content_t  add(adr_t &,int words);
    content_t  read(void);
    void       read(unsigned char *mem,content_t size);
    void       read(word_t &);
    pabsize_t  size(content_t);
    void       size(content_t,pabsize_t &, pabsize_t &);
    word_t     lower(content_t);
    word_t     upper(content_t);
    byte_t     readbyte(void);
    adr_t      curpos(void) { return in.at(); }
    adr_t      tell(void)   { return curpos(); }
  private:
    bool  recUnknown(pabrec & R);
    bool  recNoFunction(pabrec & R);
    const char *get(unsigned char *mem,pabrec_entry e,pabrec & R);
    bool  knownPAB(void);
  private:
    void rdPabRec(pabrec & R);
    void prt(unsigned char *mem,pabrec & R,pabrec_entry E);
    void getrange(pabrec & R,pabrec_entry e,word_t & b,word_t & _e);
  private:
    bool convert(adr_t A,content_t start,content_t stop);
    void dotable(adr_t table,content_t start,content_t stop);
    void processRec(adr_t REC);
  public:
    bool convert(void);
};


#endif