-/* Copyright (C) 2003,2004,2005 MORIOKA Tomohiko
+/* Copyright (C) 2003,2004,2005,2011 MORIOKA Tomohiko
This file is part of the CHISE Library.
The CHISE Library is free software; you can redistribute it and/or
return concord_obj_get_feature_value_string (key_buf, feature, valdatum);
}
+int
+chise_char_load_decomposition (CHISE_Char_ID cid,
+ CHISE_Feature feature,
+ CHISE_Char_ID* base_char, CHISE_Char_ID* comb_char)
+{
+ unsigned char key_buf[8];
+ CHISE_Value value;
+ int status;
+ unsigned char* vp;
+ unsigned char* vp_ret;
+ int len;
+
+ chise_format_char_id (cid, key_buf, 8);
+ if ( status = concord_obj_get_feature_value_string (key_buf, feature, &value) )
+ return status;
+ len = chise_value_size (&value);
+ if ( len < (1 + 2 + 1 + 2 + 1) )
+ return -1;
+
+ vp = chise_value_data (&value);
+ if ( *vp++ != '(' )
+ return -1;
+ len--;
+
+ if ( ( vp_ret = memchr (vp, ' ', len) ) == NULL )
+ return -1;
+ *base_char = chise_char_id_parse_c_string (vp, vp_ret - vp + 1);
+ if ( *base_char == -1 )
+ return -1;
+ vp = vp_ret + 1;
+ len -= vp - chise_value_data (&value);
+ if ( len <= 1 )
+ return -1;
+
+ *comb_char = chise_char_id_parse_c_string (vp, len);
+ if ( *comb_char == -1 )
+ return -1;
+ return 0;
+}
+
unsigned char*
chise_char_gets_feature_value (CHISE_Char_ID cid,
CHISE_Feature feature,