Added BIN_TYPE
authorewt <devnull@localhost>
Wed, 13 Dec 1995 22:38:23 +0000 (22:38 +0000)
committerewt <devnull@localhost>
Wed, 13 Dec 1995 22:38:23 +0000 (22:38 +0000)
CVS patchset: 34
CVS date: 1995/12/13 22:38:23

lib/header.c
lib/header.h

index 215c441..f7cbe45 100644 (file)
@@ -203,6 +203,7 @@ void dumpHeader(Header h, FILE * f, int flags)
        switch (ntohl(p->type)) {
            case NULL_TYPE:     type = "NULL_TYPE";     break;
            case CHAR_TYPE:     type = "CHAR_TYPE";     break;
+           case BIN_TYPE:      type = "BIN_TYPE";      break;
            case INT8_TYPE:     type = "INT8_TYPE";     break;
            case INT16_TYPE:    type = "INT16_TYPE";    break;
            case INT32_TYPE:    type = "INT32_TYPE";    break;
@@ -287,6 +288,8 @@ void dumpHeader(Header h, FILE * f, int flags)
                    dp += sizeof(int_8);
                }
                break;
+           case BIN_TYPE:
+               break;
            case CHAR_TYPE:
                while (c--) {
                    ch = (char) *((char *) dp);
@@ -350,6 +353,7 @@ int getEntry(Header h, int_32 tag, int_32 * type, void **p, int_32 * c)
     case INT32_TYPE:
     case INT16_TYPE:
     case INT8_TYPE:
+    case BIN_TYPE:
     case CHAR_TYPE:
        *p = h->data + ntohl(index->offset);
        break;
@@ -449,6 +453,7 @@ int addEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c)
     case INT8_TYPE:
        length = sizeof(int_8) * c;
        break;
+    case BIN_TYPE:
     case CHAR_TYPE:
        length = sizeof(char) * c;
        break;
@@ -499,6 +504,7 @@ int addEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c)
        }
        break;
       case INT8_TYPE:
+      case BIN_TYPE:
       case CHAR_TYPE:
        memcpy(ptr, p, length);
        break;
index 50e8c5c..40aeb05 100644 (file)
@@ -58,5 +58,6 @@ int addEntry(Header h, int_32 tag, int_32 type, void *p, int_32 c);
 #define INT32_TYPE 4
 #define INT64_TYPE 5
 #define STRING_TYPE 6
+#define BIN_TYPE 7
 
 #endif _header_h