diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /map65/libm65/cutil.c | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'map65/libm65/cutil.c')
| -rwxr-xr-x | map65/libm65/cutil.c | 186 |
1 files changed, 93 insertions, 93 deletions
diff --git a/map65/libm65/cutil.c b/map65/libm65/cutil.c index 69a526b0..dda7d6ba 100755 --- a/map65/libm65/cutil.c +++ b/map65/libm65/cutil.c @@ -1,93 +1,93 @@ -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <sys/types.h> -#include <sys/stat.h> -#include <fcntl.h> -// #include <sys/times.h> -// #include <time.h> -// #include <sys/time.h> -#include "sleep.h" -#include "timeval.h" - -/* FORTRAN: fd = close(filedes) */ -int close_(int *filedes) -{ -return(close(*filedes)); -} -/* FORTRAN: fd = open(filnam,mode) */ -int open_(char filnam[], int *mode) -{ - return(open(filnam,*mode)); -} -/* FORTRAN: fd = creat(filnam,mode) */ -int creat_(char filnam[],int *mode) -{ - return(creat(filnam,*mode)); -} -/* FORTRAN: nread = read(fd,buf,n) */ -int read_(int *fd, char buf[], int *n) -{ - return(read(*fd,buf,*n)); -} -/* FORTRAN: nwrt = write(fd,buf,n) */ -int write_(int *fd, char buf[], int *n) -{ - return(write(*fd,buf,*n)); -} -/* FORTRAN: ns = lseek(fd,offset,origin) */ -int lseek_(int *fd,int *offset, int *origin) -{ - return(lseek(*fd,*offset,*origin)); -} -/* times(2) */ -//int times_(struct tms *buf) -//{ -// return (times(buf)); -//} -/* ioperm(2) */ -//ioperm_(from,num,turn_on) -//unsigned long *from,*num,*turn_on; -//{ -// return (ioperm(*from,*num,*turn_on)); -// return (i386_get_ioperm(*from,*num,*turn_on)); -//} - -/* usleep(3) */ -void usleep_(unsigned long *microsec) -{ - usleep(*microsec); -} - -/* returns random numbers between 0 and 32767 to FORTRAN program */ -int iran_(int *arg) -{ - return (rand()); -} - -int exit_(int *n) -{ - printf("\n\n"); - exit(*n); -} - -/* -struct tm * -gmtime_r_(const time_t *clock, struct tm *result) -{ - gmtime_r(clock, result); -} -*/ - -time_t time_(void) -{ - return time(0); -} - -/* hrtime() */ -double hrtime_(void) -{ - struct timeval tv; - gettimeofday(&tv,NULL); - return(tv.tv_sec+1.e-6*tv.tv_usec); -} +#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+// #include <sys/times.h>
+// #include <time.h>
+// #include <sys/time.h>
+#include "sleep.h"
+#include "timeval.h"
+
+/* FORTRAN: fd = close(filedes) */
+int close_(int *filedes)
+{
+return(close(*filedes));
+}
+/* FORTRAN: fd = open(filnam,mode) */
+int open_(char filnam[], int *mode)
+{
+ return(open(filnam,*mode));
+}
+/* FORTRAN: fd = creat(filnam,mode) */
+int creat_(char filnam[],int *mode)
+{
+ return(creat(filnam,*mode));
+}
+/* FORTRAN: nread = read(fd,buf,n) */
+int read_(int *fd, char buf[], int *n)
+{
+ return(read(*fd,buf,*n));
+}
+/* FORTRAN: nwrt = write(fd,buf,n) */
+int write_(int *fd, char buf[], int *n)
+{
+ return(write(*fd,buf,*n));
+}
+/* FORTRAN: ns = lseek(fd,offset,origin) */
+int lseek_(int *fd,int *offset, int *origin)
+{
+ return(lseek(*fd,*offset,*origin));
+}
+/* times(2) */
+//int times_(struct tms *buf)
+//{
+// return (times(buf));
+//}
+/* ioperm(2) */
+//ioperm_(from,num,turn_on)
+//unsigned long *from,*num,*turn_on;
+//{
+// return (ioperm(*from,*num,*turn_on));
+// return (i386_get_ioperm(*from,*num,*turn_on));
+//}
+
+/* usleep(3) */
+void usleep_(unsigned long *microsec)
+{
+ usleep(*microsec);
+}
+
+/* returns random numbers between 0 and 32767 to FORTRAN program */
+int iran_(int *arg)
+{
+ return (rand());
+}
+
+int exit_(int *n)
+{
+ printf("\n\n");
+ exit(*n);
+}
+
+/*
+struct tm *
+gmtime_r_(const time_t *clock, struct tm *result)
+{
+ gmtime_r(clock, result);
+}
+*/
+
+time_t time_(void)
+{
+ return time(0);
+}
+
+/* hrtime() */
+double hrtime_(void)
+{
+ struct timeval tv;
+ gettimeofday(&tv,NULL);
+ return(tv.tv_sec+1.e-6*tv.tv_usec);
+}
|
