]> andersk Git - moira.git/blobdiff - gdb/gdb_stype.c
don't flame about being unable to delete filesystem if the `propagate
[moira.git] / gdb / gdb_stype.c
index fd4f0e85eabc60e95c262a442786a67e9bc4ceec..b47257c07ce0dc17da9ee372eea741e4c4e4cf8b 100644 (file)
@@ -5,75 +5,54 @@
 
 #ifndef lint
 static char *rcsid_gdb_stype_c = "$Header$";
-#endif lint
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/************************************************************************/
-/*     
-/*                        gdb_stype.c
-/*     
-/*           GDB - System Data Type Definitions
-/*     
-/*     Author: Noah Mendelsohn
-/*     Copyright: 1986 MIT Project Athena 
-/*             For copying and distribution information, please see
-/*             the file <mit-copyright.h>.
-/*     
-/*     This file initializes the definitions for all system defined
-/*     data types, and it includes the type specific semantic routines
-/*     for each of the system defined types.
-/*     
-/*     The initialization routine which adds these type definitions 
-/*     to the type definition table is at the end of this source file.
-/*     
-/************************************************************************/
-/*     
-/*     This file is organized into one section for each system
-/*     defined type followed at the end by a final section which
-/*     initializes the type tables.  Each of the type specific
-/*     sections does #defines for each type specific parameter.  The
-/*     gdb_i_stype initialization routine at the end of this source
-/*     file uses these defines to initialize the appropriate entry in
-/*     the type definition tables.
-/*     
-/*     NOTE: some of the type definitions in this file may be machine
-/*     dependent.
-/*     
-/************************************************************************/
+#endif
+
+
+/************************************************************************
+ *     
+ *                        gdb_stype.c
+ *     
+ *           GDB - System Data Type Definitions
+ *     
+ *     Author: Noah Mendelsohn
+ *     Copyright: 1986 MIT Project Athena 
+ *             For copying and distribution information, please see
+ *             the file <mit-copyright.h>.
+ *     
+ *     This file initializes the definitions for all system defined
+ *     data types, and it includes the type specific semantic routines
+ *     for each of the system defined types.
+ *     
+ *     The initialization routine which adds these type definitions 
+ *     to the type definition table is at the end of this source file.
+ *     
+ ************************************************************************
+ *     
+ *     This file is organized into one section for each system
+ *     defined type followed at the end by a final section which
+ *     initializes the type tables.  Each of the type specific
+ *     sections does #defines for each type specific parameter.  The
+ *     gdb_i_stype initialization routine at the end of this source
+ *     file uses these defines to initialize the appropriate entry in
+ *     the type definition tables.
+ *     
+ *     NOTE: some of the type definitions in this file may be machine
+ *     dependent.
+ *     
+ ************************************************************************/
 
 #include <mit-copyright.h>
 #include <stdio.h>
-#include <strings.h>
+#include <string.h>
 #include "gdb.h"
-#ifdef vax                     /* XXX */
-       extern u_long ntohl(), htonl();
-#endif vax
 #include <netinet/in.h>                                /* for htonl routine */
-\f
-/************************************************************************/
-/*     
-/*                          INTEGER_T
-/*     
-/************************************************************************/
+
+
+/************************************************************************
+ *     
+ *                          INTEGER_T
+ *     
+ ************************************************************************/
 
 #define IN_LEN                 (sizeof(int))
 #define IN_ALI                 IN_LEN
@@ -113,6 +92,7 @@ char *dp;                                    /* pointer to the data */
        /*----------------------------------------------------------*/
 
 
+/*ARGSUSED*/
 int
 g_in_cdlen(dp,hcon)
 char *dp;                                      /* pointer to the data */
@@ -129,7 +109,8 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_in_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -139,7 +120,7 @@ char *outp;                                 /* place to put the output */
        register char *op = outp;
        register char *endp = outp+IN_EXTERNSIZE;
 
-       unsigned long converted;                /* the integer goes here */
+       uint32 converted;                       /* the integer goes here */
                                                /* in network byte order*/
 
        /*
@@ -147,7 +128,7 @@ char *outp;                                 /* place to put the output */
         * account for the fact that the RT has trouble with unaligned longs
         */
 
-       converted = htonl(*(u_long *)dp);
+       converted = htonl(*(uint32 *)dp);
 
        cp = (char *)&converted;
        *op++ = *cp++;
@@ -155,7 +136,7 @@ char *outp;                                 /* place to put the output */
        *op++ = *cp++;
        *op++ = *cp++;
 
-       return (int)(endp);                     /* return pointer to next */
+       return endp;                            /* return pointer to next */
                                                /* unused output byte*/
 }
 
@@ -169,7 +150,8 @@ char *outp;                                 /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_in_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -194,7 +176,7 @@ char *outp;                                 /* place to put the output */
         */
 
        *(int *)outp = ntohl((u_long)buffer);
-       return (int)(ip);
+       return ip;
 }
 
        /*----------------------------------------------------------*/
