home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / security / freenav / seccomon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.0 KB  |  90 lines

  1. /*
  2.  * The contents of this file are subject to the Netscape Public License
  3.  * Version 1.0 (the "NPL"); you may not use this file except in
  4.  * compliance with the NPL.  You may obtain a copy of the NPL at
  5.  * http://www.mozilla.org/NPL/
  6.  *
  7.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  8.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  9.  * for the specific language governing rights and limitations under the
  10.  * NPL.
  11.  *
  12.  * The Initial Developer of this code under the NPL is Netscape
  13.  * Communications Corporation.  Portions created by Netscape are
  14.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  15.  * Reserved.
  16.  */
  17.  
  18. #ifndef _SECCOMON_H_
  19. #define _SECCOMON_H_
  20.  
  21. #include <ctype.h>
  22. #include <string.h>
  23. #include <stddef.h>
  24. #include <stdlib.h>
  25. #include "prmem.h"
  26. #include "plarena.h"
  27. #include "prtypes.h"
  28. #include "prlog.h"
  29. #include "plstr.h"
  30. #include "prio.h"
  31.  
  32. #if defined(XP_CPLUSPLUS)
  33. # define SEC_BEGIN_PROTOS extern "C" {
  34. # define SEC_END_PROTOS }
  35. #else
  36. # define SEC_BEGIN_PROTOS
  37. # define SEC_END_PROTOS
  38. #endif
  39.  
  40. #include "secstubt.h"
  41. #include "secstubs.h"
  42.  
  43. #define PORT_Strlen(s)     strlen(s)
  44. #define PORT_Strcasecmp PL_strcasecmp
  45. #define PORT_Memset     memset
  46. #define PORT_Strcmp     strcmp
  47. #define PORT_Assert PR_ASSERT
  48. #define PORT_Memcpy     memcpy
  49. #define PORT_Strchr     strchr
  50.  
  51. SEC_BEGIN_PROTOS
  52. void *
  53. PORT_Alloc(size_t bytes);
  54.  
  55. void *
  56. PORT_Realloc(void *oldptr, size_t bytes);
  57.  
  58. void *
  59. PORT_ZAlloc(size_t bytes);
  60.  
  61. void
  62. PORT_Free(void *ptr);
  63.  
  64. void
  65. PORT_ZFree(void *ptr, size_t len);
  66.  
  67. PRArenaPool *
  68. PORT_NewArena(unsigned long chunksize);
  69.  
  70. void *
  71. PORT_ArenaAlloc(PRArenaPool *arena, size_t size);
  72.  
  73. void *
  74. PORT_ArenaZAlloc(PRArenaPool *arena, size_t size);
  75.  
  76. void
  77. PORT_FreeArena(PRArenaPool *arena, PRBool zero);
  78.  
  79. void *
  80. PORT_ArenaGrow(PRArenaPool *arena, void *ptr, size_t oldsize, size_t newsize);
  81.  
  82. void *
  83. PORT_ArenaMark(PRArenaPool *arena);
  84.  
  85. void
  86. PORT_ArenaRelease(PRArenaPool *arena, void *mark);
  87. SEC_END_PROTOS
  88.  
  89. #endif /* _SECCOMON_H_ */
  90.