PageRenderTime 33ms CodeModel.GetById 26ms RepoModel.GetById 0ms app.codeStats 1ms

/gecko_api/include/nssbaset.h

http://firefox-mac-pdf.googlecode.com/
C Header | 156 lines | 28 code | 26 blank | 102 comment | 0 complexity | 2d7595964dd4c3c068fa0ded5a791cb4 MD5 | raw file
  1. /* ***** BEGIN LICENSE BLOCK *****
  2. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  3. *
  4. * The contents of this file are subject to the Mozilla Public License Version
  5. * 1.1 (the "License"); you may not use this file except in compliance with
  6. * the License. You may obtain a copy of the License at
  7. * http://www.mozilla.org/MPL/
  8. *
  9. * Software distributed under the License is distributed on an "AS IS" basis,
  10. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  11. * for the specific language governing rights and limitations under the
  12. * License.
  13. *
  14. * The Original Code is the Netscape security libraries.
  15. *
  16. * The Initial Developer of the Original Code is
  17. * Netscape Communications Corporation.
  18. * Portions created by the Initial Developer are Copyright (C) 1994-2000
  19. * the Initial Developer. All Rights Reserved.
  20. *
  21. * Contributor(s):
  22. *
  23. * Alternatively, the contents of this file may be used under the terms of
  24. * either the GNU General Public License Version 2 or later (the "GPL"), or
  25. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  26. * in which case the provisions of the GPL or the LGPL are applicable instead
  27. * of those above. If you wish to allow use of your version of this file only
  28. * under the terms of either the GPL or the LGPL, and not to allow others to
  29. * use your version of this file under the terms of the MPL, indicate your
  30. * decision by deleting the provisions above and replace them with the notice
  31. * and other provisions required by the GPL or the LGPL. If you do not delete
  32. * the provisions above, a recipient may use your version of this file under
  33. * the terms of any one of the MPL, the GPL or the LGPL.
  34. *
  35. * ***** END LICENSE BLOCK ***** */
  36. #ifndef NSSBASET_H
  37. #define NSSBASET_H
  38. #ifdef DEBUG
  39. static const char NSSBASET_CVS_ID[] = "@(#) $RCSfile: nssbaset.h,v $ $Revision: 1.6 $ $Date: 2005/01/20 02:25:45 $";
  40. #endif /* DEBUG */
  41. /*
  42. * nssbaset.h
  43. *
  44. * This file contains the most low-level, fundamental public types.
  45. */
  46. #include "nspr.h"
  47. #include "nssilock.h"
  48. /*
  49. * NSS_EXTERN, NSS_IMPLEMENT, NSS_EXTERN_DATA, NSS_IMPLEMENT_DATA
  50. *
  51. * NSS has its own versions of these NSPR macros, in a form which
  52. * does not confuse ctags and other related utilities. NSPR
  53. * defines these macros to take the type as an argument, because
  54. * of a requirement to support win16 dlls. We do not have that
  55. * requirement, so we can drop that restriction.
  56. */
  57. #define DUMMY /* dummy */
  58. #define NSS_EXTERN PR_EXTERN(DUMMY)
  59. #define NSS_IMPLEMENT PR_IMPLEMENT(DUMMY)
  60. #define NSS_EXTERN_DATA PR_EXTERN_DATA(DUMMY)
  61. #define NSS_IMPLEMENT_DATA PR_IMPLEMENT_DATA(DUMMY)
  62. PR_BEGIN_EXTERN_C
  63. /*
  64. * NSSError
  65. *
  66. * Calls to NSS routines may result in one or more errors being placed
  67. * on the calling thread's "error stack." Every possible error that
  68. * may be returned from a function is declared where the function is
  69. * prototyped. All errors are of the following type.
  70. */
  71. typedef PRInt32 NSSError;
  72. /*
  73. * NSSArena
  74. *
  75. * Arenas are logical sets of heap memory, from which memory may be
  76. * allocated. When an arena is destroyed, all memory allocated within
  77. * that arena is implicitly freed. These arenas are thread-safe:
  78. * an arena pointer may be used by multiple threads simultaneously.
  79. * However, as they are not backed by shared memory, they may only be
  80. * used within one process.
  81. */
  82. struct NSSArenaStr;
  83. typedef struct NSSArenaStr NSSArena;
  84. /*
  85. * NSSItem
  86. *
  87. * This is the basic type used to refer to an unconstrained datum of
  88. * arbitrary size.
  89. */
  90. struct NSSItemStr {
  91. void *data;
  92. PRUint32 size;
  93. };
  94. typedef struct NSSItemStr NSSItem;
  95. /*
  96. * NSSBER
  97. *
  98. * Data packed according to the Basic Encoding Rules of ASN.1.
  99. */
  100. typedef NSSItem NSSBER;
  101. /*
  102. * NSSDER
  103. *
  104. * Data packed according to the Distinguished Encoding Rules of ASN.1;
  105. * this form is also known as the Canonical Encoding Rules form (CER).
  106. */
  107. typedef NSSBER NSSDER;
  108. /*
  109. * NSSBitString
  110. *
  111. * Some ASN.1 types use "bit strings," which are passed around as
  112. * octet strings but whose length is counted in bits. We use this
  113. * typedef of NSSItem to point out the occasions when the length
  114. * is counted in bits, not octets.
  115. */
  116. typedef NSSItem NSSBitString;
  117. /*
  118. * NSSUTF8
  119. *
  120. * Character strings encoded in UTF-8, as defined by RFC 2279.
  121. */
  122. typedef char NSSUTF8;
  123. /*
  124. * NSSASCII7
  125. *
  126. * Character strings guaranteed to be 7-bit ASCII.
  127. */
  128. typedef char NSSASCII7;
  129. PR_END_EXTERN_C
  130. #endif /* NSSBASET_H */