cvs commit: ALFS/nALFS/src/handlers digest.c unpack.c

kpfleming at linuxfromscratch.org kpfleming at linuxfromscratch.org
Tue Feb 24 20:33:19 PST 2004


kpfleming    04/02/24 21:33:19

  Modified:    nALFS/src handlers.h
               nALFS/src/handlers unpack.c
  Added:       nALFS/src/handlers digest.c
  Log:
  add handler for <digest>
  convert handler for <unpack> to new parsing system
  
  Revision  Changes    Path
  1.22      +1 -0      ALFS/nALFS/src/handlers.h
  
  Index: handlers.h
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- handlers.h	25 Feb 2004 03:55:33 -0000	1.21
  +++ handlers.h	25 Feb 2004 04:33:19 -0000	1.22
  @@ -41,6 +41,7 @@
   	HTYPE_EXECUTE = (1 << 7),
   	HTYPE_STAGE = (1 << 8),      /* handler is a stage container */
   	HTYPE_STAGEINFO = (1 << 9),  /* handler provides stage information */
  +	HTYPE_DIGEST = (1 << 10),    /* handler provides file digest information */
   } handler_type_e;
   
   typedef enum handler_data_e {
  
  
  
  1.26      +270 -145  ALFS/nALFS/src/handlers/unpack.c
  
  Index: unpack.c
  ===================================================================
  RCS file: /home/cvsroot/ALFS/nALFS/src/handlers/unpack.c,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- unpack.c	24 Feb 2004 06:30:11 -0000	1.25
  +++ unpack.c	25 Feb 2004 04:33:19 -0000	1.26
  @@ -41,16 +41,6 @@
   #include "parser.h"
   #include "backend.h"
   
  -
  -#define El_unpack_archive(el) alloc_trimmed_param_value("archive", el)
  -#define El_unpack_destination(el) alloc_trimmed_param_value("destination", el)
  -
  -
  -typedef enum extension_e {
  -	GZ, TAR_GZ, TGZ, BZ2, TAR_BZ2, TAR, ZIP, TAR_Z, Z, UNKNOWN
  -} extension_e;
  -
  -
   static INLINE char *alloc_basename(const char *archive)
   {
   	char *base_name;
  @@ -110,56 +100,181 @@
   	return status;
   }
   
  +enum unpack_parameter_types {
  +	UNPACK_ARCHIVE,
  +	UNPACK_DESTINATION,
  +	UNPACK_REFERENCE,
  +	UNPACK_DIGEST,
  +};
   
  -#if HANDLER_SYNTAX_2_0
  +enum unpack_attribute_types {
  +	UNPACK_BASE,
  +};
   
  -static const struct handler_parameter unpack_parameters_ver2[] = {
  -	{ .name = "archive" },
  -	{ .name = "destination" },
  -	{ .name = NULL }
  +struct unpack_data {
  +	char *archive;
  +	char *destination;
  +	int reference_count;
  +	char **references;
  +	char *base;
  +	const element_s *digest;
   };
   
  -static int unpack_main_ver2(const element_s * const el)
  +static int unpack_setup(element_s * const element)
   {
  -	int status = 0;
  -	char *archive, *destination;
  -	struct stat file_stat;
  +	struct unpack_data *data;
   
  -
  -	if ((archive = El_unpack_archive(el)) == NULL) {
  -		Nprint_h_err("Archive name missing.");
  +	if ((data = xmalloc(sizeof(struct unpack_data))) == NULL)
   		return -1;
  +
  +	data->archive = NULL;
  +	data->destination = NULL;
  +	data->reference_count = 0;
  +	data->references = NULL;
  +	data->digest = NULL;
  +	data->base = NULL;
  +	element->handler_data = data;
  +
  +	return 0;
  +}
  +
  +static void unpack_free(const element_s * const element)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +	int i;
  +
  +	xfree(data->base);
  +	xfree(data->archive);
  +	xfree(data->destination);
  +	if (data->reference_count > 0) {
  +		for (i = 0; i < data->reference_count; i++)
  +			xfree(data->references[i]);
  +		xfree(data->references);
   	}
  +	xfree(data);
  +}
   
  -	if ((destination = El_unpack_destination(el)) == NULL) {
  -		Nprint_h_err("Destination missing.");
  -		xfree(archive);
  -		return -1;
  +static int unpack_attribute(const element_s * const element,
  +			    const struct handler_attribute * const attr,
  +			    const char * const value)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +
  +	switch (attr->private) {
  +	case UNPACK_BASE:
  +		if (data->base) {
  +			Nprint_err("<unpack>: cannot specify \"base\" more than once.");
  +			return 1;
  +		}
  +		data->base = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
   	}
  -	
  -	if (change_current_dir(destination)) {
  -		xfree(archive);
  -		xfree(destination);
  -		return -1;
  +}
  +
  +static int unpack_parameter(const element_s * const element,
  +			    const struct handler_parameter * const param,
  +			    const char * const value)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +
  +	switch (param->private) {
  +	case UNPACK_ARCHIVE:
  +		if (data->archive) {
  +			Nprint_err("<unpack>: cannot specify <archive> more than once.");
  +			return 1;
  +		}
  +		data->archive = xstrdup(value);
  +		return 0;
  +	case UNPACK_REFERENCE:
  +		data->reference_count++;
  +		if ((data->references = xrealloc(data->references,
  +						 sizeof(data->references[0]) * (data->reference_count))) == NULL) {
  +			Nprint_err("xrealloc() failed: %s", strerror(errno));
  +			return -1;
  +		}
  +		data->references[(data->reference_count - 1)] = xstrdup(value);
  +		return 0;
  +	case UNPACK_DESTINATION:
  +		if (data->destination) {
  +			Nprint_err("<unpack>: cannot specify <destination> more than once.");
  +			return 1;
  +		}
  +		data->destination = xstrdup(value);
  +		return 0;
  +	default:
  +		return 1;
  +	}
  +}
  +
  +static int unpack_invalid_data(const element_s * const element)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +
  +	if (!data->archive) {
  +		Nprint_err("<unpack>: \"archive\" must be specified.");
  +		return 1;
  +	}
  +
  +	if (!data->destination) {
  +		Nprint_err("<unpack>: \"destination\" must be specified.");
  +		return 1;
  +	}
  +
  +	return 0;
  +}
  +
  +static int unpack_invalid_child(const element_s * const element,
  +				const element_s * const child)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +
  +	if (child->handler->type & HTYPE_DIGEST) {
  +		if (data->digest) {
  +			Nprint_err("<unpack>: only one <digest> allowed.");
  +			return 1;
  +		}
  +
  +		data->digest = child;
  +		return 0;
   	}
  -	xfree(destination);
  +
  +	return 1;
  +}
  +
  +#if HANDLER_SYNTAX_2_0
  +
  +static const struct handler_parameter unpack_parameters_v2[] = {
  +	{ .name = "archive", .private = UNPACK_ARCHIVE },
  +	{ .name = "destination", .private = UNPACK_DESTINATION },
  +	{ .name = NULL }
  +};
  +
  +static int unpack_main_ver2(const element_s * const element)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +	int status;
  +	struct stat file_stat;
  +
  +	if (change_current_dir(data->destination))
  +		return -1;
   
   	/* Check if archive exists. */
  -	if (stat(archive, &file_stat)) {
  -		Nprint_h_err("Checking for %s failed:", archive);
  +	if (stat(data->archive, &file_stat)) {
  +		Nprint_h_err("Checking for %s failed:", data->archive);
   		Nprint_h_err("    %s", strerror(errno));
  -		xfree(archive);
   		return -1;
   	}
   
  -	if (unpack_archive(el, archive)) {
  -		Nprint_h_err("Unpacking %s failed.", archive);
  +	status = unpack_archive(element, data->archive);
  +
  +	if (status) {
  +		Nprint_h_err("Unpacking %s failed.", data->archive);
   	} else {
  -		Nprint_h("Done unpacking %s.", archive);
  +		Nprint_h("Done unpacking %s.", data->archive);
   	}
   
  -	xfree(archive);
  -	
   	return status;
   }
   
  @@ -168,7 +283,7 @@
   
   #if HANDLER_SYNTAX_3_0 || HANDLER_SYNTAX_3_1
   
  -static const struct handler_parameter unpack_parameters_ver3[] = {
  +static const struct handler_parameter unpack_parameters_v3[] = {
   	{ .name = "archive" },
   	{ .name = "destination" },
   	{ .name = "digest" },
  @@ -176,83 +291,63 @@
   	{ .name = NULL }
   };
   
  -static int unpack_main_ver3(const element_s * const el)
  +static int unpack_main_ver3(const element_s * const element)
   {
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
   	int status = -1;
  -	char *archive = NULL;
  -	char *destination = NULL;
  -	char *digest = NULL;
  -	char *digest_type = NULL;
   	struct stat file_stat;
  +	char *digest, *digest_type;
   
  +	if (change_current_dir(data->destination))
  +		return -1;
   
  -	if ((archive = El_unpack_archive(el)) == NULL) {
  -		Nprint_h_err("Archive name is missing.");
  -		goto free_all_and_return;
  -	}
  -
  -	if ((destination = El_unpack_destination(el)) == NULL) {
  -		Nprint_h_err("Destination is missing.");
  -		goto free_all_and_return;
  +	if (data->digest) {
  +		digest = data->digest->handler->alloc_data(data->digest, HDATA_COMMAND);
  +		digest_type = data->digest->handler->alloc_data(data->digest, HDATA_VERSION);
   	}
  -	
  -	if (change_current_dir(destination))
  -		goto free_all_and_return;
  -
  -	alloc_element_digest(el, &digest, &digest_type);
   
   	/* Check if archive exists. */
  -	if ((stat(archive, &file_stat))) {
  -	        if (errno == ENOENT && first_param("reference", el) != NULL) {
  -		        int found = 0;
  -			element_s *p;
  +	if ((stat(data->archive, &file_stat))) {
  +	        if ((errno == ENOENT) && (data->reference_count > 0)) {
  +			int i;
   
  -			Nprint_h_warn("Archive %s not found.", archive);
  +			Nprint_h_warn("Archive %s not found.", data->archive);
   			Nprint_h("Trying to fetch it from <reference>...");
   
  -	                for (p = first_param("reference", el); p; p = next_param(p)) {
  -				char *s;
  -
  -				if ((s = alloc_trimmed_str(p->content)) == NULL) {
  -					Nprint_h_warn("Source empty.");
  -					continue;
  -				}
  -				
  -				if (! get_url(s, archive, digest, digest_type))
  -					found = 1;
  -				xfree(s);
  -				if (found)
  +			for (i = 0; i < data->reference_count; i++) {
  +				if (!get_url(data->references[i],
  +					     data->archive,
  +					     digest,
  +					     digest_type))
   					break;
   			}
  -			
  -			if (! found) {
  -				Nprint_h_err("Unable to download file %s.", archive);
  -				goto free_all_and_return;
  +
  +			if (i < data->reference_count) {
  +				status = 0;
  +			} else {
  +				Nprint_h_err("Unable to download file %s.", data->archive);
   			}
   		} else {
  -			Nprint_h_err("Checking for %s failed:", archive);
  +			Nprint_h_err("Checking for %s failed:", data->archive);
   			Nprint_h_err("    %s", strerror(errno));
  -			goto free_all_and_return;
   		}
  -	} else if (digest && verify_digest(digest_type, digest, archive)) {
  -		Nprint_h_err("Wrong %s digest of archive: %s",
  -			     digest_type, archive);
  -		goto free_all_and_return;
  -	}
  -
  -	if (unpack_archive(el, archive)) {
  -		Nprint_h_err("Unpacking %s failed.", archive);
  +	} else if (data->digest && verify_digest(digest_type, digest, data->archive)) {
  +		Nprint_h_err("Wrong %s digest of archive: %s", digest_type, data->archive);
   	} else {
  -		Nprint_h("Done unpacking %s.", archive);
   		status = 0;
   	}
   
  - free_all_and_return:
  +	if (status == 0) {
  +		status = unpack_archive(element, data->archive);
  +		if (status) {
  +			Nprint_h_err("Unpacking %s failed.", data->archive);
  +		} else {
  +			Nprint_h("Done unpacking %s.", data->archive);
  +		}
  +	}
  +
   	xfree(digest_type);
   	xfree(digest);
  -	xfree(archive);
  -	xfree(destination);
  -	
   	return status;
   }
   
  @@ -272,76 +367,86 @@
   	{ .name = NULL }
   };
   
  -static int unpack_main_ver3_2(const element_s * const el)
  +static int unpack_invalid_data_v3_2(const element_s * const element)
   {
  -	int status = -1;
  -	char *archive = NULL;
  -	char *digest = NULL;
  -	char *digest_type = NULL;
  -	struct stat file_stat;
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
   
  +	if (!data->archive) {
  +		Nprint_err("<unpack>: \"archive\" must be specified.");
  +		return 1;
  +	}
  +
  +	if (!data->base) {
  +		const char *base = alloc_base_dir_new(element);
   
  -	if ((archive = El_unpack_archive(el)) == NULL) {
  -		Nprint_h_err("Archive name is missing.");
  -		goto free_all_and_return;
  +		if (!base) {
  +			Nprint_err("<unpack>: \"base\" must be specified at or above this element.");
  +			return 1;
  +		} else {
  +			xfree(base);
  +		}
   	}
   
  -	if (change_to_base_dir(el, attr_value("base", el), 0))
  -		goto free_all_and_return;
  +	return 0;
  +}
   
  -	alloc_element_digest(el, &digest, &digest_type);
  +static int unpack_main_ver3_2(const element_s * const element)
  +{
  +	struct unpack_data *data = (struct unpack_data *) element->handler_data;
  +	int status = -1;
  +	struct stat file_stat;
  +	char *digest, *digest_type;
  +
  +	if (change_to_base_dir(element, data->base, 0))
  +		return -1;
  +
  +	if (data->digest) {
  +		digest = data->digest->handler->alloc_data(data->digest, HDATA_COMMAND);
  +		digest_type = data->digest->handler->alloc_data(data->digest, HDATA_VERSION);
  +	}
   
   	/* Check if archive exists. */
  -	if ((stat(archive, &file_stat))) {
  -	        if (errno == ENOENT && first_param("reference", el) != NULL) {
  -		        int found = 0;
  -			element_s *p;
  +	if ((stat(data->archive, &file_stat))) {
  +	        if ((errno == ENOENT) && (data->reference_count > 0)) {
  +			int i;
   
  -			Nprint_h_warn("Archive %s not found.", archive);
  +			Nprint_h_warn("Archive %s not found.", data->archive);
   			Nprint_h("Trying to fetch it from <reference>...");
   
  -	                for (p = first_param("reference", el); p; p = next_param(p)) {
  -				char *s;
  -
  -				if ((s = alloc_trimmed_str(p->content)) == NULL) {
  -					Nprint_h_warn("Source empty.");
  -					continue;
  -				}
  -				
  -				if (! get_url(s, archive, digest, digest_type))
  -					found = 1;
  -				xfree(s);
  -				if (found)
  +			for (i = 0; i < data->reference_count; i++) {
  +				if (!get_url(data->references[i],
  +					     data->archive,
  +					     digest,
  +					     digest_type))
   					break;
   			}
  -			
  -			if (! found) {
  -				Nprint_h_err("Unable to download file %s.", archive);
  -				goto free_all_and_return;
  +
  +			if (i < data->reference_count) {
  +				status = 0;
  +			} else {
  +				Nprint_h_err("Unable to download file %s.", data->archive);
   			}
   		} else {
  -			Nprint_h_err("Checking for %s failed:", archive);
  +			Nprint_h_err("Checking for %s failed:", data->archive);
   			Nprint_h_err("    %s", strerror(errno));
  -			goto free_all_and_return;
   		}
  -	} else if (digest && verify_digest(digest_type, digest, archive)) {
  -		Nprint_h_err("Wrong %s digest of archive: %s",
  -			     digest_type, archive);
  -		goto free_all_and_return;
  -	}
  -
  -	if (unpack_archive(el, archive)) {
  -		Nprint_h_err("Unpacking %s failed.", archive);
  +	} else if (data->digest && verify_digest(digest_type, digest, data->archive)) {
  +		Nprint_h_err("Wrong %s digest of archive: %s", digest_type, data->archive);
   	} else {
  -		Nprint_h("Done unpacking %s.", archive);
   		status = 0;
   	}
   
  - free_all_and_return:
  +	if (status == 0) {
  +		status = unpack_archive(element, data->archive);
  +		if (status) {
  +			Nprint_h_err("Unpacking %s failed.", data->archive);
  +		} else {
  +			Nprint_h("Done unpacking %s.", data->archive);
  +		}
  +	}
  +
   	xfree(digest_type);
   	xfree(digest);
  -	xfree(archive);
  -	
   	return status;
   }
   
  @@ -358,10 +463,14 @@
   		.name = "unpack",
   		.description = "Unpack",
   		.syntax_version = "2.0",
  -		.parameters = unpack_parameters_ver2,
  +		.parameters = unpack_parameters_v2,
   		.main = unpack_main_ver2,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = unpack_setup,
  +		.free = unpack_free,
  +		.parameter = unpack_parameter,
  +		.invalid_data = unpack_invalid_data,
   	},
   #endif
   #if HANDLER_SYNTAX_3_0
  @@ -369,10 +478,15 @@
   		.name = "unpack",
   		.description = "Unpack",
   		.syntax_version = "3.0",
  -		.parameters = unpack_parameters_ver3,
  +		.parameters = unpack_parameters_v3,
   		.main = unpack_main_ver3,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = unpack_setup,
  +		.free = unpack_free,
  +		.parameter = unpack_parameter,
  +		.invalid_data = unpack_invalid_data,
  +		.invalid_child = unpack_invalid_child,
   	},
   #endif
   #if HANDLER_SYNTAX_3_1
  @@ -380,10 +494,15 @@
   		.name = "unpack",
   		.description = "Unpack",
   		.syntax_version = "3.1",
  -		.parameters = unpack_parameters_ver3,
  +		.parameters = unpack_parameters_v3,
   		.main = unpack_main_ver3,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = unpack_setup,
  +		.free = unpack_free,
  +		.parameter = unpack_parameter,
  +		.invalid_data = unpack_invalid_data,
  +		.invalid_child = unpack_invalid_child,
   	},
   #endif
   #if HANDLER_SYNTAX_3_2
  @@ -396,7 +515,13 @@
   		.main = unpack_main_ver3_2,
   		.type = HTYPE_NORMAL,
   		.is_action = 1,
  +		.setup = unpack_setup,
  +		.free = unpack_free,
  +		.parameter = unpack_parameter,
  +		.attribute = unpack_attribute,
   		.alternate_shell = 1,
  +		.invalid_data = unpack_invalid_data_v3_2,
  +		.invalid_child = unpack_invalid_child,
   	},
   #endif
   	{
  
  
  
  1.1                  ALFS/nALFS/src/handlers/digest.c
  
  Index: digest.c
  ===================================================================
  /*
   *  digest.c - Handler.
   *
   *  Copyright (C) 2004
   *
   *  Neven Has <haski at sezampro.yu>
   *  Kevin P. Fleming <kpfleming at linuxfromscratch.org>
   *
   *  This program is free software; you can redistribute it and/or modify
   *  it under the terms of the GNU General Public License as published by
   *  the Free Software Foundation; either version 2 of the License, or
   *  (at your option) any later version.
   *
   *  This program is distributed in the hope that it will be useful,
   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   *  GNU General Public License for more details.
   *
   *  You should have received a copy of the GNU General Public License
   *  along with this program; if not, write to the Free Software
   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   */
  
  
  #include <stdlib.h>
  
  #ifdef HAVE_CONFIG_H
  #include <config.h>
  #endif
  
  #define MODULE_NAME digest
  #include <nALFS.h>
  
  #include "handlers.h"
  #include "backend.h"
  #include "nprint.h"
  #include "utility.h"
  
  
  enum digest_attribute_types {
  	DIGEST_TYPE
  };
  
  static const struct handler_attribute digest_attributes[] = {
  	{ .name = "type", .private = DIGEST_TYPE },
          { .name = NULL }
  };
  
  struct digest_data {
  	char *type;
  	char *content;
  };
  
  static int digest_setup(element_s * const element)
  {
  	struct digest_data *data;
  
  	if ((data = xmalloc(sizeof(struct digest_data))) == NULL)
  		return 1;
  
  	data->type = NULL;
  	data->content = NULL;
  	element->handler_data = data;
  
  	return 0;
  };
  
  static void digest_free(const element_s * const element)
  {
  	struct digest_data *data = (struct digest_data *) element->handler_data;
  
  	xfree(data->content);
  	xfree(data->version);
  	xfree(data);
  }
  
  static int digest_attribute(const element_s * const element,
  			    const struct handler_attribute * const attr,
  			    const char * const value)
  {
  	struct digest_data *data = (struct digest_data *) element->handler_data;
  
  	switch (attr->private) {
  	case DIGEST_TYPE:
  		if (data->type) {
  			Nprint_err("<digest>: cannot specify \"type\" more than once.");
  			return 1;
  		}
  		data->type = xstrdup(value);
  		return 0;
  	default:
  		return 1;
  	}
  }
  
  static int digest_content(const element_s * const element,
  			  const char * const content)
  {
  	struct digest_data *data = (struct digest_data *) element->handler_data;
  
  	if (strlen(content))
  		data->content = xstrdup(content);
  
  	return 0;
  }
  
  static int digest_invalid_data(const element_s * const element)
  {
  	struct digest_data *data = (struct digest_data *) element->handler_data;
  
  	if (!data->content) {
  		Nprint_err("<digest>: content cannot be empty.");
  		return 1;
  	}
  
  	return 0;
  }
  
  static char *digest_data(const element_s * const element,
  			 const handler_data_e data_requested)
  {
  	struct digest_data *data = (struct digest_data *) element->handler_data;
  	char *result;
  
  	switch (data_requested) {
  	case HDATA_COMMAND:
  		/* We're cheating here, and returning the digest as an HDATA_COMMNAND */
  		result = xstrdup(data->content);
  		break;
  	case HDATA_VERSION:
  		/* We're cheating here, and returning the digest type as an HDATA_VERSION */
  		if (data->type) {
  			result = xstrdup(data->type);
  		} else {
  			result = xstrdup("md5");
  		}
  		break;
  	default:
  		break;
  	}
  
  	return NULL;
  }
  
  static int digest_main(const element_s * const el)
  {
  	/* should never be called */
  	return 1;
  }
  
  
  /*
   * Handlers' information.
   */
  
  handler_info_s HANDLER_SYMBOL(info)[] = {
  #if HANDLER_SYNTAX_3_0
  	{
  		.name = "digest",
  		.description = "digest",
  		.syntax_version = "3.0",
  		.main = digest_main,
  		.type = HTYPE_DIGEST,
  		.setup = digest_setup,
  		.free = digest_free,
  		.attributes = digest_attributes,
  		.attribute = digest_attribute,
  		.content = digest_content,
  		.data = HDATA_COMMAND | HDATA_VERSION,
  		.alloc_data = digest_data,
  		.invalid_data = digest_invalid_data,
  	},
  #endif
  #if HANDLER_SYNTAX_3_1
  	{
  		.name = "digest",
  		.description = "digest",
  		.syntax_version = "3.1",
  		.main = digest_main,
  		.type = HTYPE_DIGEST,
  		.setup = digest_setup,
  		.free = digest_free,
  		.attributes = digest_attributes,
  		.attribute = digest_attribute,
  		.content = digest_content,
  		.data = HDATA_COMMAND | HDATA_VERSION,
  		.alloc_data = digest_data,
  		.invalid_data = digest_invalid_data,
  	},
  #endif
  #if HANDLER_SYNTAX_3_2
  	{
  		.name = "digest",
  		.description = "digest",
  		.syntax_version = "3.2",
  		.main = digest_main,
  		.type = HTYPE_DIGEST,
  		.setup = digest_setup,
  		.free = digest_free,
  		.attributes = digest_attributes,
  		.attribute = digest_attribute,
  		.content = digest_content,
  		.data = HDATA_COMMAND | HDATA_VERSION,
  		.alloc_data = digest_data,
  		.invalid_data = digest_invalid_data,
  	},
  #endif
  	{
  		.name = NULL
  	}
  };
  
  
  



More information about the alfs-log mailing list