This is mvdg300.c in view mode; [Download] [Up]
#include "plplot.h" #include <stdio.h> #include <string.h> /*debug#include <limits.h>*/ struct termattr { unsigned char com[4]; unsigned char rom[4]; unsigned char ram[4]; unsigned char con[5]; unsigned char eor; } termattr; #define DGX 639 #define DGY 239 void dgsetup(xdpi,ydpi,xwid,ywid) int xwid, ywid; double xdpi, ydpi; { } void dginit() { /* Request terminal configuration report */ printf("\n\036\107\051\n"); scanf("%s",(char *)&termattr); while(getchar() != '\n') ; if(!strncmp((char *)&termattr.ram[0],"0000",4)) { printf("Please wait while graphics interpreter is downloaded.\n"); /* Need to download graphics interpreter. */ system("cat /usr/local/src/g300/g300gci110.tx"); } /* Clear screen, Set pen color to green, Absolute positioning */ printf("\036\107\063\060\n\036\107\155\061\n\036\107\151\060\n"); printf("\036\107\042\061\n"); /* set plplot stuff */ smod(1); /* interaction mode */ scol(1); /* color */ swid(1); setpxl(3.316*16,1.655*16); setphy(0,DGX*16,0,DGY*16); } void dgorient(ori) int ori; { } void dgselect(file) FILE *file; { } void dgtext() { } void dggraph() { } void dgclear() { printf("ERASE\n"); } void dgpage() { } void dgeop() { } void dgcolor(colour) int colour; { } void dgline(x1,y1,x2,y2) int x1,y1,x2,y2; { printf("LINE %d %d %d %d\n",x1>>4,y1>>3,x2>>4,y2>>3); } void dgtidy() { dgclear(); printf("\036\107\042\060\n"); fflush(stdout); } void dgwidth(width) int width; { } void dgcwin() { printf("\036\107\042\060\n"); fflush(stdout); } void dggwin() { printf("\036\107\042\061\n"); fflush(stdout); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.