cvs commit: ALFS/nALFS/src/handlers remove.c search_replace.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Mon Mar 1 22:17:50 PST 2004


kpfleming    04/03/01 23:17:50

  Modified:    nALFS/src/handlers remove.c search_replace.c
  Log:
  convert to new parsing system
  
  Revision  Changes    Path
  1.24      +168 -74   ALFS/nALFS/src/handlers/remove.c
  
  Index: remove.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/remove.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- remove.c	29 Feb 2004 04:24:59 -0000	1.23
  +++ remove.c	2 Mar 2004 06:17:50 -0000	1.24
  @@ -42,9 +42,141 @@
   #include "parser.h"
   #include "backend.h"
   
  +enum {
  +	REMOVE_BASE,
  +	REMOVE_FILE,
  +};
  +
  +struct remove_data {
  +	char *base;
  +	int file_count;
  +	char **files;
  +	char *content;
  +};
  +
  +#if HANDLER_SYNTAX_3_2
  +
  +static const struct handler_parameter remove_parameters_v3_2[] = {
  +	{ .name = "file", .private = REMOVE_FILE },
  +	{ .name = NULL }
  +};
  +
  +static const struct handler_attribute remove_attributes_v3_2[] = {
  +	{ .name = "base", .private = REMOVE_BASE },
  +	{ .name = NULL }
  +};
  +
  +#endif
  +
  +static int remove_setup(element_s * const element)
  +{
  +	struct remove_data *data;
  +
  +	if ((data = xmalloc(sizeof(struct remove_data))) == NULL)
  +		return -1;
  +
  +	data->file_count = 0;
  +	data->files = NULL;
  +	data->base = NULL;
  +	data->content = NULL;
  +	element->handler_data = data;
  +
  +	return 0;
  +}
  +
  +static void remove_free(const element_s * const element)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +	int i;
  +
  +	xfree(data->base);
  +	xfree(data->content);
  +	if (data->file_count > 0) {
  +		for (i = 0; i < data->file_count; i++)
  +			xfree(data->files[i]);
  +		xfree(data->files);
  +	}
  +	xfree(data);
  +}
  +
  +static int remove_attribute(const element_s * const element,
  +			    const struct handler_attribute * const attr,
  +			    const char * const value)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +
  +	switch (attr->private) {
  +	case REMOVE_BASE:
  +		if (data->base) {
  +			Nprint_err("<%s>: cannot specify \"base\" more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->base = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
  +	}
  +}
  +
  +static int remove_parameter(const element_s * const element,
  +			    const struct handler_parameter * const param,
  +			    const char * const value)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +
  +	switch (param->private) {
  +	case REMOVE_FILE:
  +		data->file_count++;
  +		if ((data->files = xrealloc(data->files,
  +					    sizeof(data->files[0]) * (data->file_count))) == NULL) {
  +			Nprint_err("xrealloc() failed: %s", strerror(errno));
  +			return -1;
  +		}
  +		data->files[(data->file_count - 1)] = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
  +	}
  +}
  +
  +static int remove_content(const element_s * const element,
  +			  const char * const content)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +
  +	if (strlen(content))
  +		data->content = xstrdup(content);
  +
  +	return 0;
  +}
  +
  +static int remove_valid_data(const element_s * const element)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +
  +	if (!data->content) {
  +		Nprint_err("<%s>: content must be specified.", element->handler->name);
  +		return 0;
  +	}
  +
  +	return 1;
  +}
  +
  +static int remove_valid_data_v3_2(const element_s * const element)
  +{
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +
  +	if (!data->file_count) {
  +		Nprint_err("<%s>: <file> must be specified.", element->handler->name);
  +		return 0;
  +	}
  +
  +	return 1;
  +}
  +
   #if HANDLER_SYNTAX_2_0
   
  -static INLINE void warn_if_doesnt_exist(const char *file)
  +static INLINE void warn_if_doesnt_exist(const char * const file)
   {
           struct stat file_stat;
   
  @@ -55,68 +187,43 @@
   	}
   }
   
  -
  -static int remove_main_ver2(const element_s * const el)
  +static int remove_main_ver2(const element_s * const element)
   {
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
   	int status = 0;
   	char *tok;
  -	char *targets;
          
  -
  -	if (change_current_dir("/")) {
  +	if (change_current_dir("/"))
   		return -1;
  -	}
  -
  -	if ((targets = alloc_trimmed_str(el->content)) == NULL) {
  -		Nprint_h_err("No targets specified.");
  -		return -1;
  -	}
   
  -	for (tok = strtok(targets, WHITE_SPACE);
  -	     tok;
  -	     tok = strtok(NULL, WHITE_SPACE)) {
  +	for (tok = strtok(data->content, WHITE_SPACE); tok; tok = strtok(NULL, WHITE_SPACE)) {
   		Nprint_h("Removing %s.", tok);
  -
   		warn_if_doesnt_exist(tok);
  -
  -		if ((status = execute_command(el, "rm -fr %s", tok))) {
  +		if ((status = execute_command(element, "rm -fr %s", tok))) {
   			Nprint_h_err("Removing failed.");
   			break;
   		}
   	}
   
  -	xfree(targets);
  -	
   	return status;
   }
   
   #endif /* HANDLER_SYNTAX_2_0 */
   
  -
   #if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 
   
  -static int remove_main_ver3(const element_s * const el)
  +static int remove_main_ver3(const element_s * const element)
   {
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
   	int status = 0;
  -	char *name;
          
  -
  -	if (change_current_dir("/")) {
  -		return -1;
  -	}
  -
  -	if ((name = alloc_trimmed_str(el->content)) == NULL) {
  -		Nprint_h_err("No name specified.");
  +	if (change_current_dir("/"))
   		return -1;
  -	}
   
  -	Nprint_h("Removing %s.", name);
  +	Nprint_h("Removing %s.", data->content);
   
  -	if ((status = execute_command(el, "rm -fr %s", name))) {
  +	if ((status = execute_command(element, "rm -fr %s", data->content)))
   		Nprint_h_err("Removing failed.");
  -	}
  -
  -	xfree(name);
   	
   	return status;
   }
  @@ -125,55 +232,25 @@
   
   #if HANDLER_SYNTAX_3_2
   
  -static const struct handler_parameter remove_parameters_v3_2[] = {
  -	{ .name = "file" },
  -	{ .name = NULL }
  -};
  -
  -static const struct handler_attribute remove_attributes_v3_2[] = {
  -	{ .name = "base" },
  -	{ .name = NULL }
  -};
  -
  -static int remove_main_ver3_2(const element_s * const el)
  +static int remove_main_ver3_2(const element_s * const element)
   {
  -	int status   = 0;
  -	char *name   = NULL;
  -	element_s *p = NULL;
  -
  -	if ((first_param("file", el)) == NULL) {
  -		Nprint_h_err("No file(s) specified.");
  -		return -1;
  -	}
  +	struct remove_data *data = (struct remove_data *) element->handler_data;
  +	int status = 0;
  +	int i;
   
  -	if (change_to_base_dir(el, attr_value("base", el), 1))
  +	if (change_to_base_dir(element, data->base, 1))
   		return -1;
   
  -	for (p = first_param("file", el); p; p = next_param(p)) {
  +	for (i = 0; i < data->file_count; i++) {
  +        	Nprint_h("Removing %s.", data->files[i]);
   
  -    		if ((name = alloc_trimmed_str(p->content)) == NULL) {
  -            		Nprint_h_err("No file specified.");
  -            		status = -1;
  -            		break;
  -	    	}
  -        
  -        	Nprint_h("Removing %s.", name);
  -
  -        	if ((status = execute_command(el, "rm -fr %s", name))) {
  +        	if ((status = execute_command(element, "rm -fr %s", data->files[i]))) {
               		Nprint_h_err("Removing failed.");
               		status = -1;
               		break;
   	    	}
  -
  -		xfree(name);
       	}
   
  -     	// if we had to exit prematurely from an if test then free name
  -      
  -        if (status) {
  -		xfree(name);
  -	}
  -
   	return status;
   }
   
  @@ -192,6 +269,10 @@
   		.main = remove_main_ver2,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = remove_setup,
  +		.free = remove_free,
  +		.content = remove_content,
  +		.valid_data = remove_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_0
  @@ -202,6 +283,10 @@
   		.main = remove_main_ver3,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = remove_setup,
  +		.free = remove_free,
  +		.content = remove_content,
  +		.valid_data = remove_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_1
  @@ -212,6 +297,10 @@
   		.main = remove_main_ver3,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = remove_setup,
  +		.free = remove_free,
  +		.content = remove_content,
  +		.valid_data = remove_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_2
  @@ -225,6 +314,11 @@
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
   		.alternate_shell = 1,
  +		.setup = remove_setup,
  +		.free = remove_free,
  +		.valid_data = remove_valid_data_v3_2,
  +		.attribute = remove_attribute,
  +		.parameter = remove_parameter,
   	},
   #endif
   	{
  
  
  
  1.21      +193 -130  ALFS/nALFS/src/handlers/search_replace.c
  
  Index: search_replace.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/search_replace.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- search_replace.c	29 Feb 2004 04:24:59 -0000	1.20
  +++ search_replace.c	2 Mar 2004 06:17:50 -0000	1.21
  @@ -43,90 +43,194 @@
   #include "parser.h"
   #include "backend.h"
   
  -
  -#define El_search_replace_file(el) alloc_trimmed_param_value("file", el)
  -#define El_search_replace_find(el) alloc_trimmed_param_value("find", el)
  -#define El_search_replace_replace(el) alloc_trimmed_param_value("replace", el)
  -
   #define TMP_SEARCH_REPLACE_FILE	"/tmp/nALFS-XXXXXX"
   
  +enum {
  +	SEARCH_REPLACE_FIND,
  +	SEARCH_REPLACE_REPLACE,
  +	SEARCH_REPLACE_FILE,
  +	SEARCH_REPLACE_BASE,
  +};
   
  -static int search_replace_main(element_s *el, const char *base_dir)
  -{
  -	int i, c, fdw, offset, num_found = 0;
  -	char *buf = NULL;
  -	char *file;
  +struct search_replace_data {
   	char *find;
  -	char *replace = El_search_replace_replace(el);
  -	char tmp_file[] = TMP_SEARCH_REPLACE_FILE;
  -	FILE *fp, *fpw;
  -	struct stat file_stat;
  +	char *replace;
  +	char *file;
  +	char *base;
  +};
  +
  +#if HANDLER_SYNTAX_2_0
  +
  +static const struct handler_parameter search_replace_parameters_v2[] = {
  +	{ .name = "base", .private = SEARCH_REPLACE_BASE },
  +	{ .name = "find", .private = SEARCH_REPLACE_FIND },
  +	{ .name = "replace", .private = SEARCH_REPLACE_REPLACE },
  +	{ .name = "file", .private = SEARCH_REPLACE_FILE },
  +	{ .name = NULL }
  +};
  +
  +#endif /* HANDLER_SYNTAX_2_0 */
  +
  +#if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2
  +
  +static const struct handler_parameter search_replace_parameters_v3[] = {
  +	{ .name = "find", .private = SEARCH_REPLACE_FIND },
  +	{ .name = "replace", .private = SEARCH_REPLACE_REPLACE },
  +	{ .name = "file", .private = SEARCH_REPLACE_FILE },
  +	{ .name = NULL }
  +};
  +
  +static const struct handler_attribute search_replace_attributes[] = {
  +	{ .name = "base", .private = SEARCH_REPLACE_BASE },
  +	{ .name = NULL }
  +};
   
  +#endif /* HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2 */
   
  -	if ((find = El_search_replace_find(el)) == NULL) {
  -		Nprint_h_err("No find string specified.");
  +static int search_replace_setup(element_s * const element)
  +{
  +	struct search_replace_data *data;
  +
  +	if ((data = xmalloc(sizeof(struct search_replace_data))) == NULL)
   		return -1;
  +
  +	data->base = NULL;
  +	data->file = NULL;
  +	data->find = NULL;
  +	data->replace = NULL;
  +	element->handler_data = data;
  +
  +	return 0;
  +}
  +
  +static void search_replace_free(const element_s * const element)
  +{
  +	struct search_replace_data *data = (struct search_replace_data *) element->handler_data;
  +
  +	xfree(data->base);
  +	xfree(data->file);
  +	xfree(data->find);
  +	xfree(data->replace);
  +	xfree(data);
  +}
  +
  +static int search_replace_attribute(const element_s * const element,
  +				    const struct handler_attribute * const attr,
  +				    const char * const value)
  +{
  +	struct search_replace_data *data = (struct search_replace_data *) element->handler_data;
  +
  +	switch (attr->private) {
  +	case SEARCH_REPLACE_BASE:
  +		if (data->base) {
  +			Nprint_err("<%s>: cannot specify \"base\" more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->base = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
   	}
  +}
   
  -	if ((file = El_search_replace_file(el)) == NULL) {
  -		Nprint_h_err("No file specified.");
  -		xfree(find);
  -		return -1;
  +static int search_replace_parameter(const element_s * const element,
  +			    const struct handler_parameter * const param,
  +			    const char * const value)
  +{
  +	struct search_replace_data *data = (struct search_replace_data *) element->handler_data;
  +
  +	switch (param->private) {
  +	case SEARCH_REPLACE_BASE:
  +		if (data->base) {
  +			Nprint_err("<%s>: cannot specify <base> more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->base = xstrdup(value);
  +		return 0;
  +	case SEARCH_REPLACE_FILE:
  +		if (data->file) {
  +			Nprint_err("<%s>: cannot specify <file> more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->file = xstrdup(value);
  +		return 0;
  +	case SEARCH_REPLACE_FIND:
  +		if (data->find) {
  +			Nprint_err("<%s>: cannot specify <find> more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->find = xstrdup(value);
  +		return 0;
  +	case SEARCH_REPLACE_REPLACE:
  +		if (data->replace) {
  +			Nprint_err("<%s>: cannot specify <replace> more than once.", element->handler->name);
  +			return 1;
  +		}
  +		data->replace = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
  +	}
  +}
  +
  +static int search_replace_valid_data(const element_s * const element)
  +{
  +	struct search_replace_data *data = (struct search_replace_data *) element->handler_data;
  +
  +	if (!data->file) {
  +		Nprint_err("<%s>: <file> must be specified.", element->handler->name);
  +		return 0;
   	}
   
  -	if (change_current_dir(base_dir)) {
  -		xfree(find);
  -		xfree(file);
  -		return -1;
  +	if (!data->find) {
  +		Nprint_err("<%s>: <find> must be specified.", element->handler->name);
  +		return 0;
   	}
   
  -	Nprint_h("Searching %s (%s)",  file, base_dir);
  -	Nprint_h("    for \"%s\"", find);
  -	Nprint_h("    and replacing with \"%s\".",
  -		replace ? replace : "");
  +	return 1;
  +}
  +
  +static int search_replace_main(const element_s * const element)
  +{
  +	struct search_replace_data *data = (struct search_replace_data *) element->handler_data;
  +	int i, c, fdw, offset, num_found = 0;
  +	char *buf = NULL;
  +	char tmp_file[] = TMP_SEARCH_REPLACE_FILE;
  +	FILE *fp, *fpw;
  +	struct stat file_stat;
   
  -	if ((fp = fopen(file, "r")) == NULL) {
  -		Nprint_h_err("Opening %s failed: %s",
  -			file, strerror(errno));
  -		xfree(find);
  -		xfree(file);
  +	if (change_to_base_dir(element, data->base, 1))
   		return -1;
   
  +	Nprint_h("Searching %s (%s)", data->file);
  +	Nprint_h("    for \"%s\"", data->find);
  +	Nprint_h("    and replacing with \"%s\".", data->replace ? data->replace : "");
  +
  +	if ((fp = fopen(data->file, "r")) == NULL) {
  +		Nprint_h_err("Opening %s failed: %s", data->file, strerror(errno));
  +		return -1;
   	}
   
   	if (fstat(fileno(fp), &file_stat)) {
  -		Nprint_h_err("Error fstat()ing %s: %s",
  -			file, strerror(errno));
  -		xfree(find);
  -		xfree(file);
  +		Nprint_h_err("Error fstat()ing %s: %s", data->file, strerror(errno));
   		return -1;
   	}
   
   	if ((fdw = mkstemp(tmp_file)) == -1) {
  -		Nprint_h_err("Error opening temporary file: %s",
  -			strerror(errno));
  -		xfree(find);
  -		xfree(file);
  +		Nprint_h_err("Error opening temporary file: %s", strerror(errno));
   		return -1;
   	}
   	
  -
   	if ((fpw = fdopen(fdw, "w")) == NULL) {
  -		Nprint_h_err("Opening %s failed: %s",
  -			tmp_file, strerror(errno));
  -		xfree(find);
  -		xfree(file);
  +		Nprint_h_err("Opening %s failed: %s", tmp_file, strerror(errno));
   		return -1;
   	}
   
  -	offset = (int)strlen(find) - 1;
  -
  -	buf = xmalloc(strlen(find) + 1);
  -
  -	for (i = 0; i < (int)(strlen(find)) + 1; i++) {
  +	offset = (int)strlen(data->find) - 1;
  +	buf = xmalloc(strlen(data->find) + 1);
  +	for (i = 0; i < (int)(strlen(data->find)) + 1; i++) {
   		buf[i] = '\0';
   	}
  -
   	while ((c = getc(fp)) != EOF) {
   		/* Shift to left, adding c at the end. */
   		i = offset;
  @@ -136,12 +240,12 @@
   		}
   		buf[i] = c;
   
  -		if (strcmp(buf + offset, find) == 0) {
  +		if (strcmp(buf + offset, data->find) == 0) {
   			num_found++;
  -			fseek(fpw, (long)-strlen(find) + 1, SEEK_CUR);
  +			fseek(fpw, (long)-strlen(data->find) + 1, SEEK_CUR);
   
  -			if (replace) {
  -				fprintf(fpw, "%s", replace);
  +			if (data->replace) {
  +				fprintf(fpw, "%s", data->replace);
   			}
   
   		} else {
  @@ -157,83 +261,22 @@
   	fclose(fpw);
   	fclose(fp);
   
  -	Nprint_h("Made %d change%s.", num_found,
  -		num_found != 1 ? "s" : ""); /* :-) */
  +	Nprint_h("Made %d change%s.", num_found, num_found != 1 ? "s" : ""); /* :-) */
   
  -	if (execute_command(el, "mv -f %s %s", tmp_file, file)) {
  -		Nprint_h_err("System command for moving %s to %s failed.",
  -			tmp_file, file);
  -		xfree(find);
  -		xfree(file);
  +	if (execute_command(element, "mv -f %s %s", tmp_file, data->file)) {
  +		Nprint_h_err("System command for moving %s to %s failed.", tmp_file, data->file);
   		return -1;
   	}
   
   	/* Changing the file mode. */
  -	if (chmod(file, file_stat.st_mode)) {
  -		Nprint_h_err("chmod(%s) failed: %s",
  -			file, strerror(errno));
  -		xfree(find);
  -		xfree(file);
  +	if (chmod(data->file, file_stat.st_mode)) {
  +		Nprint_h_err("chmod(%s) failed: %s", data->file, strerror(errno));
   		return -1;
   	}
   
  -	xfree(find);
  -	xfree(file);
  -
   	return 0;
   }
   
  -
  -#if HANDLER_SYNTAX_2_0
  -
  -static const struct handler_parameter search_replace_parameters_ver2[] = {
  -	{ .name = "base" },
  -	{ .name = "find" },
  -	{ .name = "replace" },
  -	{ .name = "file" },
  -	{ .name = NULL }
  -};
  -
  -static int search_replace_main_ver2(const element_s * const el)
  -{
  -	int i;
  -	char *base = alloc_base_dir(el);
  -
  -	i = search_replace_main(el, base);
  -
  -	xfree(base);
  -
  -	return i;
  -}
  -
  -#endif /* HANDLER_SYNTAX_2_0 */
  -
  -
  -#if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2
  -
  -static const struct handler_parameter search_replace_parameters_ver3[] = {
  -	{ .name = "find" },
  -	{ .name = "replace" },
  -	{ .name = "file" },
  -	{ .name = NULL }
  -};
  -
  -static const struct handler_attribute search_replace_attributes[] = {
  -	{ .name = "base" },
  -	{ .name = NULL }
  -};
  -
  -static int search_replace_main_ver3(const element_s * const el)
  -{
  -	if (change_to_base_dir(el, attr_value("base", el), 1))
  -		return -1;
  -
  -	return search_replace_main(el, ".");
  -}
  -
  -#endif /* HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1 || HANDLER_SYNTAX_3_2 */
  -
  -
   /*
    * Handlers' information.
    */
  @@ -244,10 +287,15 @@
   		.name = "search_replace",
   		.description = "Search and replace",
   		.syntax_version = "2.0",
  -		.parameters = search_replace_parameters_ver2,
  -		.main = search_replace_main_ver2,
  +		.parameters = search_replace_parameters_v2,
  +		.main = search_replace_main,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = search_replace_setup,
  +		.free = search_replace_free,
  +		.attribute = search_replace_attribute,
  +		.parameter = search_replace_parameter,
  +		.valid_data = search_replace_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_0
  @@ -255,11 +303,16 @@
   		.name = "search_replace",
   		.description = "Search and replace",
   		.syntax_version = "3.0",
  -		.parameters = search_replace_parameters_ver3,
  +		.parameters = search_replace_parameters_v3,
   		.attributes = search_replace_attributes,
  -		.main = search_replace_main_ver3,
  +		.main = search_replace_main,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = search_replace_setup,
  +		.free = search_replace_free,
  +		.attribute = search_replace_attribute,
  +		.parameter = search_replace_parameter,
  +		.valid_data = search_replace_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_1
  @@ -267,11 +320,16 @@
   		.name = "search_replace",
   		.description = "Search and replace",
   		.syntax_version = "3.1",
  -		.parameters = search_replace_parameters_ver3,
  +		.parameters = search_replace_parameters_v3,
   		.attributes = search_replace_attributes,
  -		.main = search_replace_main_ver3,
  +		.main = search_replace_main,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = search_replace_setup,
  +		.free = search_replace_free,
  +		.attribute = search_replace_attribute,
  +		.parameter = search_replace_parameter,
  +		.valid_data = search_replace_valid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_2
  @@ -279,12 +337,17 @@
   		.name = "search_replace",
   		.description = "Search and replace",
   		.syntax_version = "3.2",
  -		.parameters = search_replace_parameters_ver3,
  +		.parameters = search_replace_parameters_v3,
   		.attributes = search_replace_attributes,
  -		.main = search_replace_main_ver3,
  +		.main = search_replace_main,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
   		.alternate_shell = 1,
  +		.setup = search_replace_setup,
  +		.free = search_replace_free,
  +		.attribute = search_replace_attribute,
  +		.parameter = search_replace_parameter,
  +		.valid_data = search_replace_valid_data,
   	},
   #endif
   	{
  
  
  



More information about the alfs-log mailing list