Commit 140cdbec authored by Mark's avatar Mark Committed by Mouse

converter-example output JER to console

The list of formats that are text output is a hardcoded list that didn't
include JER
parent 67b7788c
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* Generic converter template for a selected ASN.1 type. * Generic converter template for a selected ASN.1 type.
* Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>. * Copyright (c) 2005-2017 Lev Walkin <vlm@lionet.info>.
* All rights reserved. * All rights reserved.
* *
* To compile with your own ASN.1 type, redefine the PDU as shown: * To compile with your own ASN.1 type, redefine the PDU as shown:
* *
* cc -DPDU=MyCustomType -o myDecoder.o -c converter-example.c * cc -DPDU=MyCustomType -o myDecoder.o -c converter-example.c
*/ */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
...@@ -130,7 +130,7 @@ ats_simple_name(enum asn_transfer_syntax syntax) { ...@@ -130,7 +130,7 @@ ats_simple_name(enum asn_transfer_syntax syntax) {
return "PER"; return "PER";
case ATS_ALIGNED_BASIC_PER: case ATS_ALIGNED_BASIC_PER:
case ATS_ALIGNED_CANONICAL_PER: case ATS_ALIGNED_CANONICAL_PER:
return "APER"; return "APER";
default: default:
return "<?>"; return "<?>";
} }
...@@ -431,7 +431,8 @@ main(int ac, char *av[]) { ...@@ -431,7 +431,8 @@ main(int ac, char *av[]) {
if(isatty(1)) { if(isatty(1)) {
const int is_text_output = osyntax == ATS_NONSTANDARD_PLAINTEXT const int is_text_output = osyntax == ATS_NONSTANDARD_PLAINTEXT
|| osyntax == ATS_BASIC_XER || osyntax == ATS_BASIC_XER
|| osyntax == ATS_CANONICAL_XER; || osyntax == ATS_CANONICAL_XER
|| osyntax == ATS_BASIC_JER;
if(is_text_output) { if(is_text_output) {
binary_out = stdout; binary_out = stdout;
} else { } else {
...@@ -608,7 +609,7 @@ buffer_shift_left(size_t offset, int bits) { ...@@ -608,7 +609,7 @@ buffer_shift_left(size_t offset, int bits) {
uint8_t *ptr = DynamicBuffer.data + DynamicBuffer.offset + offset; uint8_t *ptr = DynamicBuffer.data + DynamicBuffer.offset + offset;
uint8_t *end = DynamicBuffer.data + DynamicBuffer.offset uint8_t *end = DynamicBuffer.data + DynamicBuffer.offset
+ DynamicBuffer.length - 1; + DynamicBuffer.length - 1;
if(!bits) return; if(!bits) return;
DEBUG("Shifting left %d bits off %ld (o=%ld, u=%ld, l=%ld)", DEBUG("Shifting left %d bits off %ld (o=%ld, u=%ld, l=%ld)",
...@@ -782,7 +783,7 @@ data_decode_from_file(enum asn_transfer_syntax isyntax, asn_TYPE_descriptor_t *p ...@@ -782,7 +783,7 @@ data_decode_from_file(enum asn_transfer_syntax isyntax, asn_TYPE_descriptor_t *p
asn_codec_ctx_t *opt_codec_ctx = 0; asn_codec_ctx_t *opt_codec_ctx = 0;
void *structure = 0; void *structure = 0;
asn_dec_rval_t rval; asn_dec_rval_t rval;
size_t old_offset; size_t old_offset;
size_t new_offset; size_t new_offset;
int tolerate_eof; int tolerate_eof;
size_t rd; size_t rd;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment