home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / include / pwcacapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.2 KB  |  100 lines

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef PWCACAPI_H
  20. #define PWCACAPI_H
  21.  
  22. /* contains a null terminated array of name and value stings 
  23.  *
  24.  * end index of name should always be equal to the end index of value
  25.  *
  26.  */
  27.  
  28. typedef struct _PCNameValuePair PCNameValuePair;
  29. typedef struct _PCNameValueArray PCNameValueArray;
  30.  
  31. typedef void PCDataInterpretFunc (
  32.                 char *module,
  33.                 char *key,
  34.                 char *data, int32 data_size,
  35.                 char *type_buffer, int32 type_buffer_size, 
  36.                 char *url_buffer, int32 url_buffer_size,
  37.                 char *username_buffer, int32 username_buffer_size,
  38.                 char *password_buffer, int32 password_buffer_size);
  39.  
  40. /* returns 0 on success -1 on error 
  41.  */
  42. extern int PC_RegisterDataInterpretFunc(char *module, 
  43.                                         PCDataInterpretFunc *func);
  44.  
  45. extern int PC_PromptUsernameAndPassword(MWContext *context,
  46.                                          char *prompt,
  47.                                          char **username,
  48.                                          char **password,
  49.                                          XP_Bool *remember_password,
  50.                                          XP_Bool  is_secure);
  51.  
  52. extern char *PC_PromptPassword(MWContext *context,
  53.                                  char *prompt,
  54.                                  XP_Bool *remember_password,
  55.                                  XP_Bool  is_secure);
  56.  
  57. extern char *PC_Prompt(MWContext *context,
  58.                        char *prompt,
  59.                        char *deft,
  60.                        XP_Bool *remember,
  61.                        XP_Bool  is_secure);
  62.  
  63. void PC_FreeNameValueArray(PCNameValueArray *array);
  64.  
  65. PCNameValueArray * PC_NewNameValueArray();
  66.  
  67. uint32 PC_ArraySize(PCNameValueArray *array);
  68.  
  69. char * PC_FindInNameValueArray(PCNameValueArray *array, char *name);
  70.  
  71. int PC_DeleteNameFromNameValueArray(PCNameValueArray *array, char *name);
  72.  
  73. void PC_EnumerateNameValueArray(PCNameValueArray *array, char **name, char **value, XP_Bool beginning);
  74.  
  75. int PC_AddToNameValueArray(PCNameValueArray *array, char *name, char *value);
  76.  
  77. void PC_CheckForStoredPasswordData(char *module, char *key, char **data, int32 *len);
  78.  
  79. int PC_DeleteStoredPassword(char *module, char *key);
  80.  
  81. PCNameValueArray * PC_CheckForStoredPasswordArray(char *module, char *key);
  82.  
  83. int PC_StoreSerializedPassword(char *module, char *key, char *data, int32 len);
  84.  
  85. int PC_StorePasswordNameValueArray(char *module, char *key, PCNameValueArray *array);
  86.  
  87. void PC_SerializeNameValueArray(PCNameValueArray *array, char **data, int32 *len);
  88.  
  89. PCNameValueArray * PC_CharToNameValueArray(char *data, int32 len);
  90.  
  91. /*, returns status
  92.  */
  93. int    PC_DisplayPasswordCacheAsHTML(URL_Struct *URL_s, 
  94.                                FO_Present_Types format_out,
  95.                                MWContext *context);
  96.  
  97. void PC_Shutdown();
  98.  
  99. #endif /* PWCACAPI_H */
  100.