Compare commits
10 Commits
5067527394
...
v1.0.0-rc1
Author | SHA1 | Date | |
---|---|---|---|
e8a8abbe65 | |||
71b1ad2a32 | |||
cf7d0c22f7 | |||
6f40e37e81 | |||
84c60fc461 | |||
b47828014e | |||
2c7ce64722 | |||
dc85955859 | |||
5ec8d8d90b | |||
e33c48618b |
@@ -136,4 +136,4 @@ The output sections start and end are checked for the given magic numbers in ord
|
||||
The memory is interpreted as *little endian* and the CRC calculation granularity is a 32 bit *word*.
|
||||
|
||||
# BUGS
|
||||
Currently, reversed CRC algorithms are not implemented.
|
||||
None
|
||||
|
71
src/crc.c
71
src/crc.c
@@ -34,13 +34,26 @@ int crc_len_from_poly(uint64_t polynomial)
|
||||
return pos;
|
||||
}
|
||||
|
||||
static uint32_t reverse_short_poly(uint32_t poly, uint8_t len)
|
||||
{
|
||||
uint8_t i;
|
||||
uint32_t ret = 0ul;
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
ret <<= 1;
|
||||
ret |= (poly & 1u);
|
||||
poly >>= 1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static uint64_t shorten_polynomial(uint64_t poly)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 31; i <= 0; i--) {
|
||||
if (poly & (1 << i)) {
|
||||
poly &= ~(1<<i);
|
||||
for (i = 32; i >= 0; i--) {
|
||||
if (poly & ((uint64_t)1ull << i)) {
|
||||
poly &= ~((uint64_t)1ull<<i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -55,14 +68,22 @@ static void internal_push_byte(struct crc_calc *crc, const uint8_t *data, size_t
|
||||
|
||||
crc_val = crc->crc_val;
|
||||
|
||||
for (i = 0; i < len; i++, data++) {
|
||||
crc_val = ((crc_val << 8) & crc->crc_mask) ^ crc->table[((crc_val >> (crc->crc_length-8u)) & 0xff) ^ *data];
|
||||
if (crc->settings.rev) {
|
||||
for (i = 0; i < len; i++, data++) {
|
||||
crc_val = (crc_val >> 8) ^ crc->table[((crc_val & 0xFF) ^ *data)];
|
||||
}
|
||||
} else {
|
||||
/* Non reversed algo */
|
||||
for (i = 0; i < len; i++, data++) {
|
||||
crc_val = ((crc_val << 8) & crc->crc_mask) ^
|
||||
crc->table[((crc_val >> (crc->crc_length-8u)) & 0xff) ^ *data];
|
||||
}
|
||||
}
|
||||
|
||||
crc->crc_val = crc_val;
|
||||
}
|
||||
|
||||
static void fill_crc_table(struct crc_calc *crc)
|
||||
static void fill_crc_table_non_reversed(struct crc_calc *crc)
|
||||
{
|
||||
uint32_t input;
|
||||
uint32_t crc_reg;
|
||||
@@ -86,10 +107,44 @@ static void fill_crc_table(struct crc_calc *crc)
|
||||
crc_reg <<= 1;
|
||||
}
|
||||
}
|
||||
crc->table[input] = crc_reg;
|
||||
crc->table[input] = crc_reg & crc->crc_mask;
|
||||
}
|
||||
}
|
||||
|
||||
static void fill_crc_table_reversed(struct crc_calc *crc)
|
||||
{
|
||||
uint32_t input;
|
||||
uint32_t crc_reg;
|
||||
uint32_t short_poly;
|
||||
int i;
|
||||
|
||||
short_poly = (uint32_t)shorten_polynomial(crc->settings.polynomial);
|
||||
short_poly = reverse_short_poly(short_poly, crc->crc_length);
|
||||
|
||||
for (input = 0; input <= 255u; input++) {
|
||||
crc_reg = (uint32_t)input;
|
||||
for (i = 0; i < 8; i++) {
|
||||
/* Check LSB for reversed CRC shifting */
|
||||
if (crc_reg & 1u) {
|
||||
crc_reg >>= 1;
|
||||
crc_reg ^= short_poly;
|
||||
} else {
|
||||
crc_reg >>= 1;
|
||||
}
|
||||
}
|
||||
crc->table[input] = crc_reg & crc->crc_mask;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void fill_crc_table(struct crc_calc *crc)
|
||||
{
|
||||
if (crc->settings.rev)
|
||||
fill_crc_table_reversed(crc);
|
||||
else
|
||||
fill_crc_table_non_reversed(crc);
|
||||
}
|
||||
|
||||
void crc_init(struct crc_calc *crc, const struct crc_settings *settings)
|
||||
{
|
||||
uint32_t i;
|
||||
|
@@ -55,16 +55,16 @@ struct elfpatch {
|
||||
#define is_elfpatch_struct(x) ((x) && (x)->magic == (ELFPATCH_MAGIC))
|
||||
|
||||
#define ret_if_ep_err(ep) do { \
|
||||
if (!is_elfpatch_struct((ep))) { \
|
||||
return; \
|
||||
} \
|
||||
} while(0)
|
||||
if (!is_elfpatch_struct((ep))) { \
|
||||
return; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define ret_val_if_ep_err(ep, val) do { \
|
||||
if (!is_elfpatch_struct((ep))) { \
|
||||
return (val); \
|
||||
} \
|
||||
} while(0)
|
||||
if (!is_elfpatch_struct((ep))) { \
|
||||
return val; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/**
|
||||
* @brief Convert a series of 4 bytes into a uint32_t dpending on endianess
|
||||
@@ -197,7 +197,7 @@ static SlList *elf_patch_get_sections(elfpatch_handle_t *ep)
|
||||
sl_list_free_full(ret, (void (*)(void *))free_elf_section_element);
|
||||
ep->sections = NULL;
|
||||
|
||||
if (elf_getshdrstrndx (ep->elf , &shstrndx) != 0) {
|
||||
if (elf_getshdrstrndx(ep->elf, &shstrndx) != 0) {
|
||||
print_err("ELF error: %s\n", elf_errmsg(-1));
|
||||
goto ret_free_section_list;
|
||||
}
|
||||
@@ -218,9 +218,10 @@ static SlList *elf_patch_get_sections(elfpatch_handle_t *ep)
|
||||
sec->lma = (uint64_t)sec->section_header.sh_addr;
|
||||
|
||||
name = elf_strptr(ep->elf, shstrndx, sec->section_header.sh_name);
|
||||
if (name) {
|
||||
|
||||
if (name)
|
||||
sec->name = strdup(name);
|
||||
}
|
||||
|
||||
ret = sl_list_append(ret, sec);
|
||||
}
|
||||
|
||||
@@ -431,15 +432,13 @@ elfpatch_handle_t *elf_patch_open(const char *path, bool readonly, bool expect_l
|
||||
switch (ident[5]) {
|
||||
case 1:
|
||||
print_debug("ELF Endianess: little\n");
|
||||
if (!expect_little_endian) {
|
||||
if (!expect_little_endian)
|
||||
print_err("Big endian format expected. File is little endian. Double check settings!\n");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
print_debug("ELF Endianess: big\n");
|
||||
if (expect_little_endian) {
|
||||
if (expect_little_endian)
|
||||
print_err("Little endian format expected. File is big endian. Double check settings!\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
print_err("Cannot determine endianess of ELF file. EI_DATA is: %d\n", ident[5]);
|
||||
@@ -454,9 +453,8 @@ close_elf:
|
||||
ep->elf = NULL;
|
||||
}
|
||||
close_fd:
|
||||
if (ep->fd > 0) {
|
||||
if (ep->fd > 0)
|
||||
close(ep->fd);
|
||||
}
|
||||
free_struct:
|
||||
free(ep);
|
||||
ep = NULL;
|
||||
@@ -491,14 +489,14 @@ int elf_patch_check_for_section(elfpatch_handle_t *ep, const char *section)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static size_t translate_index(size_t index, enum granularity granularity, bool little_endian)
|
||||
static size_t translate_index(size_t index, enum granularity granularity, bool little_endian, bool reversed)
|
||||
{
|
||||
size_t word_idx;
|
||||
size_t part_idx;
|
||||
size_t d_index;
|
||||
size_t gran_in_bytes;
|
||||
|
||||
if (!little_endian || granularity == GRANULARITY_BYTE)
|
||||
if ((!little_endian && !reversed) || (little_endian && reversed) || granularity == GRANULARITY_BYTE)
|
||||
return index;
|
||||
|
||||
gran_in_bytes = (size_t)granularity / 8u;
|
||||
@@ -548,8 +546,9 @@ int elf_patch_compute_crc_over_section(elfpatch_handle_t *ep, const char *sectio
|
||||
return -2;
|
||||
}
|
||||
|
||||
/* If big endian or granularity is byte, simply compute CRC. No reordering is necessary */
|
||||
if (!little_endian || granularity == GRANULARITY_BYTE) {
|
||||
/* If big endian for non reversed / little endian for reversed or granularity is byte, simply compute CRC. No reordering is necessary */
|
||||
if ((!little_endian && !crc->settings.rev) || (little_endian && crc->settings.rev) ||
|
||||
granularity == GRANULARITY_BYTE) {
|
||||
crc_push_bytes(crc, data->d_buf, data->d_size);
|
||||
} else {
|
||||
/* Little endian case with > byte sized chunks */
|
||||
@@ -561,14 +560,17 @@ int elf_patch_compute_crc_over_section(elfpatch_handle_t *ep, const char *sectio
|
||||
section, padding_count);
|
||||
}
|
||||
|
||||
for (idx = 0; idx < data->d_size; idx++) {
|
||||
crc_push_byte(crc, ((char *)data->d_buf)[translate_index(idx, granularity, little_endian)]);
|
||||
}
|
||||
for (idx = 0; idx < data->d_size; idx++)
|
||||
crc_push_byte(crc,
|
||||
((char *)data->d_buf)[
|
||||
translate_index(idx, granularity,
|
||||
little_endian,
|
||||
crc->settings.rev)
|
||||
]);
|
||||
|
||||
/* Pad with zeroes */
|
||||
for (idx = 0; idx < padding_count; idx++) {
|
||||
for (idx = 0; idx < padding_count; idx++)
|
||||
crc_push_byte(crc, 0x00);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -711,8 +713,8 @@ int elf_patch_write_crcs_to_section(elfpatch_handle_t *ep, const char *output_se
|
||||
|
||||
print_debug("Single CRC requires %u bytes.\n", (unsigned int)crc_size_bytes);
|
||||
|
||||
needed_space = calculate_needed_space_for_crcs(format, crc_data->elf_bits, check_start_magic, check_end_magic, crc_size_bytes,
|
||||
crc_count);
|
||||
needed_space = calculate_needed_space_for_crcs(format, crc_data->elf_bits, check_start_magic,
|
||||
check_end_magic, crc_size_bytes, crc_count);
|
||||
|
||||
print_debug("Required space for %zu CRCs%s: %zu (available: %zu)\n",
|
||||
crc_count,
|
||||
@@ -782,11 +784,10 @@ int elf_patch_write_crcs_to_section(elfpatch_handle_t *ep, const char *output_se
|
||||
crc_64bit.length = 0ull;
|
||||
crc_64bit.start_address = 0ull;
|
||||
|
||||
if (crc_data->elf_bits == 32) {
|
||||
if (crc_data->elf_bits == 32)
|
||||
memcpy(sec_bytes, &crc_32bit, sizeof(crc_32bit));
|
||||
} else {
|
||||
else
|
||||
memcpy(sec_bytes, &crc_64bit, sizeof(crc_64bit));
|
||||
}
|
||||
}
|
||||
|
||||
/* Flag section data as invalid to trigger rewrite.
|
||||
@@ -808,9 +809,8 @@ void elf_patch_close_and_free(elfpatch_handle_t *ep)
|
||||
if (ep->readonly) {
|
||||
print_debug("DRY RUN: File will not be updated\n");
|
||||
} else {
|
||||
if (elf_update(ep->elf, ELF_C_WRITE) < 0) {
|
||||
if (elf_update(ep->elf, ELF_C_WRITE) < 0)
|
||||
print_err("Error writing ELF file: %s\n", elf_errmsg(-1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
46
src/main.c
46
src/main.c
@@ -108,11 +108,11 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state)
|
||||
/* Polyniomial */
|
||||
args->crc.polynomial = strtoull(arg, &endptr, 0);
|
||||
if (endptr == arg) {
|
||||
if ((looked_up_crc = lookup_named_crc(arg))) {
|
||||
looked_up_crc = lookup_named_crc(arg);
|
||||
if (looked_up_crc)
|
||||
memcpy(&args->crc, &looked_up_crc->settings, sizeof(struct crc_settings));
|
||||
} else {
|
||||
else
|
||||
argp_error(state, "Error parsing polynomial: %s\n", arg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
@@ -261,28 +261,22 @@ static void print_verbose_start_info(const struct command_line_options *cmd_opts
|
||||
print_debug("CRC length: %d\n", crc_len_from_poly(cmd_opts->crc.polynomial));
|
||||
}
|
||||
|
||||
if (cmd_opts->elf_path) {
|
||||
if (cmd_opts->elf_path)
|
||||
print_debug("ELF file: %s\n", cmd_opts->elf_path);
|
||||
}
|
||||
|
||||
if (cmd_opts->output_section) {
|
||||
if (cmd_opts->output_section)
|
||||
print_debug("Output section: %s\n", cmd_opts->output_section);
|
||||
}
|
||||
|
||||
if (cmd_opts->export_xml) {
|
||||
if (cmd_opts->export_xml)
|
||||
print_debug("Export CRCs to '%s'\n", cmd_opts->export_xml);
|
||||
}
|
||||
|
||||
if (cmd_opts->import_xml) {
|
||||
if (cmd_opts->import_xml)
|
||||
print_debug("Import CRCs from '%s'\n", cmd_opts->import_xml);
|
||||
}
|
||||
|
||||
if (cmd_opts->section_list) {
|
||||
for (list_iter = cmd_opts->section_list, i = 1; list_iter; list_iter = sl_list_next(list_iter), i++) {
|
||||
for (list_iter = cmd_opts->section_list, i = 1; list_iter; list_iter = sl_list_next(list_iter), i++)
|
||||
print_debug("Input section [%d]: \"%s\"\n", i, (const char *)list_iter->data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void free_cmd_args(struct command_line_options *opts)
|
||||
@@ -322,6 +316,7 @@ static int check_all_sections_present(elfpatch_handle_t *ep, SlList *list)
|
||||
sec_name = (const char *)iter->data;
|
||||
if (!sec_name)
|
||||
continue;
|
||||
|
||||
if (elf_patch_check_for_section(ep, sec_name)) {
|
||||
print_err("Cannot find section '%s'\n", sec_name);
|
||||
ret = -2;
|
||||
@@ -340,7 +335,8 @@ static int check_all_sections_present(elfpatch_handle_t *ep, SlList *list)
|
||||
* @param opts Command line options. Used for CRC generation
|
||||
* @return CRC data
|
||||
*/
|
||||
static struct crc_import_data *compute_crcs(elfpatch_handle_t *ep, SlList *list, const struct command_line_options *opts)
|
||||
static struct crc_import_data *compute_crcs(elfpatch_handle_t *ep, SlList *list,
|
||||
const struct command_line_options *opts)
|
||||
{
|
||||
SlList *iter;
|
||||
const char *sec_name;
|
||||
@@ -423,6 +419,7 @@ int main(int argc, char **argv)
|
||||
|
||||
prepare_default_opts(&cmd_opts);
|
||||
parse_cmdline_options(&argc, &argv, &cmd_opts);
|
||||
|
||||
if (cmd_opts.print_xsd) {
|
||||
xml_print_xsd();
|
||||
goto free_cmds;
|
||||
@@ -430,6 +427,7 @@ int main(int argc, char **argv)
|
||||
|
||||
if (cmd_opts.verbose || cmd_opts.dry_run)
|
||||
reporting_enable_verbose();
|
||||
|
||||
print_verbose_start_info(&cmd_opts);
|
||||
|
||||
if (cmd_opts.list) {
|
||||
@@ -448,19 +446,11 @@ int main(int argc, char **argv)
|
||||
return -2;
|
||||
}
|
||||
|
||||
if (cmd_opts.use_vma && cmd_opts.format != FORMAT_STRUCT) {
|
||||
if (cmd_opts.use_vma && cmd_opts.format != FORMAT_STRUCT)
|
||||
print_warn("--use-vma option only has an effect when exporting as struct output.\n");
|
||||
}
|
||||
|
||||
if (!cmd_opts.output_section && cmd_opts.export_xml == NULL) {
|
||||
if (!cmd_opts.output_section && cmd_opts.export_xml == NULL)
|
||||
print_err("No output section / XML export specified. Will continue but not create any output\n");
|
||||
}
|
||||
|
||||
/* Do error printing if using a reversed polynomial. It is not implemented yet! */
|
||||
if (cmd_opts.crc.rev) {
|
||||
print_err("Reversed polynomials are not supported yet\nExiting...\n");
|
||||
goto free_cmds;
|
||||
}
|
||||
|
||||
/* Prepare libelf for use with the latest ELF version */
|
||||
elf_version(EV_CURRENT);
|
||||
@@ -481,13 +471,11 @@ int main(int argc, char **argv)
|
||||
|
||||
/* Compute CRCs over sections */
|
||||
crc_data = compute_crcs(ep, cmd_opts.section_list, &cmd_opts);
|
||||
if (!crc_data) {
|
||||
if (!crc_data)
|
||||
goto ret_close_elf;
|
||||
}
|
||||
|
||||
if (reporting_get_verbosity()) {
|
||||
if (reporting_get_verbosity())
|
||||
print_crcs(crc_data);
|
||||
}
|
||||
} else {
|
||||
crc_data = xml_import_from_file(cmd_opts.import_xml);
|
||||
}
|
||||
|
@@ -28,7 +28,7 @@
|
||||
.xor = outxor, \
|
||||
.start_value = init, \
|
||||
.rev = reverse \
|
||||
}}
|
||||
} }
|
||||
|
||||
const struct named_crc predefined_crc_table[] = {
|
||||
NAMED_CRC("crc-8", 0x107, false, 0x00, 0x00),
|
||||
@@ -70,7 +70,7 @@ const struct named_crc predefined_crc_table[] = {
|
||||
NAMED_CRC("jamcrc", 0x104C11DB7, true, 0xFFFFFFFF, 0x00000000),
|
||||
NAMED_CRC("xfer", 0x1000000AF, false, 0x00000000, 0x00000000),
|
||||
/* SENTINEL */
|
||||
{.name = NULL, .settings = {0, 0, 0, false}},
|
||||
{ .name = NULL, .settings = {0, 0, 0, false} },
|
||||
};
|
||||
|
||||
const struct named_crc *reverse_lookup_named_crc(const struct crc_settings *settings)
|
||||
@@ -110,19 +110,26 @@ void list_predefined_crcs(void)
|
||||
{
|
||||
ft_table_t *table;
|
||||
const struct named_crc *iter;
|
||||
struct crc_calc crc;
|
||||
|
||||
table = ft_create_table();
|
||||
|
||||
ft_set_cell_prop(table, 0, FT_ANY_COLUMN, FT_CPROP_ROW_TYPE, FT_ROW_HEADER);
|
||||
ft_write_ln(table, "Name", "Polynomial", "Reversed", "Start Value", "Output XOR");
|
||||
ft_write_ln(table, "Name", "Polynomial", "Reversed", "Start Value", "Output XOR", "Test Value");
|
||||
|
||||
for (iter = predefined_crc_table; iter->name; iter++) {
|
||||
ft_printf_ln(table, "%s|0x%lx|%s|0x%x|0x%x",
|
||||
crc_init(&crc, &iter->settings);
|
||||
/* Calculate the test value */
|
||||
crc_push_bytes(&crc, (const uint8_t *)"123456789", 9);
|
||||
crc_finish_calc(&crc);
|
||||
ft_printf_ln(table, "%s|0x%lx|%s|0x%x|0x%x|0x%x",
|
||||
iter->name,
|
||||
iter->settings.polynomial,
|
||||
iter->settings.rev ? "yes" : "no",
|
||||
iter->settings.start_value,
|
||||
iter->settings.xor);
|
||||
iter->settings.xor,
|
||||
crc_get_value(&crc));
|
||||
crc_destroy(&crc);
|
||||
}
|
||||
|
||||
printf("%s\n", ft_to_string(table));
|
||||
|
20
src/xml.c
20
src/xml.c
@@ -30,9 +30,8 @@ int xml_write_crcs_to_file(const char *path, const struct crc_import_data *crc_d
|
||||
const struct crc_entry *entry;
|
||||
size_t index;
|
||||
|
||||
if (!path || !crc_data) {
|
||||
if (!path || !crc_data)
|
||||
return -1000;
|
||||
}
|
||||
|
||||
writer = xmlNewTextWriterFilename(path, 0);
|
||||
if (!writer) {
|
||||
@@ -67,7 +66,9 @@ int xml_write_crcs_to_file(const char *path, const struct crc_import_data *crc_d
|
||||
xmlTextWriterStartElement(writer, BAD_CAST "sections");
|
||||
|
||||
/* Output all section CRCs */
|
||||
for (entry_iter = crc_data->crc_entries, index = 0u; entry_iter; entry_iter = sl_list_next(entry_iter), index++) {
|
||||
for (entry_iter = crc_data->crc_entries, index = 0u;
|
||||
entry_iter;
|
||||
entry_iter = sl_list_next(entry_iter), index++) {
|
||||
entry = (const struct crc_entry *)entry_iter->data;
|
||||
xmlTextWriterStartElement(writer, BAD_CAST "crc");
|
||||
xmlTextWriterWriteFormatAttribute(writer, BAD_CAST "name", "%s", entry->name);
|
||||
@@ -222,7 +223,8 @@ static int convert_number_string_to_uint(const char *data, uint64_t *output)
|
||||
* @return 0 if successful
|
||||
* @return negative in case of an error
|
||||
*/
|
||||
static int get_uint64_from_xpath_content(const char *xpath, xmlXPathContextPtr xpath_ctx, uint64_t *output, bool required)
|
||||
static int get_uint64_from_xpath_content(const char *xpath, xmlXPathContextPtr xpath_ctx,
|
||||
uint64_t *output, bool required)
|
||||
{
|
||||
const char *data;
|
||||
int ret = -1;
|
||||
@@ -245,7 +247,8 @@ static int get_uint64_from_xpath_content(const char *xpath, xmlXPathContextPtr x
|
||||
* @return 0 if successful
|
||||
* @return negative in case of an error
|
||||
*/
|
||||
static int get_uint32_from_xpath_content(const char *xpath, xmlXPathContextPtr xpath_ctx, uint32_t *output, bool required)
|
||||
static int get_uint32_from_xpath_content(const char *xpath, xmlXPathContextPtr xpath_ctx,
|
||||
uint32_t *output, bool required)
|
||||
{
|
||||
const char *data;
|
||||
uint64_t tmp;
|
||||
@@ -359,10 +362,10 @@ struct crc_import_data *xml_import_from_file(const char *path)
|
||||
print_err("Error reading XML file: %s\n", path);
|
||||
goto ret_none;
|
||||
}
|
||||
|
||||
root_node = xmlDocGetRootElement(doc);
|
||||
if (!root_node) {
|
||||
if (!root_node)
|
||||
goto ret_close_doc;
|
||||
}
|
||||
|
||||
/* Validate the document */
|
||||
if (!validate_xml_doc(doc)) {
|
||||
@@ -372,9 +375,8 @@ struct crc_import_data *xml_import_from_file(const char *path)
|
||||
|
||||
/* Get xpath context */
|
||||
xpath_ctx = xmlXPathNewContext(doc);
|
||||
if (!xpath_ctx) {
|
||||
if (!xpath_ctx)
|
||||
goto ret_close_doc;
|
||||
}
|
||||
|
||||
/* Get the version number and print error in case of incompatibility. Continue either way */
|
||||
cptr = (char *)xmlGetProp(root_node, BAD_CAST "version");
|
||||
|
Reference in New Issue
Block a user