]>
git.saurik.com Git - apple/security.git/blob - Security/libsecurity_asn1/lib/prvrsion.h
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
3 * The contents of this file are subject to the Mozilla Public
4 * License Version 1.1 (the "License"); you may not use this file
5 * except in compliance with the License. You may obtain a copy of
6 * the License at http://www.mozilla.org/MPL/
8 * Software distributed under the License is distributed on an "AS
9 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10 * implied. See the License for the specific language governing
11 * rights and limitations under the License.
13 * The Original Code is the Netscape Portable Runtime (NSPR).
15 * The Initial Developer of the Original Code is Netscape
16 * Communications Corporation. Portions created by Netscape are
17 * Copyright (C) 1998-2000 Netscape Communications Corporation. All
22 * Alternatively, the contents of this file may be used under the
23 * terms of the GNU General Public License Version 2 or later (the
24 * "GPL"), in which case the provisions of the GPL are applicable
25 * instead of those above. If you wish to allow use of your
26 * version of this file only under the terms of the GPL and not to
27 * allow others to use your version of this file under the MPL,
28 * indicate your decision by deleting the provisions above and
29 * replace them with the notice and other provisions required by
30 * the GPL. If you do not delete the provisions above, a recipient
31 * may use your version of this file under either the MPL or the
36 /* author: jstewart */
38 #if defined(_PRVERSION_H)
42 #include <security_asn1/prtypes.h>
46 /* All components participating in the PR version protocol must expose
47 * a structure and a function. The structure is defined below and named
48 * according to the naming conventions outlined further below. The function
49 * is called libVersionPoint and returns a pointer to this structure.
52 /* on NT, always pack the structure the same. */
59 * The first field defines which version of this structure is in use.
60 * At this time, only version 2 is specified. If this value is not
61 * 2, you must read no further into the structure.
65 /* for Version 2, this is the body format. */
66 PRInt64 buildTime
; /* 64 bits - usecs since midnight, 1/1/1970 */
67 char * buildTimeString
;/* a human readable version of the time */
69 PRUint8 vMajor
; /* Major version of this component */
70 PRUint8 vMinor
; /* Minor version of this component */
71 PRUint8 vPatch
; /* Patch level of this component */
73 PRBool beta
; /* true if this is a beta component */
74 PRBool debug
; /* true if this is a debug component */
75 PRBool special
; /* true if this component is a special build */
77 char * filename
; /* The original filename */
78 char * description
; /* description of this component */
79 char * security
; /* level of security in this component */
80 char * copyright
; /* The copyright for this file */
81 char * comment
; /* free form field for misc usage */
82 char * specialString
; /* the special variant for this build */
83 } PRVersionDescription
;
85 /* on NT, restore the previous packing */
91 * All components must define an entrypoint named libVersionPoint which
92 * is of type versionEntryPointType.
94 * For example, for a library named libfoo, we would have:
96 * PRVersionDescription prVersionDescription_libfoo =
101 * PR_IMPLEMENT(const PRVersionDescription*) libVersionPoint(void)
103 * return &prVersionDescription_libfoo;
106 typedef const PRVersionDescription
*(*versionEntryPointType
)(void);
109 * Where you declare your libVersionPoint, do it like this:
110 * PR_IMPLEMENT(const PRVersionDescription *) libVersionPoint(void) {
116 * NAMING CONVENTION FOR struct
118 * all components should also expose a static PRVersionDescription
119 * The name of the struct should be calculated as follows:
120 * Take the value of filename. (If filename is not specified, calculate
121 * a short, unique string.) Convert all non-alphanumeric characters
122 * to '_'. To this, prepend "PRVersionDescription_". Thus for libfoo.so,
123 * the symbol name is "PRVersionDescription_libfoo_so".
124 * so the file should have
125 * PRVersionDescription PRVersionDescription_libfoo_so { fill it in };
126 * on NT, this file should be declspec export.
131 #endif /* defined(_PRVERSION_H) */