1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
9 #if defined(_PRVERSION_H)
17 /* All components participating in the PR version protocol must expose
18 * a structure and a function. The structure is defined below and named
19 * according to the naming conventions outlined further below. The function
20 * is called libVersionPoint and returns a pointer to this structure.
23 /* on NT, always pack the structure the same. */
30 * The first field defines which version of this structure is in use.
31 * At this time, only version 2 is specified. If this value is not
32 * 2, you must read no further into the structure.
36 /* for Version 2, this is the body format. */
37 PRInt64 buildTime
; /* 64 bits - usecs since midnight, 1/1/1970 */
38 char * buildTimeString
;/* a human readable version of the time */
40 PRUint8 vMajor
; /* Major version of this component */
41 PRUint8 vMinor
; /* Minor version of this component */
42 PRUint8 vPatch
; /* Patch level of this component */
44 PRBool beta
; /* true if this is a beta component */
45 PRBool debug
; /* true if this is a debug component */
46 PRBool special
; /* true if this component is a special build */
48 char * filename
; /* The original filename */
49 char * description
; /* description of this component */
50 char * security
; /* level of security in this component */
51 char * copyright
; /* The copyright for this file */
52 char * comment
; /* free form field for misc usage */
53 char * specialString
; /* the special variant for this build */
54 } PRVersionDescription
;
56 /* on NT, restore the previous packing */
62 * All components must define an entrypoint named libVersionPoint which
63 * is of type versionEntryPointType.
65 * For example, for a library named libfoo, we would have:
67 * PRVersionDescription prVersionDescription_libfoo =
72 * PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void)
74 * return &prVersionDescription_libfoo;
77 typedef const PRVersionDescription
*(*versionEntryPointType
)(void);
80 * Where you declare your libVersionPoint, do it like this:
81 * PR_IMPLEMENT(const PRVersionDescription *) libVersionPoint(void) {
87 * NAMING CONVENTION FOR struct
89 * all components should also expose a static PRVersionDescription
90 * The name of the struct should be calculated as follows:
91 * Take the value of filename. (If filename is not specified, calculate
92 * a short, unique string.) Convert all non-alphanumeric characters
93 * to '_'. To this, prepend "PRVersionDescription_". Thus for libfoo.so,
94 * the symbol name is "PRVersionDescription_libfoo_so".
95 * so the file should have
96 * PRVersionDescription PRVersionDescription_libfoo_so { fill it in };
97 * on NT, this file should be declspec export.
102 #endif /* defined(_PRVERSION_H) */