Commit 529d856e authored by Oliver Sander's avatar Oliver Sander

Merge branch 'cleanup-4' into 'master'

Remove more no longer used code

This merge request removes:
- the C++ frontend for DDD,
- several unused functions from PPIF,
- the `tools` directory which provided tools to visualize UG's metagrid format and to convert different grid formats,
- some parts of `np/algebra`,
- most remaining bits of `dev/*`, and
- `ui/fieldio.*` which was already unused.

See merge request !16
parents 493cb79a 5a083bce
Pipeline #372 passed with stage
in 2 minutes and 48 seconds
......@@ -194,7 +194,7 @@ if(UG_ENABLE_PARALLEL)
else()
set(SUBDIRS "")
endif()
set(SUBDIRS ${SUBDIRS} low dev gm dom np ui lib tools)
set(SUBDIRS ${SUBDIRS} low dev gm dom np ui lib)
set(CMAKE_INSTALL_PKGINCLUDEDIR "${CMAKE_INSTALL_INCLUDEDIR}/ug")
# create and install pkg-config information and
......
#!/bin/sh
if test "$1" = "-help"
then
echo "usage: $0";
echo "runs through all subdirectories of the current directory";
echo "purpose: exchange COORD to DOUBLE";
exit 1;
fi
if test "x$UGROOT" = "x"
then
echo "$0: to use $0 set shell environment variable UGROOT!";
exit 1;
fi
ROOTPWD=$PWD;
COORDERROR=0;
echo $0: working in dirtree $ROOTPWD;
for i in . * */* */*/* */*/*/* */*/*/*/*
do
if test -d $i -a ! -h $i
then
if test `basename $i` != "bin" -a `basename $i` != "include" -a `basename $i` != "doc" -a `basename $i` != "CVS"
then
cd $i
echo "current dir:" $i
for j in *.c *.h *.doc
do
if test "$j" != "*.c" -a "$j" != "*.h" -a "$j" != "*.doc"
then
echo "checking $j"
grep COORD $j | grep -v COORDI | grep -v COORD_VECTOR | \
grep -v COORD_
if test `grep COORD $j | grep -v COORDI |\
grep -v COORD_VECTOR | grep -v COORD_ | wc -l` -ne 0
then
echo COORD ERROR in $j;
COORDERROR=1;
fi
fi
done
cd $ROOTPWD
fi
fi
done
if test $COORDERROR -ne 0
then
echo $0 detected ERROR\(S\);
fi
......@@ -61,13 +61,6 @@ then
doctext -latex -mpath $UGROOT/doc/ug3/ug/dev -heading ug/dev/sif -quotefmt $i
done
# generate dev man pages
cd $UGROOT/dev/meta;
for i in *.c *.h
do
doctext -latex -mpath $UGROOT/doc/ug3/ug/dev -heading ug/dev/meta -quotefmt $i
done
# generate dev man pages
cd $UGROOT/dev/ps;
for i in *.c *.h
......
......@@ -111,7 +111,6 @@ then
cd dev;
ugmkdir xif;
ugmkdir sif;
ugmkdir meta;
ugmkdir ps;
cd ..;
ugmkdir dom;
......
#!/bin/sh
if test "$1" = "-help"
then
echo "usage: $0";
echo "runs through all subdirectories of the current directory";
echo "purpose: exchange COORD to DOUBLE";
exit 1;
fi
if test "x$UGROOT" = "x"
then
echo "$0: to use $0 set shell environment variable UGROOT!";
exit 1;
fi
sed 's/typedef COORD COORD_VECTOR/typedef KOORD KOORD_VECTOR/g' $UGROOT/gm/gm.h > $UGROOT/gm/gm.h.tmp
mv $UGROOT/gm/gm.h.tmp $UGROOT/gm/gm.h
sed 's/typedef COORD COORD_VECTOR/typedef KOORD KOORD_VECTOR/g' $UGROOT/gm/gm.h > $UGROOT/gm/gm.h.tmp
mv $UGROOT/gm/gm.h.tmp $UGROOT/gm/gm.h
sed 's/COORD/KOORD/g' $UGROOT/arch/compiler.h > $UGROOT/arch/compiler.h.tmp
mv $UGROOT/arch/compiler.h.tmp $UGROOT/arch/compiler.h
ROOTPWD=$PWD;
echo $0: working in dirtree $ROOTPWD;
for i in . * */* */*/* */*/*/* */*/*/*/*
do
if test -d $i -a ! -h $i
then
if test `basename $i` != "bin" -a `basename $i` != "include" -a `basename $i` != "doc" -a `basename $i` != "CVS"
then
cd $i
echo "current dir:" $i
for j in *.c *.h *.doc
do
if test "$j" != "*.c" -a "$j" != "*.h" -a "$j" != "*.doc"
then
echo "substituting in $j"
sed 's/COORDI/KOORDI/g' $j > $j.tmp
sed 's/COORD_VECTOR/DOUBLE_VECTOR/g' $j.tmp > $j
sed 's/COORD_/KOORD_/g' $j > $j.tmp
sed 's/COORD/DOUBLE/g' $j.tmp > $j
sed 's/KOORD/COORD/g' $j > $j.tmp
mv $j.tmp $j
fi
done
cd $ROOTPWD
fi
fi
done
sed 's/typedef KOORD KOORD_VECTOR/typedef COORD COORD_VECTOR/g' $UGROOT/gm/gm.h > $UGROOT/gm/gm.h.tmp
mv $UGROOT/gm/gm.h.tmp $UGROOT/gm/gm.h
sed 's/KOORD/COORD/g' $UGROOT/arch/compiler.h > $UGROOT/arch/compiler.h.tmp
mv $UGROOT/arch/compiler.h.tmp $UGROOT/arch/compiler.h
echo "now recompile"
# The libs from these directories are needed for devices
#add_subdirectory(meta)
#add_subdirectory(ps)
set(SOURCES ugdevices.cc sockcomm.cc
meta/metafile.cc)
set(SOURCES ugdevices.cc)
set(devinclude_HEADERS ugdevices.h)
add_library(devices OBJECT ${SOURCES})
# We need a unique name for the object library that will become libdevS
# later in lib
add_library(devSif OBJECT sif/sif.cc)
if(DUNE_BUILD_BOTH_LIBS)
# For shared libraries we need position independent code
set_property(TARGET devices devSif PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif()
add_library(devR ${SOURCES} rif/remote.cc)
install(FILES ${devinclude_HEADERS} DESTINATION ${CMAKE_INSTALL_PKGINCLUDEDIR})
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/** \defgroup dev Devices
* \ingroup ug
*/
/****************************************************************************/
/* */
/* File: initdev.h */
/* */
/* Purpose: contains definitions of init functions of all devices */
/* */
/* Author: Peter Bastian */
/* Institut fuer Computeranwendungen III */
/* Universitaet Stuttgart */
/* Pfaffenwaldring 27 */
/* 70569 Stuttgart */
/* email: ug@ica3.uni-stuttgart.de */
/* */
/* History: 16.12.94 restructured for ug version 3.0 */
/* */
/* Remarks: */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* auto include mechanism and other include files */
/* */
/****************************************************************************/
#ifndef __INITDEV__
#define __INITDEV__
#include "ugtypes.h"
#include "ugdevices.h"
#include "namespace.h"
START_UG_NAMESPACE
/****************************************************************************/
/* */
/* init and exit functions called internally by ugdevices.c */
/* */
/****************************************************************************/
/* the screen device (same name for Mac, X11 and Remote!) */
OUTPUTDEVICE *InitScreen (int *argcp, char **argv, INT *error);
void ExitScreen (void);
/* metafile device */
INT InitMeta (void);
/* metafile device */
INT InitPostScript (void);
/* metafile device */
INT InitPostScriptBW (void);
END_UG_NAMESPACE
#endif
Makefile
Makefile.in
.deps
.libs
*.lo
*.la
*.o
semantic.cache
This diff is collapsed.
Makefile
Makefile.in
.deps
.libs
*.lo
*.la
*.o
semantic.cache
This diff is collapsed.
Makefile
Makefile.in
.deps
.libs
*.lo
*.la
*.o
semantic.cache
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/****************************************************************************/
/* */
/* File: sif.c */
/* */
/* Purpose: standard interface for ug */
/* */
/* Author: Peter Bastian */
/* Institut fuer Computeranwendungen III */
/* Universitaet Stuttgart */
/* Pfaffenwaldring 27 */
/* 70569 Stuttgart */
/* */
/* History: 22 Sep 95 begin, ug31 */
/* */
/* Remarks: */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* include files */
/* system include files */
/* application include files */
/* */
/****************************************************************************/
/* standard C includes */
#include <config.h>
#include <cstring>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <cstdio>
#include <cassert>
/* interface includes */
#include "ugtypes.h"
#include "ugdevices.h"
#include "initdev.h"
#include "general.h"
USING_UG_NAMESPACE
/****************************************************************************/
/* */
/* defines in the following order */
/* */
/* compile time constants defining static data size (i.e. arrays) */
/* other constants */
/* macros */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* definition of variables global to this source file only (static!) */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* export global variables */
/* */
/****************************************************************************/
/****************************************************************************/
/* */
/* export global variables per function call */
/* */
/****************************************************************************/
/****************************************************************************/
/*
GetScreenSize - Return sreen size
SYNOPSIS:
INT GetScreenSize (INT size[2]);
PARAMETERS:
. size[2] - pointer to the size of screen
RETURN VALUE:
INT
.n 0 if ok
.n 1 if error occured.
*/
/****************************************************************************/
INT NS_PREFIX GetScreenSize (INT size[2])
{
size[0] = 0;
size[1] = 0;
return (0);
}
/****************************************************************************/
/*
GUI_GetNextEvent - Process an event from the system and pass it to ug
SYNOPSIS:
INT GetNextUGEvent (EVENT *theEvent, INT EventMask);
PARAMETERS:
. theEvent - pointer to ug event
. EventMask - determines which events are reported
DESCRIPTION:
This function processes an event from the system and passes it to ug if necessary.
Here we only return the string event.
RETURN VALUE:
INT
.n 0 if no event occurred (ug or system)
.n 1 if an event occurred (ug or system).
*/
/****************************************************************************/
INT NS_PREFIX GetNextUGEvent (EVENT *theEvent, INT EventMask)
{
char *s;
int cmdKey, onlyCmdKey;
/* no event as default */
theEvent->Type = NO_EVENT;
theEvent->NoEvent.InterfaceEvent = 0;
/* we have no command keys */
if (EventMask==TERM_CMDKEY) return(0);
/* read in a string from the user and store it in event structure */
fgets(theEvent->TermString.String,INPUTBUFFERLEN,stdin);
theEvent->Type = TERM_STRING;
/* ready */
return(0);
}
/****************************************************************************/
/*
InitScreen - Init rest of GUI and return pointer to screen outputdevice
SYNOPSIS:
OUTPUTDEVICE *InitScreen (int *argcp, char **argv, INT *error);
PARAMETERS:
. argcp - pointer to argument counter
. argv - argument vector
. error - errorcode
DESCRIPTION:
Simply return NULL, since we do not have graphics capability.
RETURN VALUE:
OUTPUTDEVICE *
.n POINTER if all is o.k.
.n NULL if an error occurred.
*/
/****************************************************************************/
OUTPUTDEVICE * NS_PREFIX InitScreen (int *argcp, char **argv, INT *error)
{
*error=0;
return(NULL);
}
void NS_PREFIX ExitScreen (void)
{}
/****************************************************************************/
/*
WriteString - write a string to a terminal window
SYNOPSIS:
void WriteString (const char *s);
PARAMETERS:
. s - string to write
DESCRIPTION:
This function writes a string to a terminal window. Simply map it
to printf().
RETURN VALUE:
void
*/
/****************************************************************************/
void NS_PREFIX WriteString (const char *s)
{
printf("%s",s);
return;
}
/****************************************************************************/
/*
MousePosition - Get current mouse position
SYNOPSIS:
void MousePosition (INT *ScreenPoint);
PARAMETERS:
. ScreenPoint - return result in this vector
DESCRIPTION:
This function gets current mouse position.
RETURN VALUE:
void
*/
/****************************************************************************/
void NS_PREFIX MousePosition (INT *ScreenPoint)
{
return;
}
/****************************************************************************/
/*
MouseStillDown - Determine if mouse button is still pressed
SYNOPSIS:
INT MouseStillDown (void);
PARAMETERS:
no parameters
DESCRIPTION:
This function returns true (1) if the mouse button is still pressed.
The function should only be called after a button pressed event has been
reported.
RETURN VALUE:
INT
.n 0 if mouse button has been released
.n 1 if mouse button is still pressed
*/
/****************************************************************************/
INT NS_PREFIX MouseStillDown (void)
{
return (0);
}
void NS_PREFIX DrawInfoBox (WINDOWID win, const char *info)
{
return;
}
INT NS_PREFIX WhichTool (WINDOWID win, const INT mouse[2], INT *tool)
{
return (0);
}
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
/****************************************************************************/
/* */
/* File: sockcomm.c */
/* */
/* Purpose: routines and examples for berkeley socket usage */
/* */
/* Author: Klaus Birken */
/* Institut fuer Computeranwendungen III */
/* Universitaet Stuttgart */
/* Pfaffenwaldring 27 */
/* 70569 Stuttgart */
/* internet: birken@ica3.uni-stuttgart.de */
/* */
/* History: 960820 kb begin */
/* */
/* Remarks: some of these routines have been copied from */
/* W.R. Stevens, Unix Network Programming, Prentice Hall */
/* */
/****************************************************************************/
#ifdef RIF_SOCKETS
/****************************************************************************/
/* */
/* auto include mechanism and other include files */
/* */
/****************************************************************************/
#include <config.h>
#include "ugtypes.h"
#include "general.h"
#include "sockcomm.h"
/****************************************************************************/
/****************************************************************************/
char *cmd_text[] =
{
"nn",
"InitScreen",
"WriteString",
"GetNextUGEvent",
"MousePosition",
"MouseStillDown",
"InitRemotePort",
"OpenOutput",
"CloseOutput",
"ActivateOutput",
"UpdateOutput",
"Move",
"Draw",
"Polyline",
"InversePolyline",
"Polygon",
"InversePolygon",
"ErasePolygon",
"Polymark",
"InvPolymark",
"Text",
"CenteredText",
"ClearViewPort",
"SetLineWidth",
"SetTextSize",
"SetMarkerSize",
"SetMarker",
"SetColor",
"SetPaletteEntry",
"SetNewPalette",
"GetPaletteEntry",
"Flush"
};
/****************************************************************************/
/* */
/* subroutines */
/* */
/****************************************************************************/
/****************************************************************************/
/* read n bytes from stream socket */
int SocketRead (int fd, char *ptr, int nbytes)
{
int nleft, nread;
nleft = nbytes;
while (nleft>0)
{
nread = read(fd, ptr, nleft);
if (nread<0)
return(nread); /* error, return <0 */
else if (nread==0)
break; /* EOF */
nleft -= nread;
ptr += nread;
}
return(nbytes-nleft); /* return >=0 */
}
/****************************************************************************/
/* write n bytes to a stream socket */
int SocketWrite (int fd, char *ptr, int nbytes)
{
int nleft, nwritten;
nleft = nbytes;
while (nleft>0)
{
nwritten = write(fd, ptr, nleft);
if (nwritten<=0)
return(nwritten); /* error */
nleft -= nwritten;
ptr += nwritten;
}
return(nbytes-nleft);
}
/****************************************************************************/
/* read a line from a descriptor */
int SocketReadString (int fd, char *ptr, int maxlen)
{
int n, rc;
char c;
for(n=1; n<maxlen; n++)
{
if ((rc=read(fd, &c, 1)) ==1)
{
*ptr++ = c;
if (c=='\n')
break;
}
else if (rc==0)
{
if (n==1)
return(0); /* EOF, no data read */
else
break; /* EOF, some data was read */
}
else
return(-1); /* error */
}
*ptr = 0;
return(n);
}
/****************************************************************************/
void SocketWriteCmd (int sockfd, int cmd)
{
if (write(sockfd, (char *)&cmd, sizeof(int)) < 0)
{
fprintf(stderr, "ug: write error on socket.\n");
}
}
void SocketWriteINT (int sockfd, INT val)
{
if (write(sockfd, (char *)&val, sizeof(val)) < 0)
{
fprintf(stderr, "ug: write error on socket.\n");
}
}