dnl IR toolkit for tcl/tk
dnl (c) Index Data 1995
dnl See the file LICENSE for details.
-dnl $Id: configure.in,v 1.9 1995-08-28 12:21:21 adam Exp $
+dnl $Id: configure.in,v 1.10 1995-09-20 11:37:01 adam Exp $
AC_INIT(ir-tcl.h)
CC=${CC-cc}
AC_SUBST(CC)
AC_CHECK_FUNC(gethostbyname, , AC_CHECK_LIB(nsl, main, [LIBS="$LIBS -lnsl"]))
AC_STDC_HEADERS
AC_SUBST(TCLLIB)
-AC_CHECK_LIB(tcl, Tcl_Eval, tclFound=1, tclFound=0, -lm)
-if test "$tclFound" = 1; then
- TCLLIB=-ltcl
-elif test -r /usr/local/lib/libtcl7.4.a; then
- TCLLIB=/usr/local/lib/libtcl7.4.a
-else
- TCLLIB=/usr/local/lib/libtcl.a
-fi
+AC_SUBST(TKLIB)
+AC_SUBST(TCLINCLUDE)
+TCLLIB=-ltcl
+TKLIB=-ltk
+TCLINCLUDE=" # -I.. Tcl/Tk include path"
+for i in .a 7.4.a 7.5.a; do
+ if test -r /usr/local/lib/libtcl$i; then
+ TCLLIB=/usr/local/lib/libtcl$i
+ TCLINCLUDE=-I/usr/local/include
+ fi
+done
+for i in .a 4.0.a 4.1.a; do
+ if test -r /usr/local/lib/libtk$i; then
+ TKLIB=/usr/local/lib/libtk$i
+ fi
+done
AC_SUBST(YAZDIR)
AC_SUBST(MOSI)
AC_SUBST(MOSILIB)
XLIBSW=-lX11
fi
AC_SUBST(XLIBSW)
-AC_SUBST(TKLIB)
-AC_CHECK_LIB(tk, main, tkFound=1, tkFound=0, $TCLLIB $XLIBSW -lm)
-if test "$tkFound" = 1; then
- TKLIB=-ltk
-elif test -r /usr/local/lib/libtk4.0.a; then
- TKLIB=/usr/local/lib/libtk4.0.a
-else
- TKLIB=/usr/local/lib/libtk.a
-fi
AC_OUTPUT(Makefile)
* Sebastian Hammer, Adam Dickmeiss
*
* $Log: grs.c,v $
- * Revision 1.1 1995-08-29 15:38:34 adam
+ * Revision 1.2 1995-09-20 11:37:01 adam
+ * Configure searches for tk4.1 and tk7.5.
+ * Work on GRS.
+ *
+ * Revision 1.1 1995/08/29 15:38:34 adam
* Added grs.c. new version.
*
*/
ir_tcl_strdup (NULL, &e->tagVal.str, t->tagValue->u.string);
e->dataWhich = t->content->which;
- if (t->content->which == Z_ElementData_subtree)
- ir_tcl_read_grs (t->content->u.subtree, &e->tagData.sub);
- else if (t->content->which == Z_ElementData_string)
+ switch (t->content->which)
+ {
+ case Z_ElementData_octets:
+ e->tagData.octets.len = t->content->u.octets->len;
+ e->tagData.octets.buf = ir_tcl_malloc (t->content->u.octets->len);
+ memcpy (e->tagData.octets.buf, t->content->u.octets->buf,
+ t->content->u.octets->len);
+ break;
+ case Z_ElementData_numeric:
+ e->tagData.num = *t->content->u.numeric;
+ break;
+ case Z_ElementData_date:
ir_tcl_strdup (NULL, &e->tagData.str, t->content->u.string);
+ break;
+ case Z_ElementData_ext:
+ break;
+ case Z_ElementData_string:
+ ir_tcl_strdup (NULL, &e->tagData.str, t->content->u.string);
+ break;
+ case Z_ElementData_trueOrFalse:
+ e->tagData.bool = *t->content->u.trueOrFalse;
+ break;
+ case Z_ElementData_oid:
+ break;
+ case Z_ElementData_intUnit:
+ break;
+ case Z_ElementData_elementNotThere:
+ case Z_ElementData_elementEmpty:
+ case Z_ElementData_noDataRequested:
+ break;
+ case Z_ElementData_diagnostic:
+ break;
+ case Z_ElementData_subtree:
+ ir_tcl_read_grs (t->content->u.subtree, &e->tagData.sub);
+ break;
+ }
}
}
if (argno >= argc)
{
- Tcl_AppendResult (interp, "{ ", NULL);
-
for (i = 0; i<grs_record->noTags; i++, e++)
{
if (e->tagWhich == Z_StringOrNumeric_numeric)
{
- Tcl_AppendElement (interp, "N");
+ Tcl_AppendResult (interp, " numeric ", NULL);
sprintf (tmpbuf, "%d", e->tagVal.num);
Tcl_AppendElement (interp, tmpbuf);
}
else
{
- Tcl_AppendResult (interp, " S ", NULL);
+ Tcl_AppendResult (interp, " string ", NULL);
Tcl_AppendElement (interp, e->tagVal.str);
}
- if (e->dataWhich == Z_ElementData_subtree)
+ switch (e->dataWhich)
{
- Tcl_AppendResult (interp, " R ", NULL);
+ case Z_ElementData_octets:
+ Tcl_AppendResult (interp, " octets {} ", NULL);
+ break;
+ case Z_ElementData_numeric:
+ Tcl_AppendResult (interp, " numeric {} ", NULL);
+ break;
+ case Z_ElementData_date:
+ Tcl_AppendResult (interp, " date {} ", NULL);
+ break;
+ case Z_ElementData_ext:
+ Tcl_AppendResult (interp, " ext {} ", NULL);
+ break;
+ case Z_ElementData_string:
+ Tcl_AppendResult (interp, " string ", NULL);
+ Tcl_AppendElement (interp, e->tagData.str );
+ break;
+ case Z_ElementData_trueOrFalse:
+ Tcl_AppendResult (interp, " bool ",
+ e->tagData.bool ? "1" : "0", " ", NULL);
+ break;
+ case Z_ElementData_oid:
+ Tcl_AppendResult (interp, " oid {} ", NULL);
+ break;
+ case Z_ElementData_intUnit:
+ Tcl_AppendResult (interp, " intUnit {} ", NULL);
+ break;
+ case Z_ElementData_elementNotThere:
+ Tcl_AppendResult (interp, " notThere {} ", NULL);
+ break;
+ case Z_ElementData_elementEmpty:
+ Tcl_AppendResult (interp, " empty {} ", NULL);
+ break;
+ case Z_ElementData_noDataRequested:
+ Tcl_AppendResult (interp, " notRequested {} ", NULL);
+ break;
+ case Z_ElementData_diagnostic:
+ Tcl_AppendResult (interp, " diagnostic {} ", NULL);
+ break;
+ case Z_ElementData_subtree:
+ Tcl_AppendResult (interp, " subtree { ", NULL);
ir_tcl_get_grs_r (interp, e->tagData.sub, argc, argv, argno+1);
+ Tcl_AppendResult (interp, " } ", NULL);
+ break;
}
- else
- {
- Tcl_AppendElement (interp, "S");
- if (e->tagData.str)
- Tcl_AppendElement (interp, e->tagData.str );
- else
- Tcl_AppendResult (interp, " {} ", NULL);
- }
- Tcl_AppendResult (interp, " }", NULL);
+ Tcl_AppendResult (interp, " } ", NULL);
}
}
return TCL_OK;