|
DataMuseum.dkPresents historical artifacts from the history of: DKUUG/EUUG Conference tapes |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about DKUUG/EUUG Conference tapes Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - downloadIndex: T g
Length: 2290 (0x8f2) Types: TextFile Names: »gp-dos.c«
└─⟦a05ed705a⟧ Bits:30007078 DKUUG GNU 2/12/89 └─⟦ff23ba0e6⟧ »./ghostscript-1.3.tar.Z« └─⟦a24a58cd3⟧ └─⟦this⟧ »gp-dos.c«
/* Copyright (C) 1989 Aladdin Enterprises. All rights reserved. Distributed by Free Software Foundation, Inc. This file is part of Ghostscript. Ghostscript is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. No author or distributor accepts responsibility to anyone for the consequences of using it or for whether it serves any particular purpose or works at all, unless he says so in writing. Refer to the Ghostscript General Public License for full details. Everyone is granted permission to copy, modify and redistribute Ghostscript, but only under the conditions described in the Ghostscript General Public License. A copy of this license is supposed to have been given to you along with Ghostscript so you can know your rights and responsibilities. It should be in a file named COPYING. Among other things, the copyright notice and this notice must be preserved on all copies. */ /* gp-dos.c */ /* DOS-specific routines for Ghostscript */ #define interrupt /* non-ANSI! */ #include <dos.h> #include <fcntl.h> #include "gx.h" #include "gsmatrix.h" /* for gxdevice.h */ #include "gxdevice.h" typedef struct gx_device_s gx_device; /* Define the default device */ extern gx_device ega_device; gx_device *gp_default_device_p = &ega_device; char *gs_default_device_name = "EGA"; /* Do platform-dependent interpreter initialization */ void gp_init() { _fmode = O_BINARY; /* Open files in 'binary' mode */ } /* Read the current date (in days since Jan. 1, 1980) */ /* and time (in milliseconds since midnight). */ void gs_get_clock(long *pdt) { struct date osdate; struct time ostime; long idate, itime; static int mstart[12] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 }; getdate(&osdate); gettime(&ostime); idate = (long)osdate.da_year * 365 + osdate.da_year / 4 + 1 + /* account for leap years */ mstart[osdate.da_mon - 1] + /* month is 1-origin */ osdate.da_day - 1; /* day of month is 1-origin */ if ( osdate.da_mon <= 2 && osdate.da_year % 4 == 0 ) /* Jan. or Feb. of leap year */ idate--; pdt[0] = idate; itime = ostime.ti_hour; itime = itime * 60 + ostime.ti_min; itime = itime * 60 + ostime.ti_sec; itime = itime * 100 + ostime.ti_hund; itime = itime * 10; /* milliseconds */ pdt[1] = itime; }