~vibhavp/ubuntu/raring/ebook-tools/add-autopkgtest

« back to all changes in this revision

Viewing changes to src/libepub/epub.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-09-10 14:06:04 UTC
  • mto: (5.1.3 maverick)
  • mto: This revision was merged to the branch mainline in revision 6.
  • Revision ID: james.westby@ubuntu.com-20100910140604-ge4cw5cetcsetrxv
Tags: upstream-0.2.0
ImportĀ upstreamĀ versionĀ 0.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
#ifdef __cplusplus
13
13
extern "C" {
14
 
#endif // c++
 
14
#endif /* C++ */
15
15
 
16
16
  /** 
17
17
      This function accepts an epub filename. It then parses its information and
22
22
      @return epub struct with the information of the file or NULL on error
23
23
      
24
24
  */
25
 
  struct epub *epub_open(const char *filename, int debug);
 
25
  EPUB_EXPORT struct epub *epub_open(const char *filename, int debug);
26
26
  
27
27
  /**
28
28
     This function sets the debug level to the given level.
30
30
     @param filename is the name of the file to open
31
31
     @param debug is the debug level (0=none, 1=errors, 2=warnings, 3=info)
32
32
  */
33
 
  void epub_set_debug(struct epub *epub, int debug);
 
33
  EPUB_EXPORT void epub_set_debug(struct epub *epub, int debug);
34
34
 
35
35
  /** 
36
36
      returns the file with the give filename
40
40
      @param pointer to where the file data is stored
41
41
      @return the number of bytes read
42
42
  */
43
 
  int epub_get_ocf_file(struct epub *epub, const char *filename, char **data);
 
43
  EPUB_EXPORT int epub_get_ocf_file(struct epub *epub, const char *filename, char **data);
44
44
  
45
45
  /** 
46
46
      Frees the memory held by the given iterator
47
47
      
48
48
      @param it the iterator
49
49
  */
50
 
  void epub_free_iterator(struct eiterator *it);
 
50
  EPUB_EXPORT void epub_free_iterator(struct eiterator *it);
51
51
 
52
52
  /** 
53
53
      This function closes a given epub. It also frees the epub struct.
55
55
      
56
56
      @param epub the struct of the epub to close.
57
57
  */
58
 
  int epub_close(struct epub *epub);
 
58
  EPUB_EXPORT int epub_close(struct epub *epub);
59
59
  
60
60
  /** 
61
61
      Debugging function dumping various file information.
62
62
      
63
63
      @param epub the struct of the epub to close.
64
64
  */
65
 
  void epub_dump(struct epub *epub);
 
65
  EPUB_EXPORT void epub_dump(struct epub *epub);
66
66
  
67
67
    
68
68
  /** 
70
70
 
71
71
      @param epub the struct .
72
72
  */
73
 
  unsigned char **epub_get_metadata(struct epub *epub, enum epub_metadata type,
74
 
                                    int *size);
 
73
  EPUB_EXPORT unsigned char **epub_get_metadata(struct epub *epub, enum epub_metadata type,
 
74
                                                int *size);
75
75
 
76
76
  /** 
77
77
      returns the file with the give filename. The file is looked
82
82
      @param pointer to where the file data is stored
83
83
      @return the number of bytes read
84
84
  */
85
 
  int epub_get_data(struct epub *epub, const char *name, char **data);
 
85
  EPUB_EXPORT int epub_get_data(struct epub *epub, const char *name, char **data);
86
86
 
87
87
  
88
88
  /** 
94
94
      @param opt other options (ignored for now)
95
95
      @return eiterator to the epub book
96
96
  */
97
 
  struct eiterator *epub_get_iterator(struct epub *epub, 
98
 
                                      enum eiterator_type type, int opt);
 
97
  EPUB_EXPORT struct eiterator *epub_get_iterator(struct epub *epub, 
 
98
                                                  enum eiterator_type type, int opt);
99
99
 
100
100
  /**
101
101
     updates the iterator to the next element and returns a pointer 
104
104
     @param it the iterator
105
105
     @return pointer to the data
106
106
  */
107
 
  char *epub_it_get_next(struct eiterator *it);
 
107
  EPUB_EXPORT char *epub_it_get_next(struct eiterator *it);
108
108
 
109
109
  /**
110
110
     Returns a pointer to the iterator's data. the iterator handles 
113
113
     @param it the iterator
114
114
     @return pointer to the data
115
115
  */
116
 
  char *epub_it_get_curr(struct eiterator *it);
 
116
  EPUB_EXPORT char *epub_it_get_curr(struct eiterator *it);
117
117
  
118
118
  /**
119
119
     Returns a pointer to the url of the iterator's current data. 
122
122
     @param it the iterator
123
123
     @return pointer to the current data's url
124
124
  */
125
 
  char *epub_it_get_curr_url(struct eiterator *it);
 
125
  EPUB_EXPORT char *epub_it_get_curr_url(struct eiterator *it);
126
126
 
127
127
  /** 
128
128
      Returns a book toc iterator of the requested type
133
133
      @param opt other options (ignored for now)
134
134
      @return toc iterator to the epub book
135
135
  */
136
 
  struct titerator *epub_get_titerator(struct epub *epub, 
137
 
                                       enum titerator_type type, int opt);
 
136
  EPUB_EXPORT struct titerator *epub_get_titerator(struct epub *epub, 
 
137
                                                   enum titerator_type type, int opt);
138
138
 
139
139
  
140
140
  /**
143
143
     @param tit the iterator
144
144
     @return 1 if the current entry is valid and 0 otherwise 
145
145
  */
146
 
  int epub_tit_curr_valid(struct titerator *tit);
 
146
  EPUB_EXPORT int epub_tit_curr_valid(struct titerator *tit);
147
147
  
148
148
  /**
149
149
     Returns a pointer to the depth of the toc iterator's current entry. 
152
152
     @param tit the iterator
153
153
     @return pointer to the current entry's depth
154
154
  */
155
 
  int epub_tit_get_curr_depth(struct titerator *tit);
 
155
  EPUB_EXPORT int epub_tit_get_curr_depth(struct titerator *tit);
156
156
 
157
157
  /**
158
158
     Returns a pointer to the link of the toc iterator's current entry. 
161
161
     @param tit the iterator
162
162
     @return the current entry's depth
163
163
  */
164
 
  char *epub_tit_get_curr_link(struct titerator *tit);
 
164
  EPUB_EXPORT char *epub_tit_get_curr_link(struct titerator *tit);
165
165
 
166
166
  /**
167
167
     Returns a pointer to the label of the toc iterator's current entry. 
170
170
     @param tit the iterator
171
171
     @return pointer to the current entry's lable
172
172
  */
173
 
  char *epub_tit_get_curr_label(struct titerator *tit);
 
173
  EPUB_EXPORT char *epub_tit_get_curr_label(struct titerator *tit);
174
174
 
175
175
  /** 
176
176
      Frees the memory held by the given iterator
177
177
      
178
178
      @param tit the iterator
179
179
  */
180
 
  void epub_free_titerator(struct titerator *tit);
 
180
  EPUB_EXPORT void epub_free_titerator(struct titerator *tit);
181
181
  
182
182
  /**
183
183
     updates the iterator to the next element.
185
185
     @param tit the iterator
186
186
     @return 1 on success and 0 otherwise
187
187
  */
188
 
  int epub_tit_next(struct titerator *tit);
 
188
  EPUB_EXPORT int epub_tit_next(struct titerator *tit);
189
189
 
190
190
  /**
191
191
     Cleans up after the library. Call this when you are done with the library. 
192
192
  */
193
 
  void epub_cleanup();
 
193
  EPUB_EXPORT void epub_cleanup();
194
194
 
195
195
#ifdef __cplusplus
196
196
}
197
 
#endif // c++
 
197
#endif /* C++ */
198
198
 
199
 
#endif // EPUB_H
 
199
#endif /* EPUB_H */