changeset 478:97fd5eb34be0

2004-6-6 Brian Masney <masneyb@gftp.org> * acinclude.m4 configure.in - added AC_TYPE_INTPTR_T that will define intptr_t if it does not exist on the system * lib/gftp.h lib/protocols.c lib/rfc959.c src/uicommon/gftpuicallbacks.c - added specify site argument to rfc959_site(). If this is set, then SITE will be prepended to the command
author masneyb
date Sun, 06 Jun 2004 15:12:35 +0000
parents 4222894fcc10
children 11ab311ccb67
files ChangeLog acinclude.m4 configure.in lib/gftp.h lib/protocols.c lib/rfc959.c src/uicommon/gftpuicallbacks.c
diffstat 7 files changed, 35 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Thu Jun 03 00:49:34 2004 +0000
+++ b/ChangeLog	Sun Jun 06 15:12:35 2004 +0000
@@ -1,3 +1,12 @@
+2004-6-6 Brian Masney <masneyb@gftp.org>
+	* acinclude.m4 configure.in - added AC_TYPE_INTPTR_T that will define
+	intptr_t if it does not exist on the system
+
+	* lib/gftp.h lib/protocols.c lib/rfc959.c
+	src/uicommon/gftpuicallbacks.c - added specify site argument to
+	rfc959_site(). If this is set, then SITE will be prepended to the
+	command
+
 2004-5-26 Brian Masney <masneyb@gftp.org>
 	* docs/gftp.desktop - make desktop item follow HIG (closes #142005)
 
@@ -2475,7 +2484,7 @@
 
 	* cvsclean - added this script
 
-	* *.[ch] - added $Id: ChangeLog,v 1.265 2004/05/27 10:27:37 masneyb Exp $ tags
+	* *.[ch] - added $Id: ChangeLog,v 1.266 2004/06/06 15:12:35 masneyb Exp $ tags
 
 	* debian/* - updated files from Debian maintainer
 
--- a/acinclude.m4	Thu Jun 03 00:49:34 2004 +0000
+++ b/acinclude.m4	Sun Jun 06 15:12:35 2004 +0000
@@ -154,3 +154,16 @@
     [AC_MSG_RESULT(no)])
   ])
 
+# serial 1
+
+dnl Brian Masney <masneyb@gftp.org>
+
+AC_DEFUN(AC_TYPE_INTPTR_T,
+  [AC_MSG_CHECKING([for intptr_t in stdint.h])
+   AC_TRY_COMPILE([#include <stdint.h>],
+   [intptr_t i = 0;],
+     [AC_MSG_RESULT(yes)],
+     [AC_DEFINE(intptr_t,long,Need to define intptr_t as a long because it should be in stdint.h)
+      AC_MSG_RESULT(no)])
+  ])
+
--- a/configure.in	Thu Jun 03 00:49:34 2004 +0000
+++ b/configure.in	Sun Jun 06 15:12:35 2004 +0000
@@ -57,6 +57,7 @@
 
 AC_TYPE_SOCKLEN_T
 AC_TYPE_MODE_T
+AC_TYPE_INTPTR_T
 AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 AC_HEADER_TIME
--- a/lib/gftp.h	Thu Jun 03 00:49:34 2004 +0000
+++ b/lib/gftp.h	Sun Jun 06 15:12:35 2004 +0000
@@ -449,6 +449,7 @@
 					  const char *filename, 
 					  time_t datettime );
   int (*site)				( gftp_request * request, 
+					  int specify_site,
 					  const char *filename );
   int (*parse_url)			( gftp_request * request,
 					  const char *url );
@@ -924,6 +925,7 @@
 					  time_t datetime );
 
 char gftp_site_cmd 			( gftp_request * request, 
+					  int specify_site,
 					  const char *command );
 
 off_t gftp_get_file_size 		( gftp_request * request, 
--- a/lib/protocols.c	Thu Jun 03 00:49:34 2004 +0000
+++ b/lib/protocols.c	Sun Jun 06 15:12:35 2004 +0000
@@ -1003,13 +1003,13 @@
 
 
 char
-gftp_site_cmd (gftp_request * request, const char *command)
+gftp_site_cmd (gftp_request * request, int specify_site, const char *command)
 {
   g_return_val_if_fail (request != NULL, GFTP_EFATAL);
 
   if (request->site == NULL)
     return (GFTP_EFATAL);
-  return (request->site (request, command));
+  return (request->site (request, specify_site, command));
 }
 
 
--- a/lib/rfc959.c	Thu Jun 03 00:49:34 2004 +0000
+++ b/lib/rfc959.c	Sun Jun 06 15:12:35 2004 +0000
@@ -1665,7 +1665,7 @@
 
 
 static int
-rfc959_site (gftp_request * request, const char *command)
+rfc959_site (gftp_request * request, int specify_site, const char *command)
 {
   char *tempstr, ret;
 
@@ -1673,7 +1673,11 @@
   g_return_val_if_fail (command != NULL, GFTP_EFATAL);
   g_return_val_if_fail (request->datafd > 0, GFTP_EFATAL);
 
-  tempstr = g_strconcat ("SITE ", command, "\r\n", NULL);
+  if (specify_site)
+    tempstr = g_strconcat ("SITE ", command, "\r\n", NULL);
+  else
+    tempstr = g_strconcat (command, "\r\n", NULL);
+
   ret = rfc959_send_command (request, tempstr, 1);
   g_free (tempstr);
 
--- a/src/uicommon/gftpuicallbacks.c	Thu Jun 03 00:49:34 2004 +0000
+++ b/src/uicommon/gftpuicallbacks.c	Sun Jun 06 15:12:35 2004 +0000
@@ -39,7 +39,7 @@
 int
 gftpui_common_run_site (gftpui_callback_data * cdata)
 {
-  return (gftp_site_cmd (cdata->request, cdata->input_string));
+  return (gftp_site_cmd (cdata->request, 1, cdata->input_string));
 }