Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef GO_FILE_H
00021 #define GO_FILE_H
00022
00023 #include <glib.h>
00024 #include <gsf/gsf.h>
00025 #include <time.h>
00026
00027 G_BEGIN_DECLS
00028
00029 typedef struct _GOFilePermissions GOFilePermissions;
00030
00031 struct _GOFilePermissions {
00032 gboolean owner_read;
00033 gboolean owner_write;
00034 gboolean owner_execute;
00035
00036 gboolean group_read;
00037 gboolean group_write;
00038 gboolean group_execute;
00039
00040 gboolean others_read;
00041 gboolean others_write;
00042 gboolean others_execute;
00043 };
00044
00045 typedef enum {
00046 GO_DOTDOT_SYNTACTIC,
00047 GO_DOTDOT_TEST,
00048 GO_DOTDOT_LEAVE
00049 } GODotDot;
00050
00051 #ifndef R_OK
00052 # define F_OK 0
00053 # define X_OK 1
00054 # define W_OK 2
00055 # define R_OK 4
00056 #endif
00057
00058 char *go_filename_simplify (const char *filename, GODotDot dotdot, gboolean make_absolute);
00059 char *go_url_simplify (const char *uri);
00060
00061 char *go_filename_from_uri (const char *uri);
00062 char *go_filename_to_uri (const char *filename);
00063
00064 char *go_url_resolve_relative (const char *ref_uri, const char *rel_uri);
00065 char *go_url_make_relative (const char *uri, const char *ref_uri);
00066
00067 char *go_shell_arg_to_uri (const char *arg);
00068 char *go_basename_from_uri (const char *uri);
00069 char *go_dirname_from_uri (const char *uri, gboolean brief);
00070 gchar const **go_shell_argv_to_glib_encoding (gint argc, gchar const **argv);
00071 void go_shell_argv_to_glib_encoding_free (void);
00072
00073 GsfInput *go_file_open (char const *uri, GError **err);
00074 GsfOutput *go_file_create (char const *uri, GError **err);
00075 GSList *go_file_split_urls (char const *data);
00076
00077 gchar *go_file_get_owner_name (char const *uri);
00078 gchar *go_file_get_group_name (char const *uri);
00079
00080 GOFilePermissions *go_get_file_permissions (char const *uri);
00081 void go_set_file_permissions (char const *uri, GOFilePermissions * file_permissions);
00082
00083 time_t go_file_get_date_accessed (char const *uri);
00084 time_t go_file_get_date_modified (char const *uri);
00085 time_t go_file_get_date_changed (char const *uri);
00086
00087 gint go_file_access (char const *uri, gint mode);
00088
00089 gchar *go_url_decode (gchar const *text);
00090 gchar *go_url_encode (gchar const *text, int type);
00091 GError *go_url_show (gchar const *url);
00092 gboolean go_url_check_extension (gchar const *uri,
00093 gchar const *std_ext,
00094 gchar **new_uri);
00095 gchar *go_get_mime_type (gchar const *uri);
00096 gchar *go_get_mime_type_for_data (gconstpointer data, int data_size);
00097 gchar const *go_mime_type_get_description (gchar const *mime_type);
00098
00099 #ifndef HAVE_G_ACCESS
00100 #ifdef G_OS_WIN32
00101 #error "A glib with g_access is required for Win32"
00102 #else
00103 #define g_access access
00104 #endif
00105 #endif
00106
00107 G_END_DECLS
00108
00109 #endif