Misc cleanup.
authorenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 15 Dec 2008 17:59:19 +0000 (17:59 +0000)
committerenglebass <englebass@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 15 Dec 2008 17:59:19 +0000 (17:59 +0000)
- Don't use EAPI for internal functions.
- Add prototypes to header.
- Some compiler warnings.

git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@38150 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_con/ecore_con.c
src/lib/ecore_con/ecore_con_private.h
src/lib/ecore_con/ecore_con_ssl.c

index e064747..ebbfa6d 100644 (file)
@@ -1218,7 +1218,7 @@ _ecore_con_svr_handler(void *data, Ecore_Fd_Handler *fd_handler __UNUSED__)
            (ecore_con_ssl_client_init(cl)))
          {
            close(new_fd);
-           ecore_con_ssl_client_shutdown(svr);
+           ecore_con_ssl_client_shutdown(cl);
            return 1;
          }
 
@@ -1275,7 +1275,7 @@ _ecore_con_cl_handler(void *data, Ecore_Fd_Handler *fd_handler)
          {
            int num;
            int lost_server = 1;
-           char buf[READBUFSIZ];
+           unsigned char buf[READBUFSIZ];
 
            if (!(svr->type & ECORE_CON_SSL))
              {
@@ -1519,7 +1519,7 @@ _ecore_con_svr_cl_handler(void *data, Ecore_Fd_Handler *fd_handler)
 
        for (;;)
          {
-            char buf[65536];
+            unsigned char buf[65536];
             int num;
 
             errno = 0;
@@ -1593,7 +1593,7 @@ _ecore_con_svr_cl_handler(void *data, Ecore_Fd_Handler *fd_handler)
 static void
 _ecore_con_server_flush(Ecore_Con_Server *svr)
 {
-   int count, num, lost_server = 0;
+   int count, num;
 
    if (!svr->write_buf) return;
 
index c3cbe9f..c1f0e96 100644 (file)
@@ -141,5 +141,17 @@ int ecore_con_info_mcast_listen(Ecore_Con_Server *svr, Ecore_Con_Info_Cb done_cb
 /* from ecore_con_ssl.c */
 Ecore_Con_Ssl_Error ecore_con_ssl_init(void);
 Ecore_Con_Ssl_Error ecore_con_ssl_shutdown(void);
+void                ecore_con_ssl_server_prepare(Ecore_Con_Server *svr);
+Ecore_Con_Ssl_Error ecore_con_ssl_server_init(Ecore_Con_Server *svr);
+Ecore_Con_Ssl_Error ecore_con_ssl_server_shutdown(Ecore_Con_Server *svr);
+Ecore_Con_State     ecore_con_ssl_server_try(Ecore_Con_Server *svr);
+int                 ecore_con_ssl_server_read(Ecore_Con_Server *svr, unsigned char *buf, int size);
+int                 ecore_con_ssl_server_write(Ecore_Con_Server *svr, unsigned char *buf, int size);
+Ecore_Con_Ssl_Error ecore_con_ssl_client_init(Ecore_Con_Client *svr);
+Ecore_Con_Ssl_Error ecore_con_ssl_client_shutdown(Ecore_Con_Client *svr);
+Ecore_Con_State     ecore_con_ssl_client_try(Ecore_Con_Client *svr);
+int                 ecore_con_ssl_client_read(Ecore_Con_Client *svr, unsigned char *buf, int size);
+int                 ecore_con_ssl_client_write(Ecore_Con_Client *svr, unsigned char *buf, int size);
+
 
 #endif
index 3d81640..d450cb6 100644 (file)
@@ -42,9 +42,9 @@ SSL_SUFFIX(_ecore_con_ssl_server_shutdown)(Ecore_Con_Server *svr);
 static Ecore_Con_State
 SSL_SUFFIX(_ecore_con_ssl_server_try)(Ecore_Con_Server *svr);
 static int
-SSL_SUFFIX(_ecore_con_ssl_server_read)(Ecore_Con_Server *svr, char *buf, int size);
+SSL_SUFFIX(_ecore_con_ssl_server_read)(Ecore_Con_Server *svr, unsigned char *buf, int size);
 static int
-SSL_SUFFIX(_ecore_con_ssl_server_write)(Ecore_Con_Server *svr, char *buf, int size);
+SSL_SUFFIX(_ecore_con_ssl_server_write)(Ecore_Con_Server *svr, unsigned char *buf, int size);
 
 static void
 SSL_SUFFIX(_ecore_con_ssl_client_prepare)(Ecore_Con_Client *cl);
@@ -53,15 +53,15 @@ SSL_SUFFIX(_ecore_con_ssl_client_init)(Ecore_Con_Client *cl);
 static Ecore_Con_Ssl_Error
 SSL_SUFFIX(_ecore_con_ssl_client_shutdown)(Ecore_Con_Client *cl);
 static int
-SSL_SUFFIX(_ecore_con_ssl_client_read)(Ecore_Con_Client *cl, char *buf, int size);
+SSL_SUFFIX(_ecore_con_ssl_client_read)(Ecore_Con_Client *cl, unsigned char *buf, int size);
 static int
-SSL_SUFFIX(_ecore_con_ssl_client_write)(Ecore_Con_Client *cl, char *buf, int size);
+SSL_SUFFIX(_ecore_con_ssl_client_write)(Ecore_Con_Client *cl, unsigned char *buf, int size);
 
 /*
  * General SSL API
  */
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_init(void)
 {
   if (!_init_count++)
@@ -70,7 +70,7 @@ ecore_con_ssl_init(void)
   return _init_count;
 }
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_shutdown(void)
 {
   if (!--_init_count)
@@ -84,69 +84,69 @@ ecore_con_ssl_shutdown(void)
  * @return  1 if SSL is available, 0 if it is not.
  * @ingroup Ecore_Con_Client_Group
  */
-EAPI int
+int
 ecore_con_ssl_available_get(void)
 {
   return _ECORE_CON_SSL_AVAILABLE;
 }
 
 
-EAPI void
+void
 ecore_con_ssl_server_prepare(Ecore_Con_Server *svr)
 {
   SSL_SUFFIX(_ecore_con_ssl_server_prepare)(svr);
 }
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_server_init(Ecore_Con_Server *svr)
 {
   return SSL_SUFFIX(_ecore_con_ssl_server_init)(svr);
 }
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_server_shutdown(Ecore_Con_Server *svr)
 {
   return SSL_SUFFIX(_ecore_con_ssl_server_shutdown)(svr);
 }
 
-EAPI Ecore_Con_State
+Ecore_Con_State
 ecore_con_ssl_server_try(Ecore_Con_Server *svr)
 {
   return SSL_SUFFIX(_ecore_con_ssl_server_try)(svr);
 }
 
-EAPI int
-ecore_con_ssl_server_read(Ecore_Con_Server *svr, char *buf, int size)
+int
+ecore_con_ssl_server_read(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   return SSL_SUFFIX(_ecore_con_ssl_server_read)(svr, buf, size);
 }
 
-EAPI int
-ecore_con_ssl_server_write(Ecore_Con_Server *svr, char *buf, int size)
+int
+ecore_con_ssl_server_write(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   return SSL_SUFFIX(_ecore_con_ssl_server_write)(svr, buf, size);
 }
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_client_init(Ecore_Con_Client *cl)
 {
   return SSL_SUFFIX(_ecore_con_ssl_client_init)(cl);
 }
 
-EAPI Ecore_Con_Ssl_Error
+Ecore_Con_Ssl_Error
 ecore_con_ssl_client_shutdown(Ecore_Con_Client *cl)
 {
   return SSL_SUFFIX(_ecore_con_ssl_client_shutdown)(cl);
 }
 
-EAPI int
-ecore_con_ssl_client_read(Ecore_Con_Client *cl, char *buf, int size)
+int
+ecore_con_ssl_client_read(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   return SSL_SUFFIX(_ecore_con_ssl_client_read)(cl, buf, size);
 }
 
-EAPI int
-ecore_con_ssl_client_write(Ecore_Con_Client *cl, char *buf, int size)
+int
+ecore_con_ssl_client_write(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   return SSL_SUFFIX(_ecore_con_ssl_client_write)(cl, buf, size);
 }
@@ -186,7 +186,6 @@ static Ecore_Con_Ssl_Error
 _ecore_con_ssl_server_init_gnutls(Ecore_Con_Server *svr)
 {
   const int *proto = NULL;
-  gnutls_dh_params_t dh_params;
   int ret;
   const int kx[] = { GNUTLS_KX_ANON_DH, 0 };
   const int ssl3_proto[] = { GNUTLS_SSL3, 0 };
@@ -263,7 +262,7 @@ _ecore_con_ssl_server_try_gnutls(Ecore_Con_Server *svr)
 }
 
 static int
-_ecore_con_ssl_server_read_gnutls(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_read_gnutls(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   int num;
 
@@ -278,7 +277,7 @@ _ecore_con_ssl_server_read_gnutls(Ecore_Con_Server *svr, char *buf, int size)
 }
 
 static int
-_ecore_con_ssl_server_write_gnutls(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_write_gnutls(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   int num;
 
@@ -381,7 +380,7 @@ _ecore_con_ssl_client_shutdown_gnutls(Ecore_Con_Client *cl)
 }
 
 static int
-_ecore_con_ssl_client_read_gnutls(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_read_gnutls(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   int num;
 
@@ -396,7 +395,7 @@ _ecore_con_ssl_client_read_gnutls(Ecore_Con_Client *cl, char *buf, int size)
 }
 
 static int
-_ecore_con_ssl_client_write_gnutls(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_write_gnutls(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   int num;
 
@@ -523,7 +522,7 @@ _ecore_con_ssl_server_try_openssl(Ecore_Con_Server *svr)
 }
 
 static int
-_ecore_con_ssl_server_read_openssl(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_read_openssl(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   int num;
 
@@ -548,7 +547,7 @@ _ecore_con_ssl_server_read_openssl(Ecore_Con_Server *svr, char *buf, int size)
 }
 
 static int
-_ecore_con_ssl_server_write_openssl(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_write_openssl(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   int num;
 
@@ -629,7 +628,7 @@ _ecore_con_ssl_client_shutdown_openssl(Ecore_Con_Client *cl)
 }
 
 static int
-_ecore_con_ssl_client_read_openssl(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_read_openssl(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   int num;
 
@@ -654,7 +653,7 @@ _ecore_con_ssl_client_read_openssl(Ecore_Con_Client *cl, char *buf, int size)
 }
 
 static int
-_ecore_con_ssl_client_write_openssl(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_write_openssl(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   int num;
 
@@ -724,13 +723,13 @@ _ecore_con_ssl_server_try_none(Ecore_Con_Server *svr)
 }
 
 static int
-_ecore_con_ssl_server_read_none(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_read_none(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   return -1;
 }
 
 static int
-_ecore_con_ssl_server_write_none(Ecore_Con_Server *svr, char *buf, int size)
+_ecore_con_ssl_server_write_none(Ecore_Con_Server *svr, unsigned char *buf, int size)
 {
   return -1;
 }
@@ -754,13 +753,13 @@ _ecore_con_ssl_client_shutdown_none(Ecore_Con_Client *cl)
 }
 
 static int
-_ecore_con_ssl_client_read_none(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_read_none(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   return -1;
 }
 
 static int
-_ecore_con_ssl_client_write_none(Ecore_Con_Client *cl, char *buf, int size)
+_ecore_con_ssl_client_write_none(Ecore_Con_Client *cl, unsigned char *buf, int size)
 {
   return -1;
 }