You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by nw...@apache.org on 2014/08/05 12:21:40 UTC

[6/8] git commit: Cache full_path in FileSpec

Cache full_path in FileSpec


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/666be2e3
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/666be2e3
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/666be2e3

Branch: refs/heads/master
Commit: 666be2e3f6f48334ff818d07fe287264ecb554c5
Parents: a32faa7
Author: Nick Wellnhofer <we...@aevum.de>
Authored: Fri Aug 1 14:31:16 2014 +0200
Committer: Nick Wellnhofer <we...@aevum.de>
Committed: Tue Aug 5 11:56:01 2014 +0200

----------------------------------------------------------------------
 compiler/src/CFCFileSpec.c | 11 +++++++++++
 compiler/src/CFCFileSpec.h |  3 +++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/666be2e3/compiler/src/CFCFileSpec.c
----------------------------------------------------------------------
diff --git a/compiler/src/CFCFileSpec.c b/compiler/src/CFCFileSpec.c
index 41e3ba4..90e3b76 100644
--- a/compiler/src/CFCFileSpec.c
+++ b/compiler/src/CFCFileSpec.c
@@ -14,6 +14,8 @@
  * limitations under the License.
  */
 
+#include "charmony.h"
+
 #include <string.h>
 #include <stdio.h>
 #include <ctype.h>
@@ -33,6 +35,7 @@ struct CFCFileSpec {
     CFCBase base;
     char *source_dir;
     char *path_part;
+    char *path;
     int is_included;
 };
 
@@ -57,6 +60,8 @@ CFCFileSpec_init(CFCFileSpec *self, const char *source_dir,
 
     self->source_dir  = CFCUtil_strdup(source_dir);
     self->path_part   = CFCUtil_strdup(path_part);
+    self->path        = CFCUtil_sprintf("%s" CHY_DIR_SEP "%s", source_dir,
+                                        path_part);
     self->is_included = !!is_included;
 
     return self;
@@ -66,10 +71,16 @@ void
 CFCFileSpec_destroy(CFCFileSpec *self) {
     FREEMEM(self->source_dir);
     FREEMEM(self->path_part);
+    FREEMEM(self->path);
     CFCBase_destroy((CFCBase*)self);
 }
 
 const char*
+CFCFileSpec_get_path(CFCFileSpec *self) {
+    return self->path;
+}
+
+const char*
 CFCFileSpec_get_source_dir(CFCFileSpec *self) {
     return self->source_dir;
 }

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/666be2e3/compiler/src/CFCFileSpec.h
----------------------------------------------------------------------
diff --git a/compiler/src/CFCFileSpec.h b/compiler/src/CFCFileSpec.h
index 830a618..971bdd5 100644
--- a/compiler/src/CFCFileSpec.h
+++ b/compiler/src/CFCFileSpec.h
@@ -53,6 +53,9 @@ void
 CFCFileSpec_destroy(CFCFileSpec *self);
 
 const char*
+CFCFileSpec_get_path(CFCFileSpec *self);
+
+const char*
 CFCFileSpec_get_source_dir(CFCFileSpec *self);
 
 const char*