aboutsummaryrefslogtreecommitdiffstats
path: root/skeletons
diff options
context:
space:
mode:
authorvlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2006-08-18 02:27:55 +0000
committervlm <vlm@59561ff5-6e30-0410-9f3c-9617f08c8826>2006-08-18 02:27:55 +0000
commit1fcf759bf5baacc72320d407ca651aa49d63eb76 (patch)
tree0b8e91f7da38399fa1aa3a7607e17a83441043b8 /skeletons
parent6e98eaf2a81c8590e9f94cc0082e3f3e349dab7c (diff)
*** empty log message ***
git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@1132 59561ff5-6e30-0410-9f3c-9617f08c8826
Diffstat (limited to 'skeletons')
-rw-r--r--skeletons/constr_SEQUENCE.c6
-rw-r--r--skeletons/per_decoder.h21
-rw-r--r--skeletons/per_support.h68
3 files changed, 48 insertions, 47 deletions
diff --git a/skeletons/constr_SEQUENCE.c b/skeletons/constr_SEQUENCE.c
index 5b240070..9b7dcf32 100644
--- a/skeletons/constr_SEQUENCE.c
+++ b/skeletons/constr_SEQUENCE.c
@@ -1180,12 +1180,14 @@ SEQUENCE_encode_uper(asn_TYPE_descriptor_t *td,
/* Encode a presence bitmap */
for(i = 0; i < specs->roms_count; i++) {
+ asn_TYPE_member_t *elm;
void *memb_ptr; /* Pointer to the member */
void **memb_ptr2; /* Pointer to that pointer */
- edx = specs->oms[i];
- asn_TYPE_member_t *elm = &td->elements[edx];
int present;
+ edx = specs->oms[i];
+ elm = &td->elements[edx];
+
/* Fetch the pointer to this member */
if(elm->flags & ATF_POINTER) {
memb_ptr2 = (void **)((char *)sptr + elm->memb_offset);
diff --git a/skeletons/per_decoder.h b/skeletons/per_decoder.h
index 97eef147..27fe064f 100644
--- a/skeletons/per_decoder.h
+++ b/skeletons/per_decoder.h
@@ -26,27 +26,6 @@ asn_dec_rval_t uper_decode(struct asn_codec_ctx_s *opt_codec_ctx,
/*
- * Pre-computed PER constraints.
- */
- enum asn_per_constraint_flags {
- APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
- APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
- APC_CONSTRAINED = 0x2, /* Fully constrained */
- APC_EXTENSIBLE = 0x4 /* May have extension */
- };
-typedef struct asn_per_constraint_s {
- enum asn_per_constraint_flags flags;
- int range_bits; /* Full number of bits in the range */
- int effective_bits; /* Effective bits */
- long lower_bound; /* "lb" value */
- long upper_bound; /* "ub" value */
-} asn_per_constraint_t;
-typedef struct asn_per_constraints_s {
- asn_per_constraint_t value;
- asn_per_constraint_t size;
-} asn_per_constraints_t;
-
-/*
* Type of the type-specific PER decoder function.
*/
typedef asn_dec_rval_t (per_type_decoder_f)(asn_codec_ctx_t *opt_codec_ctx,
diff --git a/skeletons/per_support.h b/skeletons/per_support.h
index 747abe27..7e5e5940 100644
--- a/skeletons/per_support.h
+++ b/skeletons/per_support.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2005 Lev Walkin <vlm@lionet.info>. All rights reserved.
+ * Copyright (c) 2005, 2006 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#ifndef _PER_SUPPORT_H_
@@ -12,6 +12,26 @@ extern "C" {
#endif
/*
+ * Pre-computed PER constraints.
+ */
+typedef struct asn_per_constraint_s {
+ enum asn_per_constraint_flags {
+ APC_UNCONSTRAINED = 0x0, /* No PER visible constraints */
+ APC_SEMI_CONSTRAINED = 0x1, /* Constrained at "lb" */
+ APC_CONSTRAINED = 0x2, /* Fully constrained */
+ APC_EXTENSIBLE = 0x4 /* May have extension */
+ } flags;
+ int range_bits; /* Full number of bits in the range */
+ int effective_bits; /* Effective bits */
+ long lower_bound; /* "lb" value */
+ long upper_bound; /* "ub" value */
+} asn_per_constraint_t;
+typedef struct asn_per_constraints_s {
+ asn_per_constraint_t value;
+ asn_per_constraint_t size;
+} asn_per_constraints_t;
+
+/*
* This structure describes a position inside an incoming PER bit stream.
*/
typedef struct asn_per_data_s {
@@ -21,27 +41,12 @@ typedef struct asn_per_data_s {
} asn_per_data_t;
/*
- * This structure supports forming PER output.
- */
-typedef struct asn_per_outp_s {
- uint8_t *buffer; /* Pointer into the (tmpspace) */
- size_t nboff; /* Bit offset to the meaningful bit */
- size_t nbits; /* Number of bits left in (tmpspace) */
- uint8_t tmpspace[32]; /* Preliminary storage to hold data */
- int (*outper)(const void *data, size_t size, void *op_key);
- void *op_key;
-} asn_per_outp_t;
-
-/*
* Extract a small number of bits (<= 31) from the specified PER data pointer.
* This function returns -1 if the specified number of bits could not be
* extracted due to EOD or other conditions.
*/
int32_t per_get_few_bits(asn_per_data_t *per_data, int get_nbits);
-/* Output a small number of bits (<= 31) */
-int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
-
/*
* Extract a large number of bits from the specified PER data pointer.
* This function returns -1 if the specified number of bits could not be
@@ -50,9 +55,6 @@ int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
int per_get_many_bits(asn_per_data_t *pd, uint8_t *dst, int right_align,
int get_nbits);
-/* Output a large number of bits */
-int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
-
/*
* Get the length "n" from the Unaligned PER stream.
*/
@@ -61,6 +63,29 @@ ssize_t uper_get_length(asn_per_data_t *pd,
int *repeat);
/*
+ * Get the normally small non-negative whole number.
+ */
+ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
+
+/*
+ * This structure supports forming PER output.
+ */
+typedef struct asn_per_outp_s {
+ uint8_t *buffer; /* Pointer into the (tmpspace) */
+ size_t nboff; /* Bit offset to the meaningful bit */
+ size_t nbits; /* Number of bits left in (tmpspace) */
+ uint8_t tmpspace[32]; /* Preliminary storage to hold data */
+ int (*outper)(const void *data, size_t size, void *op_key);
+ void *op_key;
+} asn_per_outp_t;
+
+/* Output a small number of bits (<= 31) */
+int per_put_few_bits(asn_per_outp_t *per_data, uint32_t bits, int obits);
+
+/* Output a large number of bits */
+int per_put_many_bits(asn_per_outp_t *po, const uint8_t *src, int put_nbits);
+
+/*
* Put the length "n" to the Unaligned PER stream.
* This function returns the number of units which may be flushed
* in the next units saving iteration.
@@ -68,11 +93,6 @@ ssize_t uper_get_length(asn_per_data_t *pd,
ssize_t uper_put_length(asn_per_outp_t *po, size_t whole_length);
/*
- * Get the normally small non-negative whole number.
- */
-ssize_t uper_get_nsnnwn(asn_per_data_t *pd);
-
-/*
* Put the normally small non-negative whole number.
*/
int uper_put_nsnnwn(asn_per_outp_t *po, int n);