text: /* -------------------------------------------------------------------- */
  /*  ACCORDS PLATFORM                                                    */
  /*  (C) 2011 by Iain James Marshall (Prologue) <ijm667@hotmail.com>     */
  /* -------------------------------------------------------------------- */
  /* Licensed under the Apache License, Version 2.0 (the "License"); 	*/
  /* you may not use this file except in compliance with the License. 	*/
  /* You may obtain a copy of the License at 				*/
  /*  									*/
  /*  http://www.apache.org/licenses/LICENSE-2.0 				*/
  /*  									*/
  /* Unless required by applicable law or agreed to in writing, software 	*/
  /* distributed under the License is distributed on an "AS IS" BASIS, 	*/
  /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 	*/
  /* implied. 								*/
  /* See the License for the specific language governing permissions and 	*/
  /* limitations under the License. 					*/
  /* -------------------------------------------------------------------- */
  
  /* STRUKT WARNING : this file has been generated and should not be modified by hand */
  #ifndef _occiparameter_c_
  #define _occiparameter_c_
  
  #include "parameter.h"
  
  /*	----------------------------------------	*/
  /*	o c c i _ c o r d s _ p a r a m e t e r 	*/
  /*	----------------------------------------	*/
  
  /*	--------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   m a n a g e m e n t   s t r u c t u r e 	*/
  /*	--------------------------------------------------------------------	*/
  struct cords_parameter * allocate_cords_parameter();
  struct cords_parameter * liberate_cords_parameter(struct cords_parameter * optr);
  private pthread_mutex_t list_cords_parameter_control=PTHREAD_MUTEX_INITIALIZER;
  private struct occi_kind_node * cords_parameter_first = (struct occi_kind_node *) 0;
  private struct occi_kind_node * cords_parameter_last  = (struct occi_kind_node *) 0;
  public struct  occi_kind_node * occi_first_cords_parameter_node() { return( cords_parameter_first ); }
  public struct  occi_kind_node * occi_last_cords_parameter_node() { return( cords_parameter_last ); }
  
  /*	----------------------------------------------	*/
  /*	o c c i   c a t e g o r y   d r o p   n o d e 	*/
  /*	----------------------------------------------	*/
  private struct occi_kind_node * ll_drop_cords_parameter_node(struct occi_kind_node * nptr) {
  	if ( nptr ) {
  	if (!( nptr->previous ))
  		cords_parameter_first = nptr->next;
  	else	nptr->previous->next = nptr->next;
  	if (!( nptr->next ))
  		cords_parameter_last = nptr->previous;
  	else	nptr->next->previous = nptr->previous;
  		liberate_occi_kind_node( nptr );
  		}
  	return((struct occi_kind_node *)0);
  }
  private struct occi_kind_node * drop_cords_parameter_node(struct occi_kind_node * nptr) {
  	pthread_mutex_lock( &list_cords_parameter_control );
  	nptr = ll_drop_cords_parameter_node( nptr );
  	pthread_mutex_unlock( &list_cords_parameter_control );
  	return(nptr);
  }
  
  /*	--------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   l o c a t e   n o d e 	*/
  /*	--------------------------------------------------	*/
  private struct occi_kind_node * ll_locate_cords_parameter_node(char * id) {
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	for ( nptr = cords_parameter_first;
  		nptr != (struct occi_kind_node *) 0;
  		nptr = nptr->next ) {
  		if (!( pptr = nptr->contents )) continue;
  		else if (!( pptr->id )) continue;
  		else if (!( strcmp(pptr->id,id) )) break;
  		}
  	return( nptr );
  }
  private struct occi_kind_node * locate_cords_parameter_node(char * id) {
  	struct occi_kind_node * nptr;
  	pthread_mutex_lock( &list_cords_parameter_control );
  	nptr = ll_locate_cords_parameter_node(id);
  	pthread_mutex_unlock( &list_cords_parameter_control );
  	return( nptr );
  }
  
  /*	--------------------------------------------	*/
  /*	o c c i   c a t e g o r y   a d d   n o d e 	*/
  /*	--------------------------------------------	*/
  private struct occi_kind_node * ll_add_cords_parameter_node(int mode) {
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	if (!( nptr = allocate_occi_kind_node() ))
  		return( nptr );
  	else	{
  		if (!( nptr->contents = allocate_cords_parameter()))
  			return( liberate_occi_kind_node(nptr) );
  		if (!( pptr = nptr->contents ))
  			return( liberate_occi_kind_node(nptr) );
  		else if (( mode != 0 ) && (!( pptr->id = occi_allocate_uuid())))
  			return( liberate_occi_kind_node(nptr) );
  		else	{
  			if (!( nptr->previous = cords_parameter_last ))
  				cords_parameter_first = nptr;
  			else	nptr->previous->next = nptr;
  			cords_parameter_last = nptr;
  			return( nptr );
  			}
  		}
  }
  private struct occi_kind_node * add_cords_parameter_node(int mode) {
  	struct occi_kind_node * nptr;
  	pthread_mutex_lock( &list_cords_parameter_control );
  	nptr = ll_add_cords_parameter_node( mode );
  	pthread_mutex_unlock( &list_cords_parameter_control );
  	return(nptr);
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   a u t o   l o a d 	*/
  /*	------------------------------------------------------------------------------------------	*/
  private char*autosave_cords_parameter_name="cords_parameter.xml";
  private void autoload_cords_parameter_nodes() {
  	char * fn=autosave_cords_parameter_name;	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	struct xml_element * document;
  	struct xml_element * eptr;
  	struct xml_element * vptr;
  	struct xml_atribut  * aptr;
  	if (!( document = document_parse_file(fn)))
  		return;
  	if ((eptr = document_element(document,"cords_parameters")) != (struct xml_element *) 0) {
  		for (vptr=eptr->first; vptr != (struct xml_element *) 0; vptr=vptr->next) {
  			if (!( vptr->name )) continue;
  			else if ( strcmp( vptr->name, "cords_parameter" ) ) continue;
  			else if (!( nptr = add_cords_parameter_node(0))) break;
  			else if (!( pptr = nptr->contents )) break;
  			if ((aptr = document_atribut( vptr, "id" )) != (struct xml_atribut *) 0)
  				pptr->id = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "service" )) != (struct xml_atribut *) 0)
  				pptr->service = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "contract" )) != (struct xml_atribut *) 0)
  				pptr->contract = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "provider" )) != (struct xml_atribut *) 0)
  				pptr->provider = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "name" )) != (struct xml_atribut *) 0)
  				pptr->name = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "value" )) != (struct xml_atribut *) 0)
  				pptr->value = document_atribut_string(aptr);
  			if ((aptr = document_atribut( vptr, "type" )) != (struct xml_atribut *) 0)
  				pptr->type = document_atribut_value(aptr);
  			if ((aptr = document_atribut( vptr, "state" )) != (struct xml_atribut *) 0)
  				pptr->state = document_atribut_value(aptr);
  			}
  		}
  	document = document_drop( document );
  	return;
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   a u t o   s a v e 	*/
  /*	------------------------------------------------------------------------------------------	*/
  public  void set_autosave_cords_parameter_name(char * fn) {
  	autosave_cords_parameter_name = fn;	return;
  }
  public  void autosave_cords_parameter_nodes() {
  	char * fn=autosave_cords_parameter_name;	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	FILE * h;
  	pthread_mutex_lock( &list_cords_parameter_control );
  	if (( h = fopen(fn,"w")) != (FILE *) 0) {
  	fprintf(h,"<cords_parameters>\n");
  	for ( nptr = cords_parameter_first;
  		nptr != (struct occi_kind_node *) 0;
  		nptr = nptr->next ) {
  		if (!( pptr = nptr->contents )) continue;
  		fprintf(h,"<cords_parameter\n");
  		fprintf(h," id=%c",0x0022);
  		fprintf(h,"%s",(pptr->id?pptr->id:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," service=%c",0x0022);
  		fprintf(h,"%s",(pptr->service?pptr->service:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," contract=%c",0x0022);
  		fprintf(h,"%s",(pptr->contract?pptr->contract:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," provider=%c",0x0022);
  		fprintf(h,"%s",(pptr->provider?pptr->provider:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," name=%c",0x0022);
  		fprintf(h,"%s",(pptr->name?pptr->name:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," value=%c",0x0022);
  		fprintf(h,"%s",(pptr->value?pptr->value:""));
  		fprintf(h,"%c",0x0022);
  		fprintf(h," type=%c",0x0022);
  		fprintf(h,"%u",pptr->type);
  		fprintf(h,"%c",0x0022);
  		fprintf(h," state=%c",0x0022);
  		fprintf(h,"%u",pptr->state);
  		fprintf(h,"%c",0x0022);
  		fprintf(h," />\n");
  		}
  	fprintf(h,"</cords_parameters>\n");
  	fclose(h);
  	}
  	pthread_mutex_unlock( &list_cords_parameter_control );
  	return;
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   s e t   f i e l d 	*/
  /*	------------------------------------------------------------------------------------------	*/
  private void set_cords_parameter_field(
  	struct occi_category * cptr,void * optr, char * nptr, char * vptr)
  {
  	struct cords_parameter * pptr;
  	char prefix[1024];
  	if (!( pptr = optr )) return;
  	sprintf(prefix,"%s.%s.",cptr->domain,cptr->id);
  	if (!( strncmp( nptr, prefix, strlen(prefix) ) )) {
  		nptr += strlen(prefix);
  		if (!( strcmp( nptr, "service" ) ))
  			pptr->service = allocate_string(vptr);
  		if (!( strcmp( nptr, "contract" ) ))
  			pptr->contract = allocate_string(vptr);
  		if (!( strcmp( nptr, "provider" ) ))
  			pptr->provider = allocate_string(vptr);
  		if (!( strcmp( nptr, "name" ) ))
  			pptr->name = allocate_string(vptr);
  		if (!( strcmp( nptr, "value" ) ))
  			pptr->value = allocate_string(vptr);
  		if (!( strcmp( nptr, "type" ) ))
  			pptr->type = atoi(vptr);
  		if (!( strcmp( nptr, "state" ) ))
  			pptr->state = atoi(vptr);
  		}
  	return;
  }
  
  /*	--------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   f i l t e r   i n f o 	*/
  /*	--------------------------------------------------	*/
  private struct cords_parameter * filter_cords_parameter_info(
  	struct occi_category * optr,
  	struct rest_request  * rptr,
  	struct rest_response * aptr) {
  	struct cords_parameter * pptr;
  		if (!( pptr = allocate_cords_parameter()))
  		return( pptr );
  	else if (!( occi_process_atributs(optr, rptr, aptr, pptr, set_cords_parameter_field) ))
  		return( liberate_cords_parameter(pptr));
  	else	return( pptr );
  }
  
  /*	--------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   f i l t e r   p a s s 	*/
  /*	--------------------------------------------------	*/
  private int pass_cords_parameter_filter(
  	struct cords_parameter * pptr,struct cords_parameter * fptr) {
  	if (( fptr->id )
  	&&  (strlen( fptr->id ) != 0)) {
  		if (!( pptr->id ))
  			return(0);
  		else if ( strcmp(pptr->id,fptr->id) != 0)
  			return(0);
  		}
  	if (( fptr->service )
  	&&  (strlen( fptr->service ) != 0)) {
  		if (!( pptr->service ))
  			return(0);
  		else if ( strcmp(pptr->service,fptr->service) != 0)
  			return(0);
  		}
  	if (( fptr->contract )
  	&&  (strlen( fptr->contract ) != 0)) {
  		if (!( pptr->contract ))
  			return(0);
  		else if ( strcmp(pptr->contract,fptr->contract) != 0)
  			return(0);
  		}
  	if (( fptr->provider )
  	&&  (strlen( fptr->provider ) != 0)) {
  		if (!( pptr->provider ))
  			return(0);
  		else if ( strcmp(pptr->provider,fptr->provider) != 0)
  			return(0);
  		}
  	if (( fptr->name )
  	&&  (strlen( fptr->name ) != 0)) {
  		if (!( pptr->name ))
  			return(0);
  		else if ( strcmp(pptr->name,fptr->name) != 0)
  			return(0);
  		}
  	if (( fptr->value )
  	&&  (strlen( fptr->value ) != 0)) {
  		if (!( pptr->value ))
  			return(0);
  		else if ( strcmp(pptr->value,fptr->value) != 0)
  			return(0);
  		}
  	if (( fptr->type ) && ( pptr->type != fptr->type )) return(0);
  	if (( fptr->state ) && ( pptr->state != fptr->state )) return(0);
  	return(1);
  }
  
  /*	----------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   r e s p o n s e 	*/
  /*	----------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_occi_response(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,
  	struct cords_parameter * pptr)
  {
  	struct rest_header * hptr;
  	sprintf(cptr->buffer,"occi.core.id=%s",pptr->id);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.service=%s",optr->domain,optr->id,pptr->service);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.contract=%s",optr->domain,optr->id,pptr->contract);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.provider=%s",optr->domain,optr->id,pptr->provider);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.name=%s",optr->domain,optr->id,pptr->name);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.value=%s",optr->domain,optr->id,pptr->value);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.type=%u",optr->domain,optr->id,pptr->type);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	sprintf(cptr->buffer,"%s.%s.state=%u",optr->domain,optr->id,pptr->state);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Attribute",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	if ( occi_render_links( aptr, pptr->id ) != 0)
  		return( rest_html_response( aptr, 500, "Server Link Failure" ) );
  	else	if (!( occi_success( aptr ) ))
  		return( rest_response_status( aptr, 500, "Server Failure" ) );
  	else	return( rest_response_status( aptr, 200, "OK" ) );
  }
  
  /*	----------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   g e t   i t e m 	*/
  /*	----------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_get_item(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr, char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	iptr = optr->callback;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	if (( iptr ) && (iptr->retrieve)) (*iptr->retrieve)(optr,nptr);
  	autosave_cords_parameter_nodes();
  	return( cords_parameter_occi_response(optr,cptr,rptr,aptr,pptr));
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p o s t   l i n k 	*/
  /*	------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_post_link(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	char * reqhost;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	--------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p o s t   m i x i n 	*/
  /*	--------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_post_mixin(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	char * reqhost;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else	return( rest_html_response( aptr, 400, "Bad Request"));
  }
  
  /*	----------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p o s t   a c t i o n 	*/
  /*	----------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_post_action(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_action * fptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	char * reqhost;
  	char * mptr;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	mptr = (rptr->parameters+strlen("action="));
  	for ( fptr=optr->firstact;
  		fptr != (struct occi_action *) 0;
  		fptr = fptr->next )
  		if (!( strncmp( mptr, fptr->name, strlen( fptr->name )) ))
  			return( occi_invoke_action(fptr,optr,cptr,rptr,aptr,pptr) );
  	return( rest_html_response( aptr, 400, "Incorrect Action Request"));
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p o s t   i t e m 	*/
  /*	------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_post_item(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	char * reqhost;
  	iptr = optr->callback;
  	if (!( reqhost = rest_request_host( rptr ) ))
  		return( rest_html_response( aptr, 400, "Bad Request" ) );
  	if (!( nptr = add_cords_parameter_node(1)))
  		return( rest_html_response( aptr, 500, "Server Failure") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 500, "Server Failure") );
  	if (!( occi_process_atributs( optr, rptr,aptr, pptr, set_cords_parameter_field ) ))
  		return( rest_html_response( aptr, 500, "Server Failure") );
  	if (( iptr ) && (iptr->create)) (*iptr->create)(optr,nptr);
  	autosave_cords_parameter_nodes();
  	sprintf(cptr->buffer,"%s%s%s",reqhost,optr->location,pptr->id);
  	if (!( hptr = rest_response_header( aptr, "X-OCCI-Location",cptr->buffer) ))
  		return( rest_html_response( aptr, 500, "Server Failure" ) );
  	else if (!( occi_success( aptr ) ))
  		return( rest_response_status( aptr, 500, "Server Failure" ) );
  	else	return( rest_response_status( aptr, 200, "OK" ) );
  }
  
  /*	----------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p u t   i t e m 	*/
  /*	----------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_put_item(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	iptr = optr->callback;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	if (!( occi_process_atributs(optr,rptr,aptr, pptr, set_cords_parameter_field ) ))
  		return( rest_html_response( aptr, 500, "Server Failure") );
  	if (( iptr ) && (iptr->update)) (*iptr->update)(optr,nptr);
  	autosave_cords_parameter_nodes();
  	return( cords_parameter_occi_response(optr,cptr,rptr,aptr,pptr));
  }
  
  /*	------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   h e a d   i t e m 	*/
  /*	------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_head_item(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr,char * id)
  {
  	struct rest_header * hptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else if (!( pptr = nptr->contents ))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	----------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   d e l e t e   i t e m 	*/
  /*	----------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_delete_item(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr, char * id)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct cords_parameter * pptr;
  	iptr = optr->callback;
  	if (!( nptr = locate_cords_parameter_node(id)))
  		return( rest_html_response( aptr, 404, "Not Found") );
  	if (( iptr ) && (iptr->delete)) (*iptr->delete)(optr,nptr);
  	drop_cords_parameter_node( nptr );
  	autosave_cords_parameter_nodes();
  	if (!( occi_success( aptr ) ))
  		return( rest_response_status( aptr, 500, "Server Failure" ) );
  	else	return( rest_response_status( aptr, 200, "OK" ) );
  }
  
  /*	----------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   g e t   l i s t 	*/
  /*	----------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_get_list(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr)
  {
  	struct rest_header * hptr;
  	struct occi_kind_node * sptr;
  	struct cords_parameter * pptr;
  	struct cords_parameter * fptr;
  	char * reqhost;
  	if (!( reqhost = rest_request_host( rptr ) ))
  		return( rest_html_response( aptr, 400, "Bad Request" ) );
  	else if (!( fptr = filter_cords_parameter_info( optr, rptr, aptr ) ))
  		return( rest_html_response( aptr, 400, "Bad Request" ) );
  	for ( sptr = cords_parameter_first;
  		sptr != (struct occi_kind_node *) 0;
  		sptr = sptr->next ) {
  		if (!( pptr = sptr->contents ))
  			continue;
  		if (!( pass_cords_parameter_filter( pptr, fptr ) ))
  			continue;
  		sprintf(cptr->buffer,"%s%s%s",reqhost,optr->location,pptr->id);
  		if (!( hptr = rest_response_header( aptr, "X-OCCI-Location",cptr->buffer) ))
  			return( rest_html_response( aptr, 500, "Server Failure" ) );
  		}
  	if (!( occi_success( aptr ) ))
  		return( rest_response_status( aptr, 500, "Server Failure" ) );
  	else	return( rest_response_status( aptr, 200, "OK" ) );
  }
  
  /*	--------------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   d e l e t e   a l l 	*/
  /*	--------------------------------------------------------------------------------------------	*/
  private struct rest_response * cords_parameter_delete_all(
  	struct occi_category * optr, struct rest_client * cptr,
  	struct rest_request * rptr, struct rest_response * aptr)
  {
  	struct rest_header * hptr;
  	struct occi_interface * iptr;
  	struct occi_kind_node * nptr;
  	struct occi_kind_node * sptr;
  	struct cords_parameter * pptr;
  	struct cords_parameter * fptr;
  	iptr = optr->callback;
  	if (!( fptr = filter_cords_parameter_info( optr, rptr, aptr ) ))
  		return( rest_html_response( aptr, 400, "Bad Request" ) );
  	nptr=cords_parameter_first;
  	while (nptr != (struct occi_kind_node *) 0) {
  		if ((!( pptr = nptr->contents ))
  		||  (!( pass_cords_parameter_filter( pptr, fptr ) ))) {
  			nptr = nptr->next;
  			continue;
  			}
  		else	{
  			if (( iptr ) && (iptr->delete)) { (*iptr->delete)(optr,nptr); }
  			sptr = nptr->next;
  			drop_cords_parameter_node( nptr );
  			nptr = sptr;
  			}
  		}
  	autosave_cords_parameter_nodes();
  	if (!( occi_success( aptr ) ))
  		return( rest_response_status( aptr, 500, "Server Failure" ) );
  	else	return( rest_response_status( aptr, 200, "OK" ) );
  }
  
  /*	------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   g e t 	*/
  /*	------------------------------------------------------------------------------	*/
  private struct rest_response * occi_cords_parameter_get(void * vptr, struct rest_client * cptr, struct rest_request * rptr)
  {
  	struct rest_response * aptr;
  	struct rest_header   * hptr;
  	struct occi_category * optr;
  	char * ctptr;
  	char * mptr;
  	if (!( hptr = rest_resolve_header( rptr->first, "Content-Type" ) ))
  		ctptr = "text/occi";
  	else	ctptr = hptr->value;
  	if (!( optr = vptr )) 
  		return( rest_bad_request(vptr,cptr,rptr) );
  	if(!(aptr = rest_allocate_response( cptr )))
  		return( aptr );
  	else if (!(strcmp( rptr->object, optr->location ) ))
  		return( cords_parameter_get_list( optr, cptr, rptr, aptr ) );
  	else if (!(strncmp( rptr->object, optr->location, strlen(optr->location) ) ))
  		return( cords_parameter_get_item( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	--------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   h e a d 	*/
  /*	--------------------------------------------------------------------------------	*/
  private struct rest_response * occi_cords_parameter_head(void * vptr, struct rest_client * cptr, struct rest_request * rptr)
  {
  	struct rest_response * aptr;
  	struct rest_header   * hptr;
  	struct occi_category * optr;
  	char * ctptr;
  	char * mptr;
  	if (!( hptr = rest_resolve_header( rptr->first, "Content-Type" ) ))
  		ctptr = "text/occi";
  	else	ctptr = hptr->value;
  	if (!( optr = vptr )) 
  		return( rest_bad_request(vptr,cptr,rptr) );
  	if(!(aptr = rest_allocate_response( cptr )))
  		return( aptr );
  	else if (!(strncmp( rptr->object, optr->location, strlen(optr->location) ) ))
  		return( cords_parameter_head_item( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	--------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p o s t 	*/
  /*	--------------------------------------------------------------------------------	*/
  private struct rest_response * occi_cords_parameter_post(void * vptr, struct rest_client * cptr, struct rest_request * rptr)
  {
  	struct rest_response * aptr;
  	struct rest_header   * hptr;
  	struct occi_category * optr;
  	char * ctptr;
  	char * mptr;
  	if (!( hptr = rest_resolve_header( rptr->first, "Content-Type" ) ))
  		ctptr = "text/occi";
  	else	ctptr = hptr->value;
  	if (!( optr = vptr )) 
  		return( rest_bad_request(vptr,cptr,rptr) );
  	if(!(aptr = rest_allocate_response( cptr )))
  		return( aptr );
  	else if (!( strcmp( rptr->object, optr->location ) ))
  		return( cords_parameter_post_item( optr, cptr, rptr, aptr ) );
  	else if ( strncmp( rptr->object, optr->location,strlen(optr->location)) != 0)
  		return( rest_html_response( aptr, 400, "Bad Request") );
  	else if (!( rptr->parameters ))
  		return( rest_html_response( aptr, 400, "Bad Request") );
  	else if (!( strncmp( rptr->parameters, "action=", strlen("action=")) ))
  		return( cords_parameter_post_action( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else if (!( strncmp( rptr->parameters, "mixin=", strlen("mixin=")) ))
  		return( cords_parameter_post_mixin( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else if (!( strncmp( rptr->parameters, "link=", strlen("link=")) ))
  		return( cords_parameter_post_link( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   p u t 	*/
  /*	------------------------------------------------------------------------------	*/
  private struct rest_response * occi_cords_parameter_put(void * vptr, struct rest_client * cptr, struct rest_request * rptr)
  {
  	struct rest_response * aptr;
  	struct rest_header   * hptr;
  	struct occi_category * optr;
  	char * ctptr;
  	char * mptr;
  	if (!( hptr = rest_resolve_header( rptr->first, "Content-Type" ) ))
  		ctptr = "text/occi";
  	else	ctptr = hptr->value;
  	if (!( optr = vptr )) 
  		return( rest_bad_request(vptr,cptr,rptr) );
  	if(!(aptr = rest_allocate_response( cptr )))
  		return( aptr );
  	else if (!(strncmp( rptr->object, optr->location, strlen(optr->location) ) ))
  		return( cords_parameter_put_item( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	------------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   m e t h o d   d e l e t e 	*/
  /*	------------------------------------------------------------------------------------	*/
  private struct rest_response * occi_cords_parameter_delete(void * vptr, struct rest_client * cptr, struct rest_request * rptr)
  {
  	struct rest_response * aptr;
  	struct rest_header   * hptr;
  	struct occi_category * optr;
  	char * ctptr;
  	char * mptr;
  	if (!( hptr = rest_resolve_header( rptr->first, "Content-Type" ) ))
  		ctptr = "text/occi";
  	else	ctptr = hptr->value;
  	if (!( optr = vptr )) 
  		return( rest_bad_request(vptr,cptr,rptr) );
  	if(!(aptr = rest_allocate_response( cptr )))
  		return( aptr );
  	else if (!(strcmp( rptr->object, optr->location ) ))
  		return( cords_parameter_delete_all( optr, cptr, rptr, aptr ) );
  	else if (!(strncmp( rptr->object, optr->location, strlen(optr->location) ) ))
  		return( cords_parameter_delete_item( optr, cptr, rptr, aptr,rptr->object+strlen(optr->location) ) );
  	else	return( rest_html_response( aptr, 400, "Bad Request") );
  }
  
  /*	--------------------------------------------------------------------------------	*/
  /*	o c c i   c a t e g o r y   r e s t   i n t e r f a c e   r e d i r e c t i o n 	*/
  /*	--------------------------------------------------------------------------------	*/
  private void	redirect_occi_cords_parameter_mt( struct rest_interface * iptr )
  {
  	iptr->get = occi_cords_parameter_get;
  	iptr->post = occi_cords_parameter_post;
  	iptr->put = occi_cords_parameter_put;
  	iptr->delete = occi_cords_parameter_delete;
  	iptr->head = occi_cords_parameter_head;
  	return;
  }
  
  /*	------------------------------------	*/
  /*	c r u d   d e l e t e   a c t i o n 	*/
  /*	------------------------------------	*/
  private struct rest_response * delete_action_cords_parameter(struct occi_category * optr, 
  struct rest_client * cptr,  
  struct rest_request * rptr,  
  struct rest_response * aptr,  
  void * vptr )
  {
  	aptr = liberate_rest_response( aptr );
  	return( occi_cords_parameter_delete(optr,cptr,rptr));
  }
  
  /*	------------------------------------------	*/
  /*	o c c i   c a t e g o r y   b u i l d e r 	*/
  /*	------------------------------------------	*/
  /* occi category rest instance builder for : occi_cords_parameter */
  public struct occi_category * occi_cords_parameter_builder(char * a,char * b) {
  	char * c="http://scheme.compatibleone.fr/scheme/compatible#";
  	char * d="kind";
  	char * e="http://scheme.ogf.org/occi/resource#";
  	char * f="CompatibleOne OCCI resource cords_parameter";
  	struct occi_category * optr;
  	if (!( optr = occi_create_category(a,b,c,d,e,f) )) { return(optr); }
  	else {
  		redirect_occi_cords_parameter_mt(optr->interface);
  		if (!( optr = occi_add_attribute(optr, "service",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "contract",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "provider",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "name",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "value",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "type",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_attribute(optr, "state",0,0) ))
  			return(optr);
  		if (!( optr = occi_add_action( optr,"DELETE","",delete_action_cords_parameter)))
  			return( optr );
  		autoload_cords_parameter_nodes();
  		return(optr);
  	}
  
  }
  
  /*	--------------------------------------------------------	*/
  /*	c o r d s _ p a r a m e t e r _ o c c i _ h e a d e r s 	*/
  /*	--------------------------------------------------------	*/
  public struct rest_header *  cords_parameter_occi_headers(struct cords_parameter * sptr)
  {
  	struct rest_header * first=(struct rest_header *) 0;
  	struct rest_header * last=(struct rest_header *) 0;
  	struct rest_header * hptr=(struct rest_header *) 0;
  	char buffer[8192];
  	if (!( sptr )) return(0);
  	if (!( hptr = allocate_rest_header()))
  		return(hptr);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("Category")))
  		return(first);
  	sprintf(buffer,"cords_parameter; scheme='http://scheme.compatibleone.fr/scheme/compatible#'; class='kind';\r\n");
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.service='%s'\r\n",(sptr->service?sptr->service:""));
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.contract='%s'\r\n",(sptr->contract?sptr->contract:""));
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.provider='%s'\r\n",(sptr->provider?sptr->provider:""));
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.name='%s'\r\n",(sptr->name?sptr->name:""));
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.value='%s'\r\n",(sptr->value?sptr->value:""));
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.type='%u'\r\n",sptr->type);
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	if (!( hptr = allocate_rest_header()))
  		return(first);
  		else	if (!( hptr->previous = last))
  			first = hptr;
  		else	hptr->previous->next = hptr;
  		last = hptr;
  	if (!( hptr->name = allocate_string("X-OCCI-Attribute")))
  		return(first);
  	sprintf(buffer,"occi.cords_parameter.state='%u'\r\n",sptr->state);
  	if (!( hptr->value = allocate_string(buffer)))
  		return(first);
  	return(first);
  
  }
  
  #endif	/* _occiparameter_c_ */
  