[Winpt-commits] r182 - trunk/Include

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 14 12:02:33 CET 2006


Author: twoaday
Date: 2006-03-14 12:02:32 +0100 (Tue, 14 Mar 2006)
New Revision: 182

Modified:
   trunk/Include/wptCommonCtl.h
   trunk/Include/wptGPG.h
   trunk/Include/wptHTTP.h
   trunk/Include/wptKeyCache.h
   trunk/Include/wptKeyserver.h
   trunk/Include/wptRegistry.h
   trunk/Include/wptTypes.h
   trunk/Include/wptW32API.h
Log:


Modified: trunk/Include/wptCommonCtl.h
===================================================================
--- trunk/Include/wptCommonCtl.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptCommonCtl.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -96,7 +96,8 @@
 void listview_scroll (listview_ctrl_t ctx, int oldpos, int newpos);
 int listview_del_column (listview_ctrl_t ctx, int pos);
 int listview_add_item_image (listview_ctrl_t ctx, const char *text, int image);
-void listview_set_image_list (listview_ctrl_t ctx, HICON *ico, DWORD nicons);
+void listview_set_image_list (listview_ctrl_t ctx, int cx, int cy, 
+			      HICON *ico, DWORD nicons);
 
 /*-- Image List --*/
 extern HIMAGELIST glob_imagelist;

Modified: trunk/Include/wptGPG.h
===================================================================
--- trunk/Include/wptGPG.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptGPG.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -195,9 +195,10 @@
 
 /*-- wptPassphraseCB.cpp --*/
 enum passdlg_t {
-    PASSDLG_REPEAT = 0,
-    PASSDLG_INIT = 1,  
-    PASSDLG_STRICT = 2
+    PASSDLG_REPEAT  = 0,
+    PASSDLG_INIT    = 1,  
+    PASSDLG_STRICT  = 2,
+    PASSDLG_NOTEMPTY= 4
 };
 
 void set_gpg_passphrase_cb (passphrase_cb_s *cb, gpgme_ctx_t ctx,
@@ -245,5 +246,7 @@
 				char **new_keyfile);
 gpgme_error_t get_uat_validity (const char *keyid, gpgme_validity_t *r_valid);
 gpgme_error_t gpg_get_recipients (const char *file, gpgme_recipient_t *r_list);
+gpgme_error_t gpg_find_key_subpacket (const char *key, int subpktid,
+				      char **value);
 
 #endif /* WPT_GPG_H */

Modified: trunk/Include/wptHTTP.h
===================================================================
--- trunk/Include/wptHTTP.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptHTTP.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -1,5 +1,5 @@
 /* wptHttp.h - Generic HTTP code
- *	Copyright (C) 2004, 2005 Timo Schulz
+ *	Copyright (C) 2004, 2005, 2006 Timo Schulz
  *
  * This file is part of WinPT.
  *
@@ -21,65 +21,80 @@
 #ifndef WPT_HTTP_H
 #define WPT_HTTP_H
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* HTTP methods. */
-enum http_types_t {
-    HTTP_NONE = 0,
-    HTTP_GET,
-    HTTP_POST,
-};
-
 /* HTTP status codes. */
 enum http_statcode_t {
     HTTP_STAT_NONE = 0,
     HTTP_STAT_200 = 200,  /* OK */
+    HTTP_STAT_201 = 201,  /* Created */
     HTTP_STAT_301 = 301,  /* Moved Permanently */
     HTTP_STAT_302 = 302,  /* Moved Temporarily */
     HTTP_STAT_400 = 400,  /* Bad Request */
+    HTTP_STAT_401 = 401,  /* Unauthorized */
     HTTP_STAT_403 = 403,  /* Forbidden */
     HTTP_STAT_404 = 404,  /* Not Found */
     HTTP_STAT_405 = 405,  /* Method Not Allowed */
 };
 
+
 /* HTTP header list. */
 struct http_head_s {
     struct http_head_s * next;
     int flags;
     char d[1];
 };
-typedef struct http_head_s * http_head_t;
+typedef struct http_head_s *http_head_t;
 
