]> git.stg.codes - stg.git/blobdiff - libs/smux/constr_TYPE.c
Update README.
[stg.git] / libs / smux / constr_TYPE.c
index 4bc88d44f3c54131da0696b60050bd26376ce5b4..aefaefdb718a315c68ec88f0ebcc49a4912d8b77 100644 (file)
@@ -17,7 +17,7 @@ static asn_app_consume_bytes_f _print2fp;
  * Return the outmost tag of the type.
  */
 ber_tlv_tag_t
-asn_TYPE_outmost_tag(asn_TYPE_descriptor_t *type_descriptor,
+asn_TYPE_outmost_tag(const asn_TYPE_descriptor_t *type_descriptor,
                const void *struct_ptr, int tag_mode, ber_tlv_tag_t tag) {
 
        if(tag_mode)
@@ -26,29 +26,32 @@ asn_TYPE_outmost_tag(asn_TYPE_descriptor_t *type_descriptor,
        if(type_descriptor->tags_count)
                return type_descriptor->tags[0];
 
-       return type_descriptor->outmost_tag(type_descriptor, struct_ptr, 0, 0);
+       return type_descriptor->op->outmost_tag(type_descriptor, struct_ptr, 0, 0);
 }
 
 /*
  * Print the target language's structure in human readable form.
  */
 int
-asn_fprint(FILE *stream, asn_TYPE_descriptor_t *td, const void *struct_ptr) {
-       if(!stream) stream = stdout;
-       if(!td || !struct_ptr) {
-               errno = EINVAL;
-               return -1;
+asn_fprint(FILE *stream, const asn_TYPE_descriptor_t *td,
+           const void *struct_ptr) {
+    if(!stream) stream = stdout;
+    if(!td || !struct_ptr) {
+        errno = EINVAL;
+        return -1;
        }
 
        /* Invoke type-specific printer */
-       if(td->print_struct(td, struct_ptr, 1, _print2fp, stream))
-               return -1;
+    if(td->op->print_struct(td, struct_ptr, 1, _print2fp, stream)) {
+        return -1;
+    }
 
-       /* Terminate the output */
-       if(_print2fp("\n", 1, stream))
-               return -1;
+    /* Terminate the output */
+    if(_print2fp("\n", 1, stream)) {
+        return -1;
+    }
 
-       return fflush(stream);
+    return fflush(stream);
 }
 
 /* Dump the data into the specified stdio stream */