From: <gnu...@li...> - 2004-02-05 09:27:45
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : / Modified Files: Tag: BRANCH-rewrite ChangeLog Log Message: Added cx_fsnode_{get,set}_file_system(). =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.276.2.83 retrieving revision 1.276.2.84 diff -u -3 -r1.276.2.83 -r1.276.2.84 --- ChangeLog 1 Jan 2004 08:29:49 -0000 1.276.2.83 +++ ChangeLog 5 Feb 2004 09:25:13 -0000 1.276.2.84 @@ -1,3 +1,9 @@ +Thu Feb 05 01:26:01 PST 2004 Christian Hammond <ch...@gn...> + + * libcomprex/fsnode.c: + * libcomprex/fsnode.h: + - Added cx_fsnode_{get,set}_file_system(). + Thu Jan 01 00:28:59 PST 2004 Christian Hammond <ch...@gn...> * Copyright Commit 2004. |
From: <gnu...@li...> - 2004-02-05 09:27:45
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite fsnode.c fsnode.h Log Message: Added cx_fsnode_{get,set}_file_system(). =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.c,v retrieving revision 1.18.2.4 retrieving revision 1.18.2.5 diff -u -3 -r1.18.2.4 -r1.18.2.5 --- fsnode.c 1 Jan 2004 08:29:50 -0000 1.18.2.4 +++ fsnode.c 5 Feb 2004 09:25:13 -0000 1.18.2.5 @@ -195,6 +195,7 @@ static void cx_fsnode_init(CxFsNode *fsnode) { + fsnode->fs = NULL; fsnode->name = NULL; fsnode->mode = 0; fsnode->uid = 0; @@ -349,6 +350,14 @@ } void +cx_fsnode_set_file_system(CxFsNode *node, CxFileSystem *fs) +{ + g_return_if_fail(node != NULL); + + node->fs = fs; +} + +void cx_fsnode_set_name(CxFsNode *node, const gchar *name) { g_return_if_fail(node != NULL); @@ -437,6 +446,14 @@ node->local = local; } +CxFileSystem * +cx_fsnode_get_file_system(const CxFsNode *node) +{ + g_return_val_if_fail(node != NULL, NULL); + + return node->fs; +} + const gchar * cx_fsnode_get_name(const CxFsNode *node) { =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.h,v retrieving revision 1.18.2.6 retrieving revision 1.18.2.7 diff -u -3 -r1.18.2.6 -r1.18.2.7 --- fsnode.h 1 Jan 2004 08:29:50 -0000 1.18.2.6 +++ fsnode.h 5 Feb 2004 09:25:14 -0000 1.18.2.7 @@ -48,6 +48,8 @@ { CxObject parent; /**< The parent object. */ + CxFileSystem *fs; /**< The file system. */ + gchar *name; /**< The base filename or directory name. */ mode_t mode; /**< The node's mode. */ @@ -90,6 +92,16 @@ GType cx_fsnode_get_type(void); /** + * Sets the node's file system. + * + * @param node The node. + * @param fs The file system. + * + * @see cx_fsnode_get_file_system() + */ +void cx_fsnode_set_file_system(CxFsNode *node, CxFileSystem *fs); + +/** * Sets the base name of the specified node. * * @param node The node. @@ -204,6 +216,17 @@ const gchar *cx_fsnode_get_name(const CxFsNode *node); /** + * Returns the node's file system. + * + * @param node The node. + * + * @return The node's file system. + * + * @see cx_fsnode_set_file_system() + */ +CxFileSystem *cx_fsnode_get_file_system(const CxFsNode *node); + +/** * Returns the full path to the specified node. * * This may include such non-physical elements as FTP sites, archives, |
From: <gnu...@li...> - 2004-02-05 09:46:41
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite filesystemfactory.c Log Message: The file system is now set on each node created in a factory. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/Attic/filesystemfactory.c,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -u -3 -r1.1.2.3 -r1.1.2.4 --- filesystemfactory.c 1 Jan 2004 08:29:50 -0000 1.1.2.3 +++ filesystemfactory.c 5 Feb 2004 09:44:02 -0000 1.1.2.4 @@ -195,6 +195,7 @@ const gchar *name, GType type) { CxFileSystemFactoryClass *klass; + CxFsNode *node = NULL; g_return_val_if_fail(factory != NULL, NULL); g_return_val_if_fail(CX_IS_FILE_SYSTEM_FACTORY(factory), NULL); @@ -203,7 +204,12 @@ klass = CX_FILE_SYSTEM_FACTORY_GET_CLASS(factory); if (klass->create_node != NULL) - return klass->create_node(factory, name, type); + { + node = klass->create_node(factory, name, type); - return NULL; + cx_fsnode_set_file_system(node, + cx_file_system_factory_get_file_system(factory)); + } + + return node; } |
From: <gnu...@li...> - 2004-02-05 09:46:41
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : / Modified Files: Tag: BRANCH-rewrite ChangeLog Log Message: The file system is now set on each node created in a factory. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.276.2.84 retrieving revision 1.276.2.85 diff -u -3 -r1.276.2.84 -r1.276.2.85 --- ChangeLog 5 Feb 2004 09:25:13 -0000 1.276.2.84 +++ ChangeLog 5 Feb 2004 09:44:02 -0000 1.276.2.85 @@ -1,3 +1,8 @@ +Thu Feb 05 01:40:24 PST 2004 Christian Hammond <ch...@gn...> + + * libcomprex/filesystemfactory.c: + - The file system is now set on each node created in a factory. + Thu Feb 05 01:26:01 PST 2004 Christian Hammond <ch...@gn...> * libcomprex/fsnode.c: |
From: <gnu...@li...> - 2004-02-05 10:11:33
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite fsnode.c fsnode.h Log Message: Added cx_fsnode_{get,set}_parent(). =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.c,v retrieving revision 1.18.2.5 retrieving revision 1.18.2.6 diff -u -3 -r1.18.2.5 -r1.18.2.6 --- fsnode.c 5 Feb 2004 09:25:13 -0000 1.18.2.5 +++ fsnode.c 5 Feb 2004 10:09:03 -0000 1.18.2.6 @@ -358,6 +358,14 @@ } void +cx_fsnode_set_parent(CxFsNode *node, CxDirectory *dir) +{ + g_return_if_fail(node != NULL); + + node->parent = dir; +} + +void cx_fsnode_set_name(CxFsNode *node, const gchar *name) { g_return_if_fail(node != NULL); @@ -454,6 +462,17 @@ return node->fs; } +CxFsNode * +cx_fsnode_get_parent(const CxFsNode *node) +{ + g_return_val_if_fail(node != NULL, NULL); + + if (node->parent != NULL) + return CX_FSNODE(node->parent); + + return NULL; +} + const gchar * cx_fsnode_get_name(const CxFsNode *node) { =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.h,v retrieving revision 1.18.2.7 retrieving revision 1.18.2.8 diff -u -3 -r1.18.2.7 -r1.18.2.8 --- fsnode.h 5 Feb 2004 09:25:14 -0000 1.18.2.7 +++ fsnode.h 5 Feb 2004 10:09:03 -0000 1.18.2.8 @@ -46,9 +46,10 @@ */ struct _CxFsNode { - CxObject parent; /**< The parent object. */ + CxObject parent_object; /**< The parent object. */ CxFileSystem *fs; /**< The file system. */ + CxDirectory *parent; /**< The parent directory. */ gchar *name; /**< The base filename or directory name. */ @@ -102,6 +103,16 @@ void cx_fsnode_set_file_system(CxFsNode *node, CxFileSystem *fs); /** + * Sets the node's parent directory. + * + * @param node The node. + * @param parent The parent directory. + * + * @see cx_fsnode_get_parent() + */ +void cx_fsnode_set_parent(CxFsNode *node, CxDirectory *dir); + +/** * Sets the base name of the specified node. * * @param node The node. @@ -205,26 +216,37 @@ void cx_fsnode_set_local(CxFsNode *node, gboolean local); /** - * Returns the name of the specified node. + * Returns the node's file system. * * @param node The node. * - * @return The node's name. + * @return The node's file system. * - * @see cx_fsnode_set_name() + * @see cx_fsnode_set_file_system() */ -const gchar *cx_fsnode_get_name(const CxFsNode *node); +CxFileSystem *cx_fsnode_get_file_system(const CxFsNode *node); /** - * Returns the node's file system. + * Returns the node's parent directory. * * @param node The node. * - * @return The node's file system. + * @return The node's parent directory. * - * @see cx_fsnode_set_file_system() + * @see cx_fsnode_set_parent() */ -CxFileSystem *cx_fsnode_get_file_system(const CxFsNode *node); +CxFsNode *cx_fsnode_get_parent(const CxFsNode *node); + +/** + * Returns the name of the specified node. + * + * @param node The node. + * + * @return The node's name. + * + * @see cx_fsnode_set_name() + */ +const gchar *cx_fsnode_get_name(const CxFsNode *node); /** * Returns the full path to the specified node. |
From: <gnu...@li...> - 2004-02-05 10:28:20
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : / Modified Files: Tag: BRANCH-rewrite ChangeLog Log Message: Rather than returning the parent directory as a raw CxFsNode, just return it as a CxDirectory. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.276.2.86 retrieving revision 1.276.2.87 diff -u -3 -r1.276.2.86 -r1.276.2.87 --- ChangeLog 5 Feb 2004 10:09:01 -0000 1.276.2.86 +++ ChangeLog 5 Feb 2004 10:12:13 -0000 1.276.2.87 @@ -1,3 +1,10 @@ +Thu Feb 05 02:13:55 PST 2004 Christian Hammond <ch...@gn...> + + * libcomprex/fsnode.c: + * libcomprex/fsnode.h: + - Rather than returning the parent directory as a raw CxFsNode, + just return it as a CxDirectory. + Thu Feb 05 02:09:48 PST 2004 Christian Hammond <ch...@gn...> * libcomprex/fsnode.c: |
From: <gnu...@li...> - 2004-02-05 10:32:54
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite fsnode.c Log Message: Bah. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.c,v retrieving revision 1.18.2.7 retrieving revision 1.18.2.8 diff -u -3 -r1.18.2.7 -r1.18.2.8 --- fsnode.c 5 Feb 2004 10:12:13 -0000 1.18.2.7 +++ fsnode.c 5 Feb 2004 10:30:23 -0000 1.18.2.8 @@ -462,7 +462,7 @@ return node->fs; } -CxFsNode * +CxDirectory * cx_fsnode_get_parent(const CxFsNode *node) { g_return_val_if_fail(node != NULL, NULL); |
From: <gnu...@li...> - 2004-02-05 10:36:28
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : / Modified Files: Tag: BRANCH-rewrite ChangeLog Log Message: I can't promise it works, but directory.c now compiles. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.276.2.87 retrieving revision 1.276.2.88 diff -u -3 -r1.276.2.87 -r1.276.2.88 --- ChangeLog 5 Feb 2004 10:12:13 -0000 1.276.2.87 +++ ChangeLog 5 Feb 2004 10:14:31 -0000 1.276.2.88 @@ -1,3 +1,8 @@ +Thu Feb 05 02:16:03 PST 2004 Christian Hammond <ch...@gn...> + + * libcomprex/directory.c: + - I can't promise it works, but directory.c now compiles. + Thu Feb 05 02:13:55 PST 2004 Christian Hammond <ch...@gn...> * libcomprex/fsnode.c: |
From: <gnu...@li...> - 2004-02-05 10:39:46
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite fsnode.c fsnode.h Log Message: Rather than returning the parent directory as a raw CxFsNode, just return it as a CxDirectory. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.c,v retrieving revision 1.18.2.6 retrieving revision 1.18.2.7 diff -u -3 -r1.18.2.6 -r1.18.2.7 --- fsnode.c 5 Feb 2004 10:09:03 -0000 1.18.2.6 +++ fsnode.c 5 Feb 2004 10:12:13 -0000 1.18.2.7 @@ -467,10 +467,7 @@ { g_return_val_if_fail(node != NULL, NULL); - if (node->parent != NULL) - return CX_FSNODE(node->parent); - - return NULL; + return node->parent; } const gchar * =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/fsnode.h,v retrieving revision 1.18.2.8 retrieving revision 1.18.2.9 diff -u -3 -r1.18.2.8 -r1.18.2.9 --- fsnode.h 5 Feb 2004 10:09:03 -0000 1.18.2.8 +++ fsnode.h 5 Feb 2004 10:12:14 -0000 1.18.2.9 @@ -235,7 +235,7 @@ * * @see cx_fsnode_set_parent() */ -CxFsNode *cx_fsnode_get_parent(const CxFsNode *node); +CxDirectory *cx_fsnode_get_parent(const CxFsNode *node); /** * Returns the name of the specified node. |
From: <gnu...@li...> - 2004-02-05 10:39:53
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : / Modified Files: Tag: BRANCH-rewrite ChangeLog Log Message: Added cx_fsnode_{get,set}_parent(). =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/ChangeLog,v retrieving revision 1.276.2.85 retrieving revision 1.276.2.86 diff -u -3 -r1.276.2.85 -r1.276.2.86 --- ChangeLog 5 Feb 2004 09:44:02 -0000 1.276.2.85 +++ ChangeLog 5 Feb 2004 10:09:01 -0000 1.276.2.86 @@ -1,3 +1,9 @@ +Thu Feb 05 02:09:48 PST 2004 Christian Hammond <ch...@gn...> + + * libcomprex/fsnode.c: + * libcomprex/fsnode.h: + - Added cx_fsnode_{get,set}_parent(). + Thu Feb 05 01:40:24 PST 2004 Christian Hammond <ch...@gn...> * libcomprex/filesystemfactory.c: |
From: <gnu...@li...> - 2004-02-05 11:13:35
|
GNUpdate CVS commit Author : chipx86 Module : libcomprex Path : /libcomprex Modified Files: Tag: BRANCH-rewrite directory.c Log Message: I can't promise it works, but directory.c now compiles. =================================================================== RCS file: /cvsroot/gnupdate/libcomprex/libcomprex/directory.c,v retrieving revision 1.54.2.6 retrieving revision 1.54.2.7 diff -u -3 -r1.54.2.6 -r1.54.2.7 --- directory.c 1 Jan 2004 08:29:49 -0000 1.54.2.6 +++ directory.c 5 Feb 2004 10:14:31 -0000 1.54.2.7 @@ -20,6 +20,7 @@ */ #include <libcomprex/directory.h> #include <libcomprex/debug.h> +#include <libcomprex/utils.h> #include <string.h> /* Signals */ @@ -124,7 +125,6 @@ static CxDirectory * get_existing_part(CxDirectory *base, const gchar *path, gchar **invalid_part) { -#if 0 CxDirectory *dir = NULL; gchar *new_path; const gchar *p, *p2; @@ -182,7 +182,7 @@ if (strncmp(dirname, ".", 2)) { GList *l; - CxFsNode *node; + CxFsNode *node = NULL; /* Try to see if this exists. */ for (l = cx_directory_get_contents(dir); l != NULL; l = l->next) @@ -223,9 +223,6 @@ g_free(new_path); return dir; -#endif - - return NULL; } CxFsNode * |