#include <excludes.h>\r
+#include <fstream.h>\r
\r
XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(tesh);\r
\r
{\r
excludes_t excludes = xbt_new0(s_excludes_t, 1);\r
\r
- excludes->items = xbt_dynar_new(sizeof(fstream_t), NULL);\r
+ excludes->items = xbt_dynar_new(sizeof(fstream_t), (void_f_pvoid_t)fstream_free);\r
\r
return excludes;\r
}\r
\r
if(!excludes || !fstreams)\r
return EINVAL;\r
-\r
- xbt_dynar_foreach(excludes->items, i, exclude)\r
- {\r
- xbt_dynar_foreach(fstreams->items, i, fstream)\r
+ \r
+ \r
+ xbt_dynar_foreach(excludes->items, i, exclude)\r
{\r
- exists = 0;\r
- \r
- if(!strcmp(fstream->name, exclude->name) && !strcmp(fstream->directory, exclude->directory))\r
+ exists = 1;\r
+\r
+ xbt_dynar_foreach(fstreams->items, i, fstream)\r
{\r
- exists = 1;\r
- break;\r
+ exists = 0;\r
+ \r
+ if(!strcmp(fstream->name, exclude->name) && !strcmp(fstream->directory, exclude->directory))\r
+ {\r
+ exists = 1;\r
+ break;\r
+ }\r
}\r
- }\r
\r
- if(!exists)\r
- {\r
- success = 0;\r
- WARN1("cannot exclude the file %s",exclude->name); \r
- }\r
+ if(!exists)\r
+ {\r
+ success = 0;\r
+ WARN1("cannot exclude the file %s",exclude->name); \r
+ }\r
}\r
\r
return success;\r
{\r
if(!(*excludesptr))\r
return EINVAL;\r
-\r
- xbt_dynar_free((&(*((excludes_t*)excludesptr))->items));\r
+ \r
+ if((*((excludes_t*)excludesptr))->items)\r
+ xbt_dynar_free((&(*((excludes_t*)excludesptr))->items));\r
\r
free(*excludesptr);\r
*excludesptr = NULL; \r