Add TRANSIENT field support.
authorNot Zed <notzed@gmail.com>
Mon, 30 Jan 2023 00:17:17 +0000 (10:47 +1030)
committerNot Zed <notzed@gmail.com>
Mon, 30 Jan 2023 00:17:17 +0000 (10:47 +1030)
ez-blob-basic.c

index 9378577..8149eea 100644 (file)
@@ -17,6 +17,7 @@
    <http://www.gnu.org/licenses/>.
 */
 
+#include <stdio.h>
 #include <stdlib.h>
 #include <stdint.h>
 #include <string.h>
@@ -83,6 +84,8 @@ size_t ez_basic_size(const ez_blob_desc *desc, const void *p) {
                        else
                                abort();
                        break;
+               case EZ_BLOB_TRANSIENTP:
+                       break;
                default:
                        abort();
                }
@@ -150,8 +153,12 @@ int ez_basic_decode_raw(const ez_blob_desc *desc, const ez_blob *blob, void *p)
                                }
                        } else
                                abort();
+                       break;
+               case EZ_BLOB_TRANSIENTP:
+                       *(void **)v = NULL;
                        break;
                default:
+                       fprintf(stderr, "unknown type code: %02x\n", d->bd_type);
                        abort();
                }
        }
@@ -235,6 +242,8 @@ int ez_basic_encode_raw(const ez_blob_desc *desc, const void *p, ez_blob *blob)
                        } else
                                abort();
                        break;
+               case EZ_BLOB_TRANSIENTP:
+                       break;
                default:
                        abort();
                }