init
This commit is contained in:
17
libnet/Makefile
Normal file
17
libnet/Makefile
Normal file
@@ -0,0 +1,17 @@
|
||||
LIBTARGET = libnet.a
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
CFILES = net.c netdata.c list.c mesg.c
|
||||
|
||||
OBJS = $(CFILES:.c=.o)
|
||||
|
||||
$(LIBTARGET): $(OBJS)
|
||||
-rm -f $(LIBTARGET)
|
||||
ar rv $(LIBTARGET) $(OBJS)
|
||||
$(RANLIB) $(LIBTARGET)
|
||||
|
||||
clean:
|
||||
-rm $(LIBTARGET) *.o
|
||||
tags:
|
||||
etags -t *.[ch]
|
17
libnet/Makefile.orig
Normal file
17
libnet/Makefile.orig
Normal file
@@ -0,0 +1,17 @@
|
||||
LIBTARGET = libnet.a
|
||||
|
||||
all: $(LIBTARGET)
|
||||
|
||||
CFILES = net.c netdata.c list.c mesg.c
|
||||
|
||||
OBJS = $(CFILES:.c=.o)
|
||||
|
||||
$(LIBTARGET): $(OBJS)
|
||||
-rm -f $(LIBTARGET)
|
||||
ar rv $(LIBTARGET) $(OBJS)
|
||||
$(RANLIB) $(LIBTARGET)
|
||||
|
||||
clean:
|
||||
-rm $(LIBTARGET) *.o
|
||||
tags:
|
||||
etags -t *.[ch]
|
66
libnet/collage.h
Normal file
66
libnet/collage.h
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
/* $Id: collage.h,v 1.1.1.1 1995/01/11 00:03:37 alanb Exp $ */
|
||||
|
||||
#ifndef HAS_COLLAGE_H_BEEN_INCLUDED_BEFORE
|
||||
#define HAS_COLLAGE_H_BEEN_INCLUDED_BEFORE
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#if defined __STDC__
|
||||
#ifndef FUNCPROTO
|
||||
#define FUNCPROTO
|
||||
#endif
|
||||
#define CONST const
|
||||
#define VOLATILE volatile
|
||||
#define SIGNED signed
|
||||
#else /* ! defined __STDC__ */
|
||||
#define CONST
|
||||
#define VOLATILE
|
||||
#define SIGNED
|
||||
#endif /* defined __STDC__ */
|
||||
|
||||
#ifdef FUNCPROTO
|
||||
#define AND ,
|
||||
#define PARAMS(paramlist) paramlist
|
||||
#define DEFUN(name, arglist, args) name(args)
|
||||
#define DEFUN_VOID(name) name(void)
|
||||
#else
|
||||
#define AND ;
|
||||
#define PARAMS(paramlist) ()
|
||||
#define DEFUN(name, arglist, args) name arglist args;
|
||||
#define DEFUN_VOID(name) name()
|
||||
#endif /* FUNCPROTO */
|
||||
|
||||
#ifndef MALLOC
|
||||
#if defined(SUN) && defined(LINT)
|
||||
union { char *c; void *vp } mal_r_ptr;
|
||||
# define MALLOC(SIZE) (mal_r_ptr.c = malloc(SIZE), mal_r_ptr.vp)
|
||||
#else
|
||||
# define MALLOC malloc
|
||||
#endif
|
||||
#define FREE free
|
||||
#endif /* ! MALLOC */
|
||||
|
||||
typedef union _i_or_f_ {
|
||||
int i;
|
||||
float f;
|
||||
} IntOrFloat;
|
||||
|
||||
#ifdef NOVOIDPTR
|
||||
typedef char *GenericPtr;
|
||||
#else
|
||||
typedef void *GenericPtr;
|
||||
#endif
|
||||
|
||||
#endif /* ! HAS_COLLAGE_H_BEEN_INCLUDED_BEFORE */
|
32
libnet/doodle.h
Normal file
32
libnet/doodle.h
Normal file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
/* $Id: doodle.h,v 1.1.1.1 1995/01/11 00:03:37 alanb Exp $ */
|
||||
|
||||
#ifndef HAS_DOODLE_DOT_H_BEEN_INCLUDED_BEFORE
|
||||
#define HAS_DOODLE_DOT_H_BEEN_INCLUDED_BEFORE
|
||||
|
||||
#define MAXDRAWDOODLE 10000
|
||||
|
||||
typedef struct {
|
||||
short x,y;
|
||||
} POINT;
|
||||
|
||||
typedef struct {
|
||||
POINT *doodle;
|
||||
int length;
|
||||
} charRec;
|
||||
|
||||
typedef struct DoodleColor {
|
||||
short red, green, blue;
|
||||
} DColor;
|
||||
#endif /* ! HAS_DOODLE_DOT_H_BEEN_INCLUDED_BEFORE */
|
271
libnet/list.c
Normal file
271
libnet/list.c
Normal file
@@ -0,0 +1,271 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* list.c: This module contains list manipulation routines that cunstruct
|
||||
* and maintain a linked list of data items. The record at the head of each
|
||||
* list contains pointers to the head, tail, and current list position.
|
||||
* the list itsself is doubly linked with both next and previous pointers.
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include "listP.h"
|
||||
|
||||
#ifndef MALLOC
|
||||
#define MALLOC malloc
|
||||
#define FREE free
|
||||
#endif
|
||||
|
||||
#define NIL 0
|
||||
|
||||
static void ListPrintErr(s)
|
||||
char *s;
|
||||
{
|
||||
fprintf(stderr,"%s",s);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the data located at the head of the linked list,
|
||||
* or NIL if the list is empty. As a side effect current is also set to
|
||||
* the head of the list.
|
||||
*/
|
||||
char *ListHead(theList)
|
||||
List theList;
|
||||
{
|
||||
if (!theList)
|
||||
return(NIL);
|
||||
theList->current = theList->head;
|
||||
if (theList->head)
|
||||
return(theList->head->value);
|
||||
else
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the data located at the tail of the linked list,
|
||||
* or NIL if the list is empty. As a side effect current is also set to
|
||||
* the tail of the list.
|
||||
*/
|
||||
char *ListTail(theList)
|
||||
List theList;
|
||||
{
|
||||
if (!theList)
|
||||
return(NIL);
|
||||
theList->current = theList->tail;
|
||||
if (theList->tail)
|
||||
return(theList->tail->value);
|
||||
else
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the data located at the current position in the
|
||||
* linked list, or NIL if the list is empty.
|
||||
*/
|
||||
char *ListCurrent(theList)
|
||||
List theList;
|
||||
{
|
||||
if (!theList)
|
||||
return(NIL);
|
||||
if (theList->current)
|
||||
return(theList->current->value);
|
||||
else
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the data located at the next element of the linked
|
||||
* list after the current position, or NIL if the list is empty, or you
|
||||
* are at its end.
|
||||
* As a side effect current is also set to the next entry in the list.
|
||||
*/
|
||||
char *ListNext(theList)
|
||||
List theList;
|
||||
{
|
||||
if (!theList)
|
||||
return(NIL);
|
||||
if (theList->current) {
|
||||
theList->current = theList->current->next;
|
||||
return(ListCurrent(theList));
|
||||
}
|
||||
else
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function returns the data located at the previous element of the linked
|
||||
* list before the current position, or NIL if the list is empty.
|
||||
* As a side effect current is also set to the previous entry in the list.
|
||||
*/
|
||||
char *ListPrev(theList)
|
||||
List theList;
|
||||
{
|
||||
if (!theList)
|
||||
return(NIL);
|
||||
if (theList->current) {
|
||||
theList->current = theList->current->prev;
|
||||
return(ListCurrent(theList));
|
||||
}
|
||||
else
|
||||
return(NIL);
|
||||
}
|
||||
|
||||
/*
|
||||
* Cretae a list head and initialize it to NIL.
|
||||
*/
|
||||
List ListCreate()
|
||||
{
|
||||
List retVal;
|
||||
|
||||
retVal = (List) MALLOC(sizeof(struct LISTSTRUCT));
|
||||
retVal->head = NIL;
|
||||
retVal->tail = NIL;
|
||||
retVal->current = NIL;
|
||||
return(retVal);
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroy a list head, and free all associated memory.
|
||||
*/
|
||||
void ListDestroy(theList)
|
||||
List theList;
|
||||
{
|
||||
struct LISTINSTANCE *l;
|
||||
struct LISTINSTANCE *m;
|
||||
|
||||
if (!theList)
|
||||
return;
|
||||
l = theList->head;
|
||||
while(l) {
|
||||
m = l;
|
||||
l = l->next;
|
||||
FREE(m);
|
||||
}
|
||||
FREE(theList);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Add an entry to the end of the linked list. Current is changed to point to
|
||||
* the added element.
|
||||
*/
|
||||
int ListAddEntry(theList,v)
|
||||
/* return 0 on failure */
|
||||
List theList;
|
||||
char *v; /* data to be added */
|
||||
{
|
||||
struct LISTINSTANCE *l;
|
||||
|
||||
if (!(l =(struct LISTINSTANCE *) MALLOC(sizeof(struct LISTINSTANCE)))){
|
||||
ListPrintErr("Out of Memory\n");
|
||||
return(0);
|
||||
}
|
||||
|
||||
l->value = v;
|
||||
|
||||
l->next = NIL;
|
||||
l->prev = NIL;
|
||||
|
||||
if (theList->head == NIL)
|
||||
theList->tail = theList->head = l;
|
||||
else {
|
||||
theList->tail->next = l;
|
||||
l->prev = theList->tail;
|
||||
theList->tail = l;
|
||||
}
|
||||
|
||||
theList->current = l;
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
/*
|
||||
* Search the list for an entry with a matching value field, and return
|
||||
* a pointer to that list element. Current is changed to point to the
|
||||
* element returned.
|
||||
*/
|
||||
static struct LISTINSTANCE *SearchListByValue(theList,v)
|
||||
List theList;
|
||||
char *v;
|
||||
{
|
||||
struct LISTINSTANCE *l;
|
||||
|
||||
l = theList->head;
|
||||
while (l != NIL) {
|
||||
if (l->value == v) {
|
||||
theList->current = l;
|
||||
return(l);
|
||||
}
|
||||
else {
|
||||
l = l->next;
|
||||
}
|
||||
}
|
||||
theList->current = l;
|
||||
|
||||
return(NIL);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Find the list entry with a matching value field, and delete it
|
||||
* from the list. Set current to point to the element after the deleted
|
||||
* element in the list.
|
||||
*/
|
||||
int ListDeleteEntry(theList,v)
|
||||
/* removes the first occurance of v from the list */
|
||||
/* return 0 if value not in list else 1 */
|
||||
List theList;
|
||||
char *v;
|
||||
{
|
||||
struct LISTINSTANCE *l;
|
||||
char *retV;
|
||||
|
||||
if (!(l = SearchListByValue(theList,v)))
|
||||
return(0);
|
||||
|
||||
if (l->prev)
|
||||
l->prev->next = l->next;
|
||||
else
|
||||
theList->head = l->next;
|
||||
|
||||
if (l->next)
|
||||
l->next->prev = l->prev;
|
||||
else
|
||||
theList->tail = l->prev;
|
||||
|
||||
theList->current = l->next;
|
||||
|
||||
retV = l->value;
|
||||
FREE(l);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
int ListMakeEntryCurrent(theList,entry)
|
||||
/* return 0 on failure */
|
||||
List theList;
|
||||
char *entry;
|
||||
{
|
||||
struct LISTINSTANCE *l;
|
||||
|
||||
if (theList) {
|
||||
if (!(l = SearchListByValue(theList,entry)))
|
||||
return(0);
|
||||
theList->current = l;
|
||||
return(1);
|
||||
}
|
||||
return(0);
|
||||
|
||||
}
|
27
libnet/list.h
Normal file
27
libnet/list.h
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
typedef struct LISTSTRUCT *List;
|
||||
|
||||
extern List ListCreate();
|
||||
extern void ListDestroy();
|
||||
extern int ListAddEntry();
|
||||
extern int ListDeleteEntry();
|
||||
extern int ListMakeEntryCurrent();
|
||||
|
||||
extern char *ListHead();
|
||||
extern char *ListTail();
|
||||
extern char *ListCurrent();
|
||||
extern char *ListNext();
|
||||
extern char *ListPrev();
|
33
libnet/listP.h
Normal file
33
libnet/listP.h
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ___HAS_LIST_STUFF_BEEN_INCLUDED_BEFORE___
|
||||
#define ___HAS_LIST_STUFF_BEEN_INCLUDED_BEFORE___
|
||||
|
||||
#include <stdlib.h>
|
||||
#include "list.h"
|
||||
|
||||
struct LISTINSTANCE {
|
||||
char *value;
|
||||
struct LISTINSTANCE *next;
|
||||
struct LISTINSTANCE *prev;
|
||||
};
|
||||
|
||||
struct LISTSTRUCT {
|
||||
struct LISTINSTANCE *head;
|
||||
struct LISTINSTANCE *tail;
|
||||
struct LISTINSTANCE *current;
|
||||
};
|
||||
|
||||
#endif
|
34
libnet/mesg.c
Normal file
34
libnet/mesg.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
WriteMesg(s)
|
||||
char *s;
|
||||
{
|
||||
printf("%s",s);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
WarningMesg(s)
|
||||
char *s;
|
||||
{
|
||||
fprintf(stderr,"%s",s);
|
||||
}
|
||||
|
||||
ErrMesg(s)
|
||||
char *s;
|
||||
{
|
||||
fprintf(stderr,"%s",s);
|
||||
}
|
3891
libnet/net.c
Normal file
3891
libnet/net.c
Normal file
File diff suppressed because it is too large
Load Diff
182
libnet/net.h
Normal file
182
libnet/net.h
Normal file
@@ -0,0 +1,182 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
/* $Id: net.h,v 1.1.1.1 1995/01/11 00:03:39 alanb Exp $ */
|
||||
|
||||
#include <sys/types.h>
|
||||
#include "netdata.h"
|
||||
#include "doodle.h"
|
||||
|
||||
#define PORTNAMESIZE 25
|
||||
|
||||
#define NET_UNDEF 0
|
||||
#define NET_IN 1
|
||||
#define NET_OUT 2
|
||||
|
||||
|
||||
typedef enum { NETRIS8, NETSDS, NETPAL, NETTXT, NETSRV, NETCOL, NETDTM,
|
||||
NETANIM, NETVDATA, NETSDL, NETCOM, NETEXEC, NETMSG,
|
||||
NETDOL} NetType;
|
||||
|
||||
typedef struct {
|
||||
int port;
|
||||
char portName[PORTNAMESIZE];
|
||||
char open; /*boolean*/
|
||||
int type;
|
||||
time_t queueTime;
|
||||
} NetPort;
|
||||
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
char *id;
|
||||
int selLeft; /* selection Left */
|
||||
int selRight; /* selection Right */
|
||||
int insertPt; /* insertion point */
|
||||
int numReplace; /* number to replace */
|
||||
int replaceAll; /* boolean should reaplace All text */
|
||||
int dim; /* dimensions */
|
||||
char *textString;
|
||||
} Text;
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
char *id;
|
||||
char *func;
|
||||
int selType;
|
||||
int width;
|
||||
int dim;
|
||||
struct COL_TRIPLET *data;
|
||||
} Col;
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
char *id;
|
||||
char *func;
|
||||
int selType;
|
||||
int width;
|
||||
int dim;
|
||||
short int *data;
|
||||
} Dol;
|
||||
|
||||
typedef enum { AF_NO_FUNC, AF_STOP, AF_FPLAY, AF_RPLAY
|
||||
} AnimFunc;
|
||||
|
||||
typedef enum { ART_NONE, ART_SINGLE, ART_CONT, ART_BOUNCE
|
||||
} AnimRunType;
|
||||
|
||||
typedef struct {
|
||||
char *title;
|
||||
char *id;
|
||||
AnimFunc func;
|
||||
int frameNumber;
|
||||
AnimRunType runType;
|
||||
Data *data;
|
||||
int axis;
|
||||
} AnimMesg;
|
||||
|
||||
typedef struct {
|
||||
char id[80];
|
||||
char inPort[80];
|
||||
int func;
|
||||
NetPort *netPort;
|
||||
} Server;
|
||||
|
||||
typedef struct {
|
||||
char *id;
|
||||
char *domain;
|
||||
char *mesg;
|
||||
} Com;
|
||||
|
||||
|
||||
extern void NetSetASync PARAMS((int set));
|
||||
extern int NetRegisterModule
|
||||
PARAMS((char *name, NetType netType, void (*new)(), caddr_t newData,
|
||||
void (*change)(), caddr_t changeData, void (*destroy)(),
|
||||
caddr_t destroyData));
|
||||
extern void NetDestroyPort PARAMS((NetPort *netPort));
|
||||
extern NetPort *NetCreateInPort PARAMS((char *inPortAddr));
|
||||
extern NetPort *NetCreateOutPort PARAMS((char *outPortAddr));
|
||||
extern NetPort *NetIsConnected PARAMS((void));
|
||||
extern int NetInit PARAMS((char *));
|
||||
extern void NetClientPollAndRead PARAMS((void));
|
||||
extern void NetTryResend PARAMS((void));
|
||||
extern int NetPALDistribute
|
||||
PARAMS((char *title, unsigned char *rgb, char *assoc, char *excepMod));
|
||||
extern int NetRISDistribute
|
||||
PARAMS((Data **dSend, char *exceptMod));
|
||||
extern int NetSendDisconnect
|
||||
PARAMS((NetPort *netPort, void (*cb)(), void (*failCB)()));
|
||||
extern int NetSendDoodle
|
||||
PARAMS((NetPort *netPort, char *title, long length, int width,
|
||||
POINT *doodle, DColor *color, int sendDiscrete, int doQueue,
|
||||
int distributeInternally, char *moduleName));
|
||||
extern int NetSendPointSelect
|
||||
PARAMS((NetPort *netPort, char *title, char *func, int x, int y));
|
||||
extern int NetSendLineSelect
|
||||
PARAMS((NetPort *netPort, char *ti, char *fu, int x1, int y1,
|
||||
int x2, int y2));
|
||||
extern int NetSendAreaSelect
|
||||
PARAMS((NetPort *netPort, char *ti, char *fu, int x1, int y1,
|
||||
int x2, int y2));
|
||||
extern int NetSendClearDoodle PARAMS((NetPort *netPort, char *title));
|
||||
#if 0
|
||||
extern int NetSendSetDoodle();
|
||||
extern int NetSendDoodleText();
|
||||
#endif
|
||||
extern int NetSendEraseDoodle
|
||||
PARAMS((NetPort *netPort, char *title, long length, POINT *doodle,
|
||||
int doQueue));
|
||||
extern int NetSendEraseBlockDoodle
|
||||
PARAMS((NetPort *netPort, char *title, long length, POINT *doodle));
|
||||
extern int NetSendTextSelection
|
||||
PARAMS((NetPort *netPort, char *title, int left, int right));
|
||||
extern int NetSendText
|
||||
PARAMS((NetPort *netPort, Text *t, int distributeInternally,
|
||||
char *moduleName));
|
||||
extern int NetSendPalette8
|
||||
PARAMS((NetPort *netPort, char *title, unsigned char *rgb,
|
||||
char *associated, int distributeInternally, char *moduleName));
|
||||
extern int NetSendAnimation
|
||||
PARAMS((NetPort *netPort, Data *d, int shouldCopy,
|
||||
int distributeInternally, char *moduleName));
|
||||
extern int NetSendAnimationCommand
|
||||
PARAMS((NetPort *netPort, char *title, AnimFunc command,
|
||||
AnimRunType runType, int frameNumbe));
|
||||
extern int NetSendRaster8
|
||||
PARAMS((NetPort *netPort, Data *d, int shouldCopy,
|
||||
int distributeInternally, char *moduleName));
|
||||
extern int NetSendRaster8Group
|
||||
PARAMS((NetPort *netPort, char *title, unsigned char *charDat,
|
||||
int xdim, int ydim, unsigned char *palette8, int shouldCopy,
|
||||
int distributeInternally, char *moduleName));
|
||||
extern int NetSendVData
|
||||
PARAMS((NetPort *netPort, char *label, VdataPathElement **magicPath,
|
||||
int pathLength, int nodeID, char *nodeName, char *field,
|
||||
int numRecords, int numElements, int type, char *vdata,
|
||||
int shouldCopy, int distributeInternally, char *moduleName));
|
||||
extern int NetSendDataObject
|
||||
PARAMS((NetPort *netPort, Data *d, int shouldCopy,
|
||||
int distributeInternally, char *moduleName));
|
||||
extern int NetSendCommand
|
||||
PARAMS((NetPort *netPort, char *domain, char *message, void (*cb)(),
|
||||
void (*failCB)()));
|
||||
extern int NetGetListOfUsers PARAMS((int max, char **users));
|
||||
extern int NetSendMessage
|
||||
PARAMS((NetPort *netPort, char *message, void (*cb)(), caddr_t cbData,
|
||||
void (*failCB)(), caddr_t failCBData));
|
||||
extern void NetSetTimeOut
|
||||
PARAMS((int seconds));
|
||||
extern int NetGetTimeOut PARAMS((void));
|
||||
extern void NetSetMaxAttemptsToSend
|
||||
PARAMS((int numberTries));
|
||||
extern int NetGetMaxAttemptsToSend PARAMS((void));
|
41
libnet/netP.h
Normal file
41
libnet/netP.h
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
/* $Id: netP.h,v 1.1.1.1 1995/01/11 00:03:39 alanb Exp $ */
|
||||
|
||||
|
||||
#include "net.h"
|
||||
|
||||
/****************************/
|
||||
|
||||
typedef struct {
|
||||
float load1;
|
||||
float load5;
|
||||
float load15;
|
||||
int numUsers;
|
||||
} ExecHostStatusReturn;
|
||||
|
||||
typedef union {
|
||||
ExecHostStatusReturn hsReturn;
|
||||
} ExecRetInfo;
|
||||
|
||||
typedef struct {
|
||||
char *id;
|
||||
char *retAddress;
|
||||
char *authentication;
|
||||
char *timeStamp;
|
||||
int type;
|
||||
ExecRetInfo info; /* addition info depending on type */
|
||||
} Exec;
|
||||
/****************************/
|
||||
|
||||
static void NetFreeDataCB PARAMS((GenericPtr data, caddr_t cbData));
|
137
libnet/netdata.c
Normal file
137
libnet/netdata.c
Normal file
@@ -0,0 +1,137 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
#if ! defined(lint) && ! defined(LINT)
|
||||
static char rcs_id[] = "$Id: netdata.c,v 1.1.1.1 1995/01/11 00:03:39 alanb Exp $";
|
||||
#endif
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "netdata.h"
|
||||
#include "list.h"
|
||||
|
||||
static List dataList;
|
||||
|
||||
InitData()
|
||||
{
|
||||
if (!(dataList = ListCreate()))
|
||||
return(0);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
|
||||
Data *DataNew()
|
||||
{
|
||||
Data *d;
|
||||
if (!(d = (Data *)calloc(1,sizeof(Data))))
|
||||
{
|
||||
ErrMesg("Out of Memory\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
d->label = d->associated = (char *) 0;
|
||||
d->group = (Data *) 0;
|
||||
d->magicPath = (VdataPathElement **) 0;
|
||||
d->nodeName = d->fields = (char *) 0;
|
||||
|
||||
d->expandX = d->expandY = 1.0;
|
||||
}
|
||||
|
||||
return(d);
|
||||
}
|
||||
|
||||
void DataDestroy(d)
|
||||
Data *d;
|
||||
{
|
||||
(void)ListDeleteEntry(dataList,d);
|
||||
if (d->label)
|
||||
FREE(d->label);
|
||||
if (d->data)
|
||||
FREE(d->data);
|
||||
FREE(d);
|
||||
}
|
||||
|
||||
void DataAddEntry(d)
|
||||
Data *d;
|
||||
{
|
||||
ListAddEntry(dataList,d);
|
||||
}
|
||||
|
||||
|
||||
Data *DataSearchByLabel(s)
|
||||
char *s;
|
||||
{
|
||||
Data *d;
|
||||
|
||||
d = (Data *) ListHead(dataList);
|
||||
while (d) {
|
||||
if (d->label && (!strcmp(s,d->label))) {
|
||||
return(d);
|
||||
}
|
||||
d = (Data *) ListNext(dataList);
|
||||
}
|
||||
return( (Data *) 0);
|
||||
}
|
||||
|
||||
Data *DataSearchByLabelAndDOT(s,dot)
|
||||
char *s;
|
||||
int dot; /*data object type */
|
||||
{
|
||||
Data *d;
|
||||
|
||||
d = (Data *) ListHead(dataList);
|
||||
while (d) {
|
||||
if ((d->label) && (!strcmp(s,d->label)) && (d->dot == dot)) {
|
||||
return(d);
|
||||
}
|
||||
d = (Data *) ListNext(dataList);
|
||||
}
|
||||
return( (Data *) 0);
|
||||
}
|
||||
|
||||
Data *DataSearchByLabelAndDOTAndDOST(s,dot,dost)
|
||||
char *s;
|
||||
int dot; /*data object type */
|
||||
int dost; /* data object sub type */
|
||||
{
|
||||
Data *d;
|
||||
|
||||
d = (Data *) ListHead(dataList);
|
||||
while (d) {
|
||||
if ((d->label)&&((!strcmp(s,d->label)) && (d->dot == dot)
|
||||
&& (d->dost == dost))) {
|
||||
return(d);
|
||||
}
|
||||
d = (Data *) ListNext(dataList);
|
||||
}
|
||||
return( (Data *) 0);
|
||||
}
|
||||
|
||||
int DataInList(inList)
|
||||
/* is this Data set in the list */
|
||||
Data *inList;
|
||||
{
|
||||
Data *d;
|
||||
d = (Data *) ListHead(dataList);
|
||||
while (d) {
|
||||
if (d == inList) {
|
||||
return(1);
|
||||
}
|
||||
d = (Data *) ListNext(dataList);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
|
91
libnet/netdata.h
Normal file
91
libnet/netdata.h
Normal file
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (C) 1992, Board of Trustees of the University of Illinois.
|
||||
*
|
||||
* Permission is granted to copy and distribute source with out fee.
|
||||
* Commercialization of this product requires prior licensing
|
||||
* from the National Center for Supercomputing Applications of the
|
||||
* University of Illinois. Commercialization includes the integration of this
|
||||
* code in part or whole into a product for resale. Free distribution of
|
||||
* unmodified source and use of NCSA software is not considered
|
||||
* commercialization.
|
||||
*
|
||||
*/
|
||||
/* $Id: netdata.h,v 1.1.1.1 1995/01/11 00:03:40 alanb Exp $ */
|
||||
|
||||
|
||||
#ifndef HAS_NET_DATA_DOT_H_BEEN_INCLUDED_BEFORE
|
||||
#define HAS_NET_DATA_DOT_H_BEEN_INCLUDED_BEFORE
|
||||
#include <libdtm/dtm.h>
|
||||
#include <libdtm/vdata.h>
|
||||
#include "collage.h"
|
||||
|
||||
/* Entity type */
|
||||
#define ENT_Internal 1
|
||||
#define ENT_File 2
|
||||
#define ENT_Network 3
|
||||
#define ENT_Interactive 4
|
||||
|
||||
/* Data Object Type */
|
||||
#define DOT_Unknown 100
|
||||
#define DOT_VData 101
|
||||
#define DOT_Array 102
|
||||
#define DOT_Text 103
|
||||
#define DOT_Image 104
|
||||
#define DOT_Palette8 105
|
||||
#define DOT_SDL 106
|
||||
|
||||
/* Data Object SubType */
|
||||
#define DOST_Float 200
|
||||
#define DOST_Char 201
|
||||
#define DOST_Int16 202
|
||||
#define DOST_Int32 203
|
||||
#define DOST_Double 204
|
||||
|
||||
|
||||
#define anim_axis view_type
|
||||
|
||||
#define MAX_ARRAY_DIM 50
|
||||
|
||||
/*
|
||||
defined in vdata.h
|
||||
typedef struct {
|
||||
int nodeID;
|
||||
char *nodeName;
|
||||
} VdataPathElement;
|
||||
*/
|
||||
|
||||
typedef struct DATA {
|
||||
char *label; /* data object label*/
|
||||
int entity; /* entity type */
|
||||
int dot; /* Data Object Type */
|
||||
int dost; /* Data Object Subtype */
|
||||
int dim[MAX_ARRAY_DIM]; /* array of dimensions */
|
||||
int rank; /* number of dimensions */
|
||||
GenericPtr data; /* data */
|
||||
IntOrFloat min;
|
||||
IntOrFloat max;
|
||||
int view_type;
|
||||
|
||||
VdataPathElement **magicPath; /* Vdata path */
|
||||
int pathLength; /* do we want this Marc? */
|
||||
int nodeID; /* this Vdata's ID */
|
||||
char *nodeName; /* this Vdata's name */
|
||||
char *fields; /* ? */
|
||||
|
||||
float expandX; /* expand X image */
|
||||
float expandY; /* expand Y image */
|
||||
char *associated; /* associated data */
|
||||
struct DATA *group; /* group with any */
|
||||
} Data;
|
||||
|
||||
extern Data *DataNew PARAMS((void));
|
||||
extern void DataDestroy PARAMS((Data *d));
|
||||
extern int InitData PARAMS((void));
|
||||
extern void DataAddEntry PARAMS((Data *d));
|
||||
extern Data *DataSearchByLabel PARAMS((char *s));
|
||||
extern Data *DataSearchByLabelAndDOT PARAMS((char *s, int dot));
|
||||
extern Data *DataSearchByLabelAndDOTAndDOST
|
||||
PARAMS((char *s, int dot, int dost));
|
||||
extern int DataInList PARAMS((Data *d));
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user