Possible namespace pollution in fpdfview.h?

28 views
Skip to first unread message

geisserml

unread,
Aug 16, 2023, 9:32:46 AM8/16/23
to pdfium
fpdfview.h contains one enum typedef whose members lack the usual FPDF prefix (and they're camel-case, not all capital)
```c
typedef enum _FPDF_DUPLEXTYPE_ {
  DuplexUndefined = 0,
  Simplex,
  DuplexFlipShortEdge,
  DuplexFlipLongEdge
} FPDF_DUPLEXTYPE;
```

Contrast this to other enum members:
```c
typedef enum {
  FPDF_RENDERERTYPE_AGG = 0,
  FPDF_RENDERERTYPE_SKIA = 1,
} FPDF_RENDERER_TYPE;
```

Is there a specific reason why FPDF_DUPLEXTYPE was defined this way, or is it an inadvertency?
AFAICS testing/tools/api_check.py enforce the prefix for functions, but not for enum members?

geisserml

unread,
Aug 16, 2023, 9:46:44 AM8/16/23
to pdfium
More public members that do not follow the usual prefixing patterns (across all headers and in no particular order):
- TimerCallback, UNSUPPORT_INFO, PAGEMODE_*, FILEIDTYPE_*, FLATTEN_*, FLAT_*

There are also some members prefixed with PDF rather than the usual FPDF, but this seems OK to me.
Reply all
Reply to author
Forward
0 new messages