source: trunk/poppler/mypoppler/poppler/BaseFile.h @ 2

Last change on this file since 2 was 2, checked in by Eugene Romanenko, 16 years ago

First import

File size: 1.5 KB
Line 
1//========================================================================
2//
3// BaseFile.h
4//
5// Copyright 1999 Derek B. Noonburg assigned by Michael Meeks.
6//
7//========================================================================
8
9#ifndef BASEFILE_H
10#define BASEFILE_H
11
12#include <stdio.h>
13#include <stdarg.h>
14
15#include "Error.h"
16
17typedef FILE * BaseFile;
18
19static inline BaseFile
20bxpdfopen (GooString *fileName1)
21{
22  GooString *fileName2;
23  // try to open file
24  fileName2 = NULL;
25  BaseFile file;
26
27#ifdef VMS
28  if (!(file = fopen(fileName->getCString(), "rb", "ctx=stm"))) {
29    error(-1, "Couldn't open file '%s'", fileName->getCString());
30    return NULL;
31  }
32#else
33  if (!(file = fopen(fileName1->getCString(), "rb"))) {
34    fileName2 = fileName1->copy();
35    fileName2->lowerCase();
36    if (!(file = fopen(fileName2->getCString(), "rb"))) {
37      fileName2->upperCase();
38      if (!(file = fopen(fileName2->getCString(), "rb"))) {
39        error(-1, "Couldn't open file '%s'", fileName1->getCString());
40        delete fileName2;
41        return NULL;
42      }
43    }
44    delete fileName2;
45  }
46#endif
47  return file;
48}
49
50static inline void
51bfclose (BaseFile file)
52{
53  fclose (file);
54}
55
56static inline size_t
57bfread (void *ptr, size_t size, size_t nmemb, BaseFile file)
58{
59  return fread (ptr, size, nmemb, file);
60}
61
62static inline int
63bfseek (BaseFile file, long offset, int whence)
64{
65  return fseek (file, offset, whence);
66}
67
68static inline void
69brewind (BaseFile file)
70{
71  rewind (file);
72}
73
74static inline long
75bftell (BaseFile file)
76{
77  return ftell (file);
78}*/
79
80#endif /* BASEFILE_H */
81
82
Note: See TracBrowser for help on using the repository browser.