1 /*****************************************************************************\
2 versioncode.cpp : version information routines
4 Copyright (c) 1996 - 2002, Hewlett-Packard Co.
7 Redistribution and use in source and binary forms, with or without
8 modification, are permitted provided that the following conditions
10 1. Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12 2. Redistributions in binary form must reproduce the above copyright
13 notice, this list of conditions and the following disclaimer in the
14 documentation and/or other materials provided with the distribution.
15 3. Neither the name of Hewlett-Packard nor the names of its
16 contributors may be used to endorse or promote products derived
17 from this software without specific prior written permission.
19 THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
20 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
22 NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24 TO, PATENT INFRINGEMENT; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
25 OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
28 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 \*****************************************************************************/
32 #include "printerfactory.h"
35 extern BOOL ProprietaryImaging();
36 extern BOOL ProprietaryScaling();
41 extern char DeveloperString[32];
43 /*! \addtogroup globals
47 const char VersionStringID[21] = "04.09.00A_11-06-2009"; //!< Version information
51 void HP_strcat(char* str1, const char* str2)
57 while( (*str1++ = *str2++) )
59 // nothing. Just copying str2 to str1
66 Returns a string identifying components and features of the driver build.
67 If bCompressed is TRUE then the string returned is a bit representation string
68 of the build options (ie. speed, scaling, capture, etc...). If bCompressed is
69 FALSE then the string is a textual concatenation of the developer build string,
70 the APDK version string, and string representation of the build options.
72 This function returns a string identifying components and features of the driver
73 build, such as which printer-models are supported, whether font and scaling
74 support is included, and other information intended to help solve customer problems.
76 \param int bCompressed If true, the information is packed into a decimal number
77 that may be decoded by Hewlett-Packard. Otherwise, the string consists of
78 human-readable indicators.
79 \return char* string representing version information.
80 \note If bCompressed is TRUE then the return string has only build options and
81 no version information.
83 char* Version(BOOL bCompressed)
89 if (ProprietaryScaling())
90 bits = bits | 0x80000000;
93 bits = bits | 0x40000000;
96 #ifdef APDK_LITTLE_ENDIAN
97 bits = bits | 0x20000000;
100 if (ProprietaryImaging())
101 bits = bits | 0x10000000;
104 bits = bits | 0x08000000;
107 bits = bits | 0x04000000;
109 #ifdef APDK_LTRGOTHIC
110 bits = bits | 0x02000000;
113 bits = bits | 0x01000000;
116 #ifdef APDK_OPTIMIZE_FOR_SPEED
117 bits = bits | 0x00800000;
120 bits = bits | pPFI->GetModelBits();
122 // room left for 23 more here
123 sprintf(result,"%0x", bits);
127 strcpy(result,DeveloperString);
128 HP_strcat(result,"!!");
129 HP_strcat(result,VersionStringID);
130 HP_strcat(result," ");
132 if (ProprietaryScaling())
133 HP_strcat(result,"propscale ");
135 HP_strcat(result,"openscale ");
137 if (ProprietaryImaging())
138 HP_strcat(result,"propimg ");
140 HP_strcat(result,"openimg ");
143 HP_strcat(result,"debug ");
145 HP_strcat(result,"normal ");
148 #ifdef APDK_LITTLE_ENDIAN
149 HP_strcat(result,"little_endian ");
151 HP_strcat(result,"big_endian ");
154 #if defined(APDK_FONTS_NEEDED)
155 HP_strcat(result,"fonts:");
157 HP_strcat(result,"no_fonts");
160 HP_strcat(result,"C");
163 HP_strcat(result,"T");
165 #ifdef APDK_LTRGOTHIC
166 HP_strcat(result,"L");
169 HP_strcat(result,"U");
171 HP_strcat(result," ");
173 #ifdef APDK_OPTIMIZE_FOR_SPEED
174 HP_strcat(result,"speed ");
176 HP_strcat(result,"memory ");
179 char modelstring[300];
180 pPFI->GetModelString(modelstring, sizeof(modelstring));
181 HP_strcat(result, modelstring);