-/* HTTP handle. */
-struct http_hd_s {
+class wHTTP {
+public:
+    /* HTTP methods. */
+    enum  { HTTP_GET, HTTP_HEAD, HTTP_PUT, HTTP_POST };
+
+private:
+    http_head_t req_headers;
+    http_head_t resp_headers;
     int fd;
-    http_head_t head;  
-};
-typedef struct http_hd_s * http_hd_t;
+    int statcode;
+    char *host;
+    int port;
+    char *url;
+    int nleft;
+    int method;
+    int ver;
 
-/* HTTP request. */
-struct http_req_s {
-    int type;
-    http_head_t head;
-    char * url;  
-};
-typedef struct http_req_s * http_req_t;
+private:
+    void reset (void);
+    int parseResponse (int *statcode);
+    int connect (const char *host, int port);
+    int isDataAvailable (int fd);
+    int readLine (char *buf, unsigned int nbuf, int nonblock, int *nn, int *eof);
+    void addHeader (http_head_t *root, const char *val);
+    bool findHeader (http_head_t root, 
+		     const char *name, const char **val);
+    int parseHeaders (http_head_t *r_head);
 
-int http_send_request (const char * host, int port, const char* url,
-                       http_hd_t * r_hd);
-int http_send_request2 (const char * url, http_hd_t * r_hd);
-int http_parse_response (http_hd_t hd, int * statcode);
-int http_parse_data (http_hd_t hd, FILE * out);
-int http_hd_new (http_hd_t * hd);
-void http_hd_free (http_hd_t hd);
-int http_req_new (http_req_t * ctx);
-void http_req_free (http_req_t ctx);
-int http_parse_request (http_hd_t hd, http_req_t * r_req);
+    int extractHostInfo (const char *url, char **host, char **new_url);
+    int sendRequest (const char *host, int port, const char *url);
 
-#ifdef __cplusplus
-}
-#endif
+public:
+    wHTTP ();
+    wHTTP (const char *url);
+    wHTTP (const char *host, int port, const char *url);
+    ~wHTTP ();
+    
+    void setVersion (int ver);
+    int getStatusCode (void);
+    unsigned int getContentLength (void);
+    const char *getContentType (void);
 
+    int addRequestHeader (const char *name, const char *val);
+    int addRequestHeader (const char *name, unsigned int val);
+    
+    int write (const void *buf, unsigned int buflen);
+    int read (void *buf, unsigned int buflen);
+    int readData (FILE *out);
+
+    int get (const char *url);
+    int head (const char *url);
+};
+
 #endif /* WPT_HTTP_H */

Modified: trunk/Include/wptKeyCache.h
===================================================================
--- trunk/Include/wptKeyCache.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptKeyCache.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -25,6 +25,13 @@
     KC_FLAG_UPD = 2
 };
 
+/* key specifc attributes. */
+enum keycache_attr_t {
+    KC_ATTR_PREFSYM	= 11,
+    KC_ATTR_PREFKSERV	= 24
+};
+
+
 struct keycache_s {
     struct keycache_s *next;
     int flags;
@@ -43,6 +50,7 @@
 	gpgme_validity_t validity;  /* attribute id validity. */
     } attrib;
     unsigned char *sym_prefs;/* symmetric cipher preferences. */
+    char *pref_keyserver;   /* if != NULL preferred keyserver. */
     char *card_type;	    /* if != NULL key stored on smart card. */
 };
 
@@ -95,5 +103,7 @@
 					    const char *pattern);
 gpgme_error_t gpg_keycache_get_default_key (gpg_keycache_t ctx,
 					    gpgme_key_t *r_key);
+gpgme_error_t gpg_keycache_update_attr (struct keycache_s *item,
+					int attr, int force);
 
 #endif /*WPT_KEYCACHE_H*/

Modified: trunk/Include/wptKeyserver.h
===================================================================
--- trunk/Include/wptKeyserver.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptKeyserver.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -103,7 +103,7 @@
 void kserver_proxy_release (keyserver_proxy_t ctx);
 const char* kserver_get_hostname (int idx, int type, unsigned short *port);
 void keyserver_set_default (const char *hostname, unsigned short port);
-void set_default_kserver (void);
+void kserver_set_socket_timeout (int nsec);
 
 /*-- General --*/
 int check_IP_or_hostname (const char *name);

Modified: trunk/Include/wptRegistry.h
===================================================================
--- trunk/Include/wptRegistry.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptRegistry.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -68,6 +68,7 @@
     /* Actual no registry options but virtual options. */
     struct {
 	unsigned int ask_cert_level:1;
+	unsigned int ask_cert_expire:1;
     } gpg;
 };
 

Modified: trunk/Include/wptTypes.h
===================================================================
--- trunk/Include/wptTypes.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptTypes.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -23,7 +23,6 @@
 
 /* Type shortcuts. */
 typedef unsigned char	 byte;
-typedef unsigned short	 u16;
 typedef unsigned long	 u32;
 typedef unsigned int	 ui32;
 typedef unsigned __int64 ui64;

Modified: trunk/Include/wptW32API.h
===================================================================
--- trunk/Include/wptW32API.h	2006-03-14 11:01:22 UTC (rev 181)
+++ trunk/Include/wptW32API.h	2006-03-14 11:02:32 UTC (rev 182)
@@ -35,6 +35,11 @@
 int mapi_send_ascfile (char *ascfile);
 void mapi_deinit (void);
 
+/*-- wptSafeEditCtrl.cpp --*/
+UINT SafeGetDlgItemText (HWND dlg, int id, char *buf, int buflen);
+void safe_edit_control_init (HWND dlg, int ctlid);
+void safe_edit_control_free (HWND dlg, int ctlid);
+
 /*-- wptW32API.cpp --*/
 char* make_filename (const char *path, const char *file, const char *ext);
 char* make_special_filename (int folder, const char *file, const char *ext);



More information about the Winpt-commits mailing list