You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2011/06/29 02:55:00 UTC
[lucy-commits] svn commit: r1140924 - in /incubator/lucy/trunk/charmonizer/src/Charmonizer:
Core/ConfWriter.c Core/Stat.c Core/Stat.h Probe.c
Author: marvin
Date: Wed Jun 29 00:54:59 2011
New Revision: 1140924
URL: http://svn.apache.org/viewvc?rev=1140924&view=rev
Log:
LUCY-169 Clarify cleanup responsibility.
Have the modules which wrote the files be responsible for removing them as well.
Modified:
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/ConfWriter.c
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c
incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h
incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe.c
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/ConfWriter.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/ConfWriter.c?rev=1140924&r1=1140923&r2=1140924&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/ConfWriter.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/ConfWriter.c Wed Jun 29 00:54:59 2011
@@ -63,10 +63,6 @@ ConfWriter_get_charmony_fh(void) {
void
ConfWriter_clean_up(void) {
- /* Clean up some temp files. */
- remove("_charm.h");
- OS_remove_exe("_charm_stat");
-
/* Write the last bit of charmony.h and close. */
fprintf(charmony_fh, "#endif /* H_CHARMONY */\n\n");
if (fclose(charmony_fh)) {
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c?rev=1140924&r1=1140923&r2=1140924&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.c Wed Jun 29 00:54:59 2011
@@ -97,5 +97,8 @@ S_init(void) {
remove("_charm_stat.c");
}
-
+void
+Stat_clean_up(void) {
+ OS_remove_exe("_charm_stat");
+}
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h?rev=1140924&r1=1140923&r2=1140924&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Core/Stat.h Wed Jun 29 00:54:59 2011
@@ -50,9 +50,13 @@ struct chaz_Stat {
void
chaz_Stat_stat(const char *filepath, chaz_Stat *target);
+void
+chaz_Stat_clean_up(void);
+
#ifdef CHAZ_USE_SHORT_NAMES
#define Stat chaz_Stat
#define Stat_stat chaz_Stat_stat
+ #define Stat_clean_up chaz_Stat_clean_up
#endif
#ifdef __cplusplus
Modified: incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe.c
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe.c?rev=1140924&r1=1140923&r2=1140924&view=diff
==============================================================================
--- incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe.c (original)
+++ incubator/lucy/trunk/charmonizer/src/Charmonizer/Probe.c Wed Jun 29 00:54:59 2011
@@ -26,12 +26,16 @@
#include "Charmonizer/Core/Util.h"
#include "Charmonizer/Core/Compiler.h"
#include "Charmonizer/Core/OperatingSystem.h"
+#include "Charmonizer/Core/Stat.h"
/* Write the "_charm.h" file used by every probe.
*/
static void
S_write_charm_h(void);
+static void
+S_remove_charm_h(void);
+
void
Probe_init(const char *cc_command, const char *cc_flags,
const char *charmony_start) {
@@ -57,7 +61,9 @@ Probe_clean_up(void) {
if (Util_verbosity) { printf("Cleaning up...\n"); }
/* Dispatch various clean up routines. */
+ S_remove_charm_h();
ConfWriter_clean_up();
+ Stat_clean_up();
CC_clean_up();
OS_clean_up();
Dir_clean_up();
@@ -82,4 +88,8 @@ S_write_charm_h(void) {
Util_write_file("_charm.h", charm_h_code);
}
+static void
+S_remove_charm_h(void) {
+ remove("_charm.h");
+}