@@ -213,7 +195,8 @@ char *dp;                                   /* pointer to the data */
 {
        fprintf(gdb_log, "INTEGER_T\t%s=%d\n",name,(*(int *)dp));
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          STRING_T
@@ -221,7 +204,7 @@ char *dp;                                   /* pointer to the data */
 /************************************************************************/
 
 #define ST_LEN                 (sizeof(STRING))
-#define ST_ALI                 (sizeof(int))
+#define ST_ALI                 (sizeof(char *))
 #define ST_NULL        g_st_null
 #define ST_CDLEN       g_st_cdlen
 #define ST_ENC                 g_st_enc
@@ -279,7 +262,7 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_st_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -301,10 +284,10 @@ char *outp;                                       /* place to put the output */
         * Now, copy the data itself after the encoded integer length
         */
        if (len > 0)
-               bcopy(STRING_DATA(*stp), nextp, len);
+               memcpy(nextp, STRING_DATA(*stp), len);
                                                /* copy the data without */
                                                /* changing representation*/
-       return (int)(nextp+len);
+       return nextp+len;
 }
 
        /*----------------------------------------------------------*/
@@ -323,7 +306,7 @@ char *outp;                                 /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_st_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to input data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -349,7 +332,7 @@ char *outp;                                 /* place to put the output */
        if (len == 0) {
                STRING_DATA(*stp) = NULL;
                MAX_STRING_SIZE(*stp) = 0;
-               return (int)(nextp);
+               return nextp;
        }
        (void) string_alloc(stp, len);          /* this sets string length */
                                                /* in addition to doing the */
@@ -358,9 +341,9 @@ char *outp;                                 /* place to put the output */
        /*
         * Now, copy the data itself 
         */
-       bcopy(nextp, STRING_DATA(*stp), len);   /* copy the data without */
+       memcpy(STRING_DATA(*stp), nextp, len);  /* copy the data without */
                                                /* changing representation*/
-       return (int)(nextp+len);
+       return nextp+len;
 }
 
        /*----------------------------------------------------------*/
@@ -399,7 +382,8 @@ char *dp;                                   /* pointer to the data */
 
        fprintf(gdb_log,"\"\n");
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          REAL_T
@@ -444,6 +428,7 @@ char *dp;                                   /* pointer to the data */
        /*----------------------------------------------------------*/
 
 
+/*ARGSUSED*/
 int
 g_rl_cdlen(dp,hcon)
 char *dp;                                      /* pointer to the data */
@@ -460,7 +445,8 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_rl_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -488,7 +474,7 @@ char *outp;                                 /* place to put the output */
        while (cp < endp)
                *cp++ = ' ';                    /* pad to desired length */
 
-       return (int)(outp+RL_EXTERNSIZE);       /* return pointer to next */
+       return outp+RL_EXTERNSIZE;              /* return pointer to next */
                                                /* unused output byte*/
 }
 
@@ -500,14 +486,15 @@ char *outp;                                       /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_rl_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
 char *outp;                                    /* place to put the output */
 {
        (void) sscanf(inp,"%30le", (double *)outp);
-       return (int)(inp+RL_EXTERNSIZE);
+       return inp+RL_EXTERNSIZE;
 }
 
        /*----------------------------------------------------------*/
@@ -526,7 +513,8 @@ char *dp;                                   /* pointer to the data */
 {
        fprintf(gdb_log, "REAL_T\t\t%s=%le\n",name,*((double *)dp) );
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          DATE_T
@@ -577,6 +565,7 @@ char *dp;                                   /* pointer to the data */
        /*----------------------------------------------------------*/
 
 
+/*ARGSUSED*/
 int
 g_dt_cdlen(dp,hcon)
 char *dp;                                      /* pointer to the data */
@@ -593,7 +582,8 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_dt_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -610,7 +600,7 @@ char *outp;                                 /* place to put the output */
        while (op < endp)
                *op++ = *ip++;                  /* pad to desired length */
 
-       return (int)(endp);                     /* return pointer to next */
+       return endp;                            /* return pointer to next */
                                                /* unused output byte*/
 }
 
@@ -622,7 +612,8 @@ char *outp;                                 /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+/*ARGSUSED*/
+char *
 g_dt_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -639,7 +630,7 @@ char *outp;                                 /* place to put the output */
        while (op < endp)
                *op++ = *ip++;                  /* pad to desired length */
 
-       return (int)(endp);                     /* return pointer to next */
+       return endp;                            /* return pointer to next */
                                                /* unused output byte*/
 }
 
@@ -659,11 +650,12 @@ char *dp;                                 /* pointer to the data */
 {
        char buf[DT_EXTERNSIZE+1];
 
-       bcopy(dp, buf, DT_EXTERNSIZE);          /* copy date to buffer */
+       memcpy(buf, dp, DT_EXTERNSIZE);         /* copy date to buffer */
        buf[DT_EXTERNSIZE] = '\0';              /* null terminate it */
        fprintf(gdb_log, "DATE_T\t\t%s=%s\n",name,buf);
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          TUPLE_DESCRIPTOR_T
@@ -752,7 +744,7 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_tpd_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -790,10 +782,10 @@ char *outp;                                       /* place to put the output */
        /*
         * Finally, copy all the null terminated strings.
         */
-       bcopy(((char *)(tdp))+gdb_descriptor_length(tdp->field_count), 
-             nextp, tdp->str_len);             /* copy the string data all */
+       memcpy(nextp,((char *)(tdp))+gdb_descriptor_length(tdp->field_count), 
+              tdp->str_len);           /* copy the string data all */
                                                /* at once */
-       return (int)(nextp+tdp->str_len);
+       return nextp+tdp->str_len;
 }
 
        /*----------------------------------------------------------*/
