~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/xpdflib/ocfile.h

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2004-06-08 00:44:02 UTC
  • Revision ID: james.westby@ubuntu.com-20040608004402-72yu51xlh7vt6p9m
Tags: upstream-6.0pre16
ImportĀ upstreamĀ versionĀ 6.0pre16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// -*- C++ -*-
 
2
//========================================================================
 
3
//
 
4
// ocfile.h
 
5
//
 
6
// Drop-in replacement for C <stdio.h> FILE 
 
7
//
 
8
//========================================================================
 
9
 
 
10
#ifndef OCFILE_H
 
11
#define OCFILE_H
 
12
 
 
13
#include <stdio.h>
 
14
#include <stdlib.h>
 
15
#include <stddef.h>
 
16
 
 
17
//------------------------------------------------------------------------
 
18
 
 
19
class QIODevice;
 
20
 
 
21
struct OCFILE {
 
22
  QIODevice *iDevice;
 
23
};
 
24
 
 
25
#ifdef ungetc
 
26
#undef ungetc
 
27
#endif
 
28
 
 
29
extern OCFILE *ocfopen(const char *name, const char *mode);
 
30
extern OCFILE *ocfopen(QIODevice *device);
 
31
extern void fclose(OCFILE *f);
 
32
extern size_t fwrite(const void *buf, size_t size, size_t count, OCFILE *f);
 
33
extern size_t fread(void *buf, size_t size, size_t count, OCFILE *f);
 
34
extern int fseek(OCFILE *f, long offset, int whence);
 
35
extern long ftell(OCFILE *f);
 
36
extern int fgetc(OCFILE *f);
 
37
extern int fputc(int ch, OCFILE *f);
 
38
extern void ungetc(int ch, OCFILE *f);
 
39
extern void fputs(const char *s, OCFILE *f);
 
40
extern void fprintf(OCFILE *f, const char *fmt, int a1 = 0, int a2 = 0);
 
41
extern void fprintf(OCFILE *f, const char *fmt, const char *s);
 
42
 
 
43
// Just like fgets, but handles Unix, Mac, and/or DOS end-of-line
 
44
// conventions (from Xpdf).
 
45
extern char *getLine(char *buf, int size, OCFILE *f);
 
46
 
 
47
// --------------------------------------------------------------------
 
48
#endif