BSD 4_3_Net_2 development
authorCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 02:49:24 +0000 (18:49 -0800)
committerCSRG <csrg@ucbvax.Berkeley.EDU>
Fri, 22 Feb 1991 02:49:24 +0000 (18:49 -0800)
Work on file usr/src/contrib/isode/pepsy/libpepsy.3
Work on file usr/src/contrib/isode/pepsy/macdefs.h
Work on file usr/src/contrib/isode/pepsy/make
Work on file usr/src/contrib/isode/pepsy/mine.h
Work on file usr/src/contrib/isode/pepsy/mod.c
Work on file usr/src/contrib/isode/pepsy/patchlevel.h
Work on file usr/src/contrib/isode/pepsy/pass2.h

Synthesized-from: CSRG/cd2/net.2

usr/src/contrib/isode/pepsy/libpepsy.3 [new file with mode: 0644]
usr/src/contrib/isode/pepsy/macdefs.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/make [new file with mode: 0644]
usr/src/contrib/isode/pepsy/mine.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/mod.c [new file with mode: 0644]
usr/src/contrib/isode/pepsy/pass2.h [new file with mode: 0644]
usr/src/contrib/isode/pepsy/patchlevel.h [new file with mode: 0644]

diff --git a/usr/src/contrib/isode/pepsy/libpepsy.3 b/usr/src/contrib/isode/pepsy/libpepsy.3
new file mode 100644 (file)
index 0000000..86a3264
--- /dev/null
@@ -0,0 +1,35 @@
+.TH LIBPEPSY 3 "16 Oct 1987"
+.\" $Header: /f/osi/pepsy/RCS/libpepsy.3,v 7.1 91/02/22 09:49:03 mrose Interim $
+.\"
+.\"
+.\" $Log:      libpepsy.3,v $
+.\" Revision 7.1  91/02/22  09:49:03  mrose
+.\" Interim 6.8
+.\" 
+.\" Revision 7.0  90/07/01  19:54:40  mrose
+.\" *** empty log message ***
+.\" 
+.SH NAME
+libpepsy \- PEPSY support library
+.SH SYNOPSIS
+\fIpepsy\fR\0...\0\fImodule.py\fR
+.sp
+\fIcc\fR\0...\0\fImodule_tables.c\fR\0\fB\-lisode\fR
+.SH DESCRIPTION
+The \fIlibpepsy\fR library contains driver routines for processing
+the tables produced by \fIpepsy\fR.
+Also contains the tables for the ASN.1 defined types
+generated by \fIpepsy\fR and some miscellanous printing routines in
+\fIvprint.c\fR.
+This library is unspectacular but necessary.
+.SH FILES
+None
+.SH "SEE ALSO"
+pepsy(1)
+.SH DIAGNOSTICS
+Routines for users use routines return
+the manifest constant \fBNOTOK\fR (\-1) on error.
+Others return \fBNULLPE\fR on error.
+.SH AUTHOR
+Andrew Worsley,
+CSIRO and UCL
diff --git a/usr/src/contrib/isode/pepsy/macdefs.h b/usr/src/contrib/isode/pepsy/macdefs.h
new file mode 100644 (file)
index 0000000..860c132
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * common encoding macro definitions
+ */
+
+#define DO_OFFSET(parm, p)     ((parm) + (p)->pe_ucode)
+#define NO_OFFSET(parm, p)     (parm)
+
+/* various things From Pointer And Offset- *_FPAO */
+
+#define INT_FPAO(parm, p)      (*(integer *)DO_OFFSET(parm, p))
+
+#define REAL_FPAO(parm, p)     (*(double *)DO_OFFSET(parm, p))
+
+#define CHAR_FPAO(parm, p)     (*(char *)DO_OFFSET(parm, p))
+
+#define OID_FPAO(parm, p)      (*(OID *)DO_OFFSET(parm, p))
+#define SOID_FPAO(parm, p)     ((OID)NO_OFFSET(parm, p))
+
+#define PTR_FPAO(parm, p)      (*(char **)DO_OFFSET(parm, p))
+#define SPTR_FPAO(parm, p)     ((char *)NO_OFFSET(parm, p))
+
+#define QB_FPAO(parm, p)       (*(struct qbuf **)DO_OFFSET(parm, p))
+#define SQB_FPAO(parm, p)      ((struct qbuf *)NO_OFFSET(parm, p))
+
+#define PE_FPAO(parm, p)       (*(PE *)DO_OFFSET(parm, p))
+#define SPE_FPAO(parm, p)      ((PE)NO_OFFSET(parm, p)
+
+#define TYPE2MOD(mod, p)       ((mod)->md_etab[p->pe_tag])
diff --git a/usr/src/contrib/isode/pepsy/make b/usr/src/contrib/isode/pepsy/make
new file mode 100644 (file)
index 0000000..d861596
--- /dev/null
@@ -0,0 +1,7 @@
+: run this script through /bin/sh
+M=/bin/make
+if [ -f /usr/bin/make ]; then
+    M=/usr/bin/make
+fi
+
+exec $M TOPDIR=../ -f ../config/CONFIG.make -f Makefile ${1+"$@"}
diff --git a/usr/src/contrib/isode/pepsy/mine.h b/usr/src/contrib/isode/pepsy/mine.h
new file mode 100644 (file)
index 0000000..db0361d
--- /dev/null
@@ -0,0 +1,52 @@
+/* mine.h */
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/mine.h,v 7.2 91/02/22 09:49:16 mrose Interim $
+ *
+ *
+ * $Log:       mine.h,v $
+ * Revision 7.2  91/02/22  09:49:16  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.1  90/11/04  19:18:55  mrose
+ * update
+ * 
+ * Revision 7.0  90/07/01  19:54:42  mrose
+ * *** empty log message ***
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+#define TABLESIZE 29
+
+typedef struct ID_TABLE {
+       char    *h_value;
+       char    *r_value;
+       int     def_bit;
+       int     def_value;
+       int     count;
+       struct ID_TABLE *next;
+       } id_entry;
+
+typedef struct S_TABLE {
+       char    *name;
+       char    *type;
+       struct S_TABLE  *parent;
+       char    *field;
+       int     defined;
+       struct S_TABLE *next;
+       } s_table;
+
+extern id_entry        *id_table[];
+
+extern char *c_flags();
diff --git a/usr/src/contrib/isode/pepsy/mod.c b/usr/src/contrib/isode/pepsy/mod.c
new file mode 100644 (file)
index 0000000..4d4968d
--- /dev/null
@@ -0,0 +1,178 @@
+/* mod.c */
+
+#ifndef        lint
+static char *rcsid = "$Header: /f/osi/pepsy/RCS/mod.c,v 7.1 91/02/22 09:49:17 mrose Interim $";
+#endif
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/mod.c,v 7.1 91/02/22 09:49:17 mrose Interim $
+ *
+ *
+ * $Log:       mod.c,v $
+ * Revision 7.1  91/02/22  09:49:17  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.0  90/07/01  19:54:23  mrose
+ * *** empty log message ***
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+#include <stdio.h>
+#include <ctype.h>
+#include "pepsydefs.h"
+#include "pass2.h"
+
+extern char *sysin;
+extern char *proc_name();
+extern char *my_strcat();
+
+char   *calc_arg();
+
+#define MAXLENGTH 30
+
+/*
+ * output each of the actions associated with yp
+ */
+do_sw_type(name, yp, fp, fpa)
+char   *name;
+YP      yp;
+FILE   *fp;
+FILE   *fpa;
+{
+    static int curr = 0;
+    char   *s, *t;
+    char   *arg;
+
+    s = proc_name(name, 0);
+    if (yp->yp_action1) {
+       (void) fprintf(fp, "\t\tcase %s%s:\n", s, ACT1);
+       arg = calc_arg(yp, 1);
+       my_do_action(fp, yp->yp_action1, 0, arg, yp->yp_act1_lineno, yp->yp_param_type);
+       /*
+        * fprintf(fpa, "#define %s%s\t%d\n", s, ACT1, curr++);
+        */
+       (void) fprintf(fp, "\t\t\tbreak;\n");
+    }
+    if (yp->yp_action2) {
+       (void) fprintf(fp, "\t\tcase %s%s:\n", s, ACT2);
+       arg = calc_arg(yp, 2);
+       my_do_action(fp, yp->yp_action2, 0, arg, yp->yp_act2_lineno, yp->yp_param_type);
+       /*
+        * fprintf(fpa, "#define %s%s\t%d\n", s, ACT2, curr++);
+        */
+       (void) fprintf(fp, "\t\t\tbreak;\n");
+    }
+    if (yp->yp_action05) {
+       (void) fprintf(fp, "\t\tcase %s%s:\n", s, ACT05);
+       arg = calc_arg(yp, 5);
+       my_do_action(fp, yp->yp_action05, 0, arg, yp->yp_act05_lineno, yp->yp_param_type);
+       /*
+        * fprintf(fpa, "#define %s%s\t%d\n", s, ACT05, curr++);
+        */
+       (void) fprintf(fp, "\t\t\tbreak;\n");
+    }
+}
+
+my_do_action(fp, action, level, arg, lineno, new)
+FILE   *fp;
+char   *action;
+int     level;
+char   *arg;
+int     lineno;
+char   *new;
+{
+    int     i;
+    char    t[MAXLENGTH];
+    char    c, d;
+
+    (void) fprintf(fp, "%*s{\n", level * 4, "");
+    Printf(4, ("\n"));
+
+    if (*sysin)
+       (void) fprintf(fp, "# line %d \"%s\"\n", lineno, sysin);
+
+    for (d = NULL; c = *action; d = c, action++) {
+       Printf(4, ("open char is %c\n", *action));
+       for (i = 0; i < MAXLENGTH - 1 && (isalpha(*action) || *action == '_'); action++, i++)
+           t[i] = *action;
+       t[i] = '\0';
+       Printf(4, ("WORD IS %s, %c, %d\n", t, *action, i));
+       if (strcmp(t, "")) {
+           if (!strcmp(t, "parm"))
+               (void) fprintf(fp, "(%s)%s", new, "parm");
+           else
+               (void) fprintf(fp, "%s", t);
+           c = *(action - 1);
+           action--;
+           continue;
+           /*
+            * OR d = *(action - 1); c = *action;
+            */
+       }
+       switch (d) {
+       case '$':
+           if (c == '$') {
+               (void) fprintf(fp, "%s", arg);
+               c = NULL;
+               break;
+           }
+           (void) fputc('$', fp);      /* fall */
+
+       default:
+           if (c != '$')
+               (void) fputc(c, fp);
+           break;
+       }
+    }
+
+    switch (d) {
+    case '\n':
+       break;
+
+    case '$':
+       (void) fputc('$', fp);          /* fall */
+    default:
+       (void) fputc('\n', fp);
+       break;
+    }
+
+    (void) fprintf(fp, "%*s}\n", level * 4, "");
+}
+
+char   *
+calc_arg(yp, actno)
+YP      yp;
+int     actno;
+{
+
+    switch (actno) {
+    case 1:
+       return "";
+       break;
+    case 2:
+       if (yp->yp_direction & YP_ENCODER)
+           return "(pe)";
+       else
+           return "(pe)";
+       break;
+    case 5:
+       if (yp->yp_direction & YP_ENCODER)
+           return "";
+       else
+           return "(pe)";
+       break;
+    default:
+       return "";
+    }
+}
diff --git a/usr/src/contrib/isode/pepsy/pass2.h b/usr/src/contrib/isode/pepsy/pass2.h
new file mode 100644 (file)
index 0000000..9c59141
--- /dev/null
@@ -0,0 +1,154 @@
+/* pass2.h */
+
+/* 
+ * $Header: /f/osi/pepsy/RCS/pass2.h,v 7.7 91/02/22 09:49:23 mrose Interim $
+ *
+ *
+ * $Log:       pass2.h,v $
+ * Revision 7.7  91/02/22  09:49:23  mrose
+ * Interim 6.8
+ * 
+ * Revision 7.6  90/12/23  17:24:56  mrose
+ * patches
+ * 
+ * Revision 7.5  90/11/11  10:54:03  mrose
+ * update
+ * 
+ * Revision 7.4  90/11/04  19:19:01  mrose
+ * update
+ * 
+ * Revision 7.3  90/07/27  08:49:28  mrose
+ * update
+ * 
+ * Revision 7.2  90/07/09  14:52:47  mrose
+ * sync
+ * 
+ * Revision 7.1  90/07/01  20:01:13  mrose
+ * update
+ * 
+ * Revision 7.0  90/07/01  19:54:43  mrose
+ * *** empty log message ***
+ * 
+ */
+
+/*
+ *                               NOTICE
+ *
+ *    Acquisition, use, and distribution of this module and related
+ *    materials are subject to the restrictions of a license agreement.
+ *    Consult the Preface in the User's Manual for the full terms of
+ *    this agreement.
+ *
+ */
+
+
+/* Change the version number only important features change - so people can
+ * #ifdef on the version number. Also used to provide backwards compatible
+ * macro definitions for posy/pepy.
+ */
+#define PEPSY_VERSION_NUMBER   2
+#define NBPC   8       /* Number of Bits per character - machine dependant */
+#define NBPI   sizeof (int)*NBPC       /* Number of bits per integer */
+
+#define PSAP_DOT_H     "\"psap.h\""
+#define I_PSAP_DOT_H   "<isode/psap.h>"
+#define UNIV_TYPES_DOT_H       "\"UNIV-types.h\""
+#define I_UNIV_TYPES_DOT_H     "<isode/pepsy/UNIV-types.h>"
+#define        HFILE1  "_defs.h"
+#define HFILE2 "_pre_defs.h"
+#define ACTIONDEFS     "_action.h"
+
+#define GENTYPES       "-types.h"
+#define INCFILE1       "pepsy.h"
+/* #define INCFILE2    "pepdefs.h" - not used any more */
+
+#define        ACT1    "_act1"
+#define        ACT2    "_act2"
+#define        ACT3    "_act3"
+#define        ACT4    "_act4"
+#define        ACT05   "_act05"
+
+#define PREFIX "_Z"
+
+#define ETABLE "et_"
+#define DTABLE "dt_"
+#define PTABLE "pt_"
+
+#define        ENCFNCNAME      "enc_f"
+#define        DECFNCNAME      "dec_f"
+#define        PRNTFNCNAME     "prnt_f"
+
+#define        ENC_FNCNAME     "enc_f_"
+#define        DEC_FNCNAME     "dec_f_"
+#define        PRNT_FNCNAME    "prnt_f_"
+
+#define        ENCFILENAME     "_enc.c"
+#define        DECFILENAME     "_dec.c"
+#define        PRNTFILENAME    "_prnt.c"
+
+#define TBLNAME                "_tables.c"
+#define MODTYP_SUFFIX  "_mod"
+
+#define MAXPTRS                200   /* maximum number of pointers in pointer table */
+
+#define PTR_TABNAME    "ptrtab"
+extern int     p_debug;
+
+#define DEB 1
+
+#ifdef DEB
+#define Printf(x, y) if (x <= p_debug) printf y
+#else
+#define Printf(x, y)
+#endif
+
+/*
+ * info for handling a Universal type
+ */
+struct univ_typ        {
+       char    *univ_name;     /* Name of this Universal type */
+       char    *univ_data;     /* type to generate for it */
+       char    *univ_tab;      /* type of table entry it needs */
+       int     univ_id;        /* tag of the type */
+       int     univ_class;     /* class - probably Universal primative */
+       char    *univ_mod;      /* Name of its module if it has one  */
+       int     univ_flags;     /* Information about entry */
+       int     univ_type;      /* Type we can use for its contents */
+#define UNF_EXTMOD     1       /* Use an external module reference */
+#define UNF_HASDATA    2       /* Has data structure - allocate data for it */
+    };
+
+extern struct univ_typ *univtyp();
+
+/* How many entries in an array */
+#define NENTRIES(x)    (sizeof (x)/sizeof ((x)[0]))
+
+/* used to specify which tables a routine is to generate */
+#define G_ENC  0       /* encoding */
+#define G_DEC  1       /* decoding */
+#define G_PNT  2       /* printing */
+
+#define        hflag   (options[0])
+#define        Hflag   (options[1])
+#define h2flag (options[2])
+#define        NOPTIONS        3
+extern int     options[];
+
+#define STRSIZE 128    /* general buffer size */
+
+extern char   *proc_name();
+
+extern char *getfield(), *getfldbit();
+extern char *class2str();
+
+extern int     gen_ventry();   /* generate a Value Passing Entry */
+extern int     gen_fnentry();  /* generate a function calling entry */
+/* extern Action       start_action, final_action; */
+extern char    *int2tstr();    /* integer to temporary string */
+
+extern char *getfield(), *getfldbit();
+extern char *class2str();
+
+extern int     gen_ventry();   /* generate a Value Passing Entry */
+extern int     gen_fnentry();  /* generate a function calling entry */
+/* extern Action       start_action, final_action; */
diff --git a/usr/src/contrib/isode/pepsy/patchlevel.h b/usr/src/contrib/isode/pepsy/patchlevel.h
new file mode 100644 (file)
index 0000000..618bca4
--- /dev/null
@@ -0,0 +1 @@
+#define PATCHLEVEL 9