@@ -814,7 +806,7 @@ char *outp;                                 /* place to put the output */
 
 #define GDB_MAX_DECODED_FIELDS 100
 
-int
+char *
 g_tpd_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to input data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -888,7 +880,7 @@ char *outp;                                 /* place to put the output */
         */
        *tdp = create_tuple_descriptor(field_count, field_names, field_types);
 
-       return (int)nextn;
+       return nextn;
 }
 
        /*----------------------------------------------------------*/
@@ -938,7 +930,8 @@ char *dp;                                   /* pointer to the data */
        }
        fprintf(gdb_log,"\n");
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          TUPLE_T
@@ -1037,7 +1030,7 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_tp_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1072,7 +1065,7 @@ char *outp;                                       /* place to put the output */
                           (FIELD_FROM_TUPLE(tup, i),hcon, op);
        }
        
-       return (int)op;
+       return op;
 }
 
        /*----------------------------------------------------------*/
@@ -1089,7 +1082,7 @@ char *outp;                                       /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_tp_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to input data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1137,7 +1130,7 @@ char *outp;                                       /* place to put the output */
        *((TUPLE *)outp) = tup;                 /* put the new tuple */
                                                /* pointer where the */
                                                /* caller wants it */
-       return (int)ip;
+       return ip;
 }
 
        /*----------------------------------------------------------*/
@@ -1192,7 +1185,8 @@ char *dp;                                 /* pointer to the data */
        
        fprintf(gdb_log,"END_OF_TUPLE\n");
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          TUPLE_DATA_T
@@ -1326,7 +1320,7 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_tdt_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1359,7 +1353,7 @@ char *outp;                                       /* place to put the output */
                           (FIELD_FROM_TUPLE(tup, i),hcon, op);
        }
        
-       return (int)op;
+       return op;
 }
 
        /*----------------------------------------------------------*/
@@ -1373,7 +1367,7 @@ char *outp;                                       /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_tdt_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to input data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1406,7 +1400,7 @@ char *outp;                                       /* place to put the output */
                           (FIELD_FROM_TUPLE(tup, i),hcon, ip);
        }
        
-       return (int)ip;
+       return ip;
 }
 
        /*----------------------------------------------------------*/
@@ -1465,7 +1459,8 @@ char *dp;                                 /* pointer to the data */
        
        fprintf(gdb_log,"END_OF_TUPLE\n");
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*                          RELATION_T
@@ -1577,7 +1572,7 @@ HALF_CONNECTION hcon;
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_rel_enc(dp, hcon, outp)
 char *dp;                                      /* pointer to data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1628,7 +1623,7 @@ char *outp;                                       /* place to put the output */
             t = NEXT_TUPLE_IN_RELATION(rel,t))
                op = (char *)g_tdt_enc((char *)t, hcon, op);
        
-       return (int)op;
+       return op;
 }
 
        /*----------------------------------------------------------*/
@@ -1647,7 +1642,7 @@ char *outp;                                       /* place to put the output */
        /*      
        /*----------------------------------------------------------*/
 
-int
+char *
 g_rel_dec(outp, hcon, inp)
 char *inp;                                     /* pointer to input data */
 HALF_CONNECTION hcon;                          /* connection descriptor */
@@ -1706,7 +1701,7 @@ char *outp;                                       /* place to put the output */
 
        *((RELATION *)outp) = rel;
 
-       return (int)ip;
+       return ip;
 }
 
        /*----------------------------------------------------------*/
@@ -1757,7 +1752,8 @@ char *dp;                                 /* pointer to the data */
        
        fprintf(gdb_log,"END_OF_RELATION\n");
 }
-\f
+
+
 /************************************************************************/
 /*     
 /*        DECLARE AND INITIALIZE THE SYSTEM TYPE DEFINITION 
@@ -1784,8 +1780,8 @@ char *dp;                                 /* pointer to the data */
        g_type_table[inx][ALIGNMENT_PROPERTY].i = ap; \
        g_type_table[inx][NULL_PROPERTY].f = np; \
        g_type_table[inx][CODED_LENGTH_PROPERTY].f = clp; \
-       g_type_table[inx][ENCODE_PROPERTY].f = ep; \
-       g_type_table[inx][DECODE_PROPERTY].f = dp; \
+       g_type_table[inx][ENCODE_PROPERTY].cpf = ep; \
+       g_type_table[inx][DECODE_PROPERTY].cpf = dp; \
        g_type_table[inx][FORMAT_PROPERTY].f = fp; \
        g_type_table[inx][NAME_PROPERTY].cp = name; \
 }
This page took 0.061272 seconds and 4 git commands to generate.