1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
15 * The Original Code is the Netscape Portable Runtime (NSPR).
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998-2000
20 * the Initial Developer. All Rights Reserved.
24 * Alternatively, the contents of this file may be used under the terms of
25 * either the GNU General Public License Version 2 or later (the "GPL"), or
26 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
36 * ***** END LICENSE BLOCK ***** */
39 /* author: jstewart */
41 #if defined(_PRVERSION_H)
49 /* All components participating in the PR version protocol must expose
50 * a structure and a function. The structure is defined below and named
51 * according to the naming conventions outlined further below. The function
52 * is called libVersionPoint and returns a pointer to this structure.
55 /* on NT, always pack the structure the same. */
62 * The first field defines which version of this structure is in use.
63 * At this time, only version 2 is specified. If this value is not
64 * 2, you must read no further into the structure.
68 /* for Version 2, this is the body format. */
69 PRInt64 buildTime; /* 64 bits - usecs since midnight, 1/1/1970 */
70 char * buildTimeString;/* a human readable version of the time */
72 PRUint8 vMajor; /* Major version of this component */
73 PRUint8 vMinor; /* Minor version of this component */
74 PRUint8 vPatch; /* Patch level of this component */
76 PRBool beta; /* true if this is a beta component */
77 PRBool debug; /* true if this is a debug component */
78 PRBool special; /* true if this component is a special build */
80 char * filename; /* The original filename */
81 char * description; /* description of this component */
82 char * security; /* level of security in this component */
83 char * copyright; /* The copyright for this file */
84 char * comment; /* free form field for misc usage */
85 char * specialString; /* the special variant for this build */
86 } PRVersionDescription;
88 /* on NT, restore the previous packing */
94 * All components must define an entrypoint named libVersionPoint which
95 * is of type versionEntryPointType.
97 * For example, for a library named libfoo, we would have:
99 * PRVersionDescription prVersionDescription_libfoo =
104 * PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void)
106 * return &prVersionDescription_libfoo;
109 typedef const PRVersionDescription *(*versionEntryPointType)(void);
112 * Where you declare your libVersionPoint, do it like this:
113 * PR_IMPLEMENT(const PRVersionDescription *) libVersionPoint(void) {
119 * NAMING CONVENTION FOR struct
121 * all components should also expose a static PRVersionDescription
122 * The name of the struct should be calculated as follows:
123 * Take the value of filename. (If filename is not specified, calculate
124 * a short, unique string.) Convert all non-alphanumeric characters
125 * to '_'. To this, prepend "PRVersionDescription_". Thus for libfoo.so,
126 * the symbol name is "PRVersionDescription_libfoo_so".
127 * so the file should have
128 * PRVersionDescription PRVersionDescription_libfoo_so { fill it in };
129 * on NT, this file should be declspec export.
134 #endif /* defined(_PRVERSION_H) */