diff lib/gftp.h @ 499:39e9945288ea

2004-7-13 Brian Masney <masneyb@gftp.org> * lib/gftp.h lib/local.c lib/misc.c lib/protocols.c lib/rfc2068.c lib/rfc959.c lib/sshv2.c src/gtk/chmod_dialog.c src/gtk/delete_dialog.c src/gtk/dnd.c src/gtk/gftp-gtk.c src/gtk/gtkui_transfer.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/view_dialog.c src/text/textui.c src/uicommon/gftpui.c src/uicommon/gftpuicallbacks.c - represent the file attributes as a mode_t variable instead of a character string
author masneyb
date Tue, 13 Jul 2004 20:17:42 +0000
parents 7334a74db6f6
children ba50a7085d93
line wrap: on
line diff
--- a/lib/gftp.h	Tue Jul 13 02:44:35 2004 +0000
+++ b/lib/gftp.h	Tue Jul 13 20:17:42 2004 +0000
@@ -209,6 +209,8 @@
 #define GFTP_SORT_COL_DATETIME			5
 #define GFTP_SORT_COL_ATTRIBS			6
 
+#define GFTP_IS_SPECIAL_DEVICE(mode)	(S_ISBLK (mode) || S_ISCHR (mode))
+
 struct gftp_file_tag 
 {
   char *file,			/* Our filename */
@@ -217,7 +219,6 @@
 				   UTF-8 */
        *user,			/* User that owns it */
        *group,			/* Group that owns it */
-       *attribs,		/* Attribs (-rwxr-x-rx) */
        *destfile;		/* Full pathname to the destination for the 
                                    file transfer */
 
@@ -227,10 +228,8 @@
   time_t datetime;		/* File date and time */
   off_t size,			/* Size of the file */
         startsize;		/* Size to start the transfer at */
-  unsigned int isdir : 1,	/* File type */
-               isexe : 1,
-               islink : 1,
-               selected : 1,	/* Is this file selected? */
+  mode_t st_mode;		/* File attributes */
+  unsigned int selected : 1,	/* Is this file selected? */
                was_sel : 1,	/* Was this file selected before  */
                shown : 1,	/* Is this file shown? */
                done_view : 1,	/* View the file when done transfering? */
@@ -448,7 +447,7 @@
 					  const char *newname );
   int (*chmod)				( gftp_request * request, 
 					  const char *filename, 
-					  int mode );
+					  mode_t mode );
   int (*set_file_time)			( gftp_request * request, 
 					  const char *filename, 
 					  time_t datettime );
@@ -738,8 +737,6 @@
 					  int column, 
 					  int asds );
 
-mode_t gftp_parse_attribs 		( char *attribs );
-
 char * gftp_gen_ls_string 		( gftp_file * fle, 
 					  char *file_prefixstr, 
 					  char *file_suffixstr );
@@ -924,7 +921,7 @@
 
 int gftp_chmod 				( gftp_request * request, 
 					  const char *file, 
-					  int mode );
+					  mode_t mode );
 
 int gftp_set_file_time 			( gftp_request * request, 
 					  const char *file, 
@@ -1025,6 +1022,11 @@
 					  int *ptymfd,
 					  char **args );
 
+char *gftp_convert_attributes_from_mode_t ( mode_t mode );
+
+mode_t gftp_convert_attributes_to_mode_t ( char *attribs );
+
+
 #ifdef USE_SSL
 /* sslcommon.c */
 int gftp_ssl_startup 			( gftp_request * request );