void xml_add_attribute_color(char *name,d3col *col) { int ir,ig,ib; char txt[256]; ir=(int)(col->r*0xFF); ig=(int)(col->g*0xFF); ib=(int)(col->b*0xFF); txt[0]=xml_hex_int_to_character(ir>>4); txt[1]=xml_hex_int_to_character(ir); txt[2]=xml_hex_int_to_character(ig>>4); txt[3]=xml_hex_int_to_character(ig); txt[4]=xml_hex_int_to_character(ib>>4); txt[5]=xml_hex_int_to_character(ib); txt[6]=0x0; xml_add_attribute_text(name,txt); }
bool xml_add_attribute_bit_array(char *name,unsigned char *value,int count) { int k,i; unsigned char *c; char txt[5120]; c=(unsigned char*)value; for (k=0;k!=count;k++) { i=(int)*c++; txt[(k<<1)]=xml_hex_int_to_character(i>>4); txt[(k<<1)+1]=xml_hex_int_to_character(i); } txt[count<<1]=0x0; return(xml_add_attribute_text(name,txt)); }