MCPcopy Create free account
hub / github.com/OpenPrinting/cups / ppdcSource

Method ppdcSource

ppdc/ppdc-source.cxx:50–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48//
49
50ppdcSource::ppdcSource(const char *f, // I - File to read
51 cups_file_t *ffp)// I - File pointer to use
52 : ppdcShared()
53{
54 PPDC_NEW;
55
56 filename = new ppdcString(f);
57 base_fonts = new ppdcArray();
58 drivers = new ppdcArray();
59 po_files = new ppdcArray();
60 sizes = new ppdcArray();
61 vars = new ppdcArray();
62 cond_state = PPDC_COND_NORMAL;
63 cond_current = cond_stack;
64 cond_stack[0] = PPDC_COND_NORMAL;
65 locdata = localeconv();
66
67 // Add standard #define variables...
68#define MAKE_STRING(x) #x
69
70 vars->add(new ppdcVariable("CUPS_VERSION", MAKE_STRING(CUPS_VERSION)));
71 vars->add(new ppdcVariable("CUPS_VERSION_MAJOR", MAKE_STRING(CUPS_VERSION_MAJOR)));
72 vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
73 vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
74
75#ifdef _WIN32
76 vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
77 vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
78
79#else
80 struct utsname name; // uname information
81
82 if (!uname(&name))
83 {
84 vars->add(new ppdcVariable("PLATFORM_NAME", name.sysname));
85 vars->add(new ppdcVariable("PLATFORM_ARCH", name.machine));
86 }
87 else
88 {
89 vars->add(new ppdcVariable("PLATFORM_NAME", "unknown"));
90 vars->add(new ppdcVariable("PLATFORM_ARCH", "unknown"));
91 }
92#endif // _WIN32
93
94 if (f)
95 read_file(f, ffp);
96}
97
98
99//

Callers

nothing calls this directly

Calls 1

addMethod · 0.80

Tested by

no test coverage detected