rem: unsigned char  *p; unsigned char  *kid; unsigned char  *not_present_node; unsigned char  attr_name;
add: char  *p; char  *kid; char  *not_present_node; unsigned short attr_name;
context: inline unsigned char *run_language_switch( struct cpl_interpreter *intr ){	unsigned char  *p;	unsigned char  *kid;	unsigned char  *not_present_node;	unsigned char  attr_name;	int nr_attr;	int i,j;	str attr = {0,0};	str msg_val = {0,0};	str lang_tag = {0,0};	str lang_subtag = {0,0};	not_present_node = 0;	for( i=0 ; i<NR_OF_KIDS(intr->ip) ; i++ ) {		kid = intr->ip + KID_OFFSET(intr->ip,i);		check_overflow_by_ptr( kid+SIMPLE_NODE_SIZE(kid), intr, script_error);		switch ( NODE_TYPE(kid) ) {			case NOT_PRESENT_NODE:				if (not_present_node) {					LOG(L_ERR,"ERROR:run_language_switch: NOT_PRESENT node "						"found twice!\n");					goto script_error;				}				not_present_node = kid;				break;			case OTHERWISE_NODE :				if (i!=NR_OF_KIDS(intr->ip)-1) {					LOG(L_ERR,"ERROR:run_language_switch: OTHERWISE node "						"not found as the last sub-node!\n");					goto script_error;				}				DBG("DEBUG:run_language_switch: matching on OTHERWISE node\n");				return get_first_child(kid);			case LANGUAGE_NODE :				/* check the number of attributes */				nr_attr = NR_OF_ATTR(kid);				if (nr_attr<1 || nr_attr>2) {					LOG(L_ERR,"ERROR:run_string_switch: incorect nr of attrs "						"(%d) in LANGUAGE node (1 or 2)\n",NR_OF_ATTR(kid));					goto script_error;				}				/* get the attributes */				p = ATTR_PTR(kid);				lang_tag.s = lang_subtag.s = 0;				lang_tag.len = lang_subtag.len = 0;				for(j=0;j<nr_attr;j++) {					get_basic_attr( p, attr_name, attr.len, intr, script_error);					get_str_attr( p, attr.s, attr.len, intr, script_error,0);					if (attr_name==MATCHES_TAG_ATTR ) {						lang_tag = attr;						DBG("DEBUG:cpl-c:run_language_string: language-tag is"							" [%.*s]\n",attr.len,attr.s);					}else if (attr_name==MATCHES_SUBTAG_ATTR) {						lang_subtag = attr;						DBG("DEBUG:cpl-c:run_language_string: language-subtag"							" is [%.*s]\n",attr.len,attr.s);					}else {						LOG(L_ERR,"ERROR:run_language_switch: unknown attribut"						" (%d) in LANGUAGE node\n",attr_name);						goto script_error;					}				}								/* get the value from the SIP message -> if not yet, do it now				 * and rememer it for the next times */				if (!msg_val.s) {					if (intr->accept_language==STR_NOT_FOUND)						goto not_present;					if (!intr->accept_language) {						/* get the accept_language header */						if (!intr->msg->accept_language) {							if (parse_headers(intr->msg,							HDR_ACCEPTLANGUAGE,0)==-1) {								LOG(L_ERR,"ERROR:run_language_switch: "									"bad ACCEPT_LANGUAGE header\n");								goto runtime_error;							} else if (!intr->msg->accept_language) {								/* hdr not present */								intr->accept_language = STR_NOT_FOUND;								goto not_present;							}						}						intr->subject =							&(intr->msg->accept_language->body);					}				}				trim_len( msg_val.len,msg_val.s, *(intr->subject));				DBG("DEBUG:run_language_switch: extracted msg string is "					"<%.*s>\n",msg_val.len, msg_val.s);								/* does the value from script match the one from message? */				if (msg_val.len && msg_val.s) {					j = is_lang_tag_matching(&msg_val,&lang_tag,&lang_subtag);					if (j==1) {						DBG("DEBUG:run_language_switch: matching on "							"LANGUAGE node\n");						return get_first_child(kid);					}else if (j==-1) {						goto runtime_error;					}				}				break;			default:				LOG(L_ERR,"ERROR:cpl_c:run_language_switch: unknown output "					"node type (%d) for LANGUAGE_SWITCH node\n",					NODE_TYPE(kid));				goto script_error;		} /* end switch for NODE_TYPE */	} /* end for for all kids */	return DEFAULT_ACTION;not_present:	DBG("DEBUG:run_string_switch: required hdr not present in sip msg\n");	if (not_present_node)		return get_first_child(not_present_node);	/* look for the NOT_PRESENT node */	DBG("DEBUG:run_string_switch: searching for NOT_PRESENT sub-node..\n");	for(; i<NR_OF_KIDS(intr->ip) ; i++ ) {		kid = intr->ip + KID_OFFSET(intr->ip,i);		check_overflow_by_ptr( kid+SIMPLE_NODE_SIZE(kid), intr, script_error);		if (NODE_TYPE(kid)==NOT_PRESENT_NODE)			return get_first_child(kid);	}	return DEFAULT_ACTION;runtime_error:	return CPL_RUNTIME_ERROR;script_error:	return CPL_SCRIPT_ERROR;}