mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 08:51:19 -05:00
191a8093d0
from inspection it appears this function was really wanting to call gmtime_r() - Fortran appends a trailing _ to functions it calls, cutil.c has a bunch of shim functions that simply have the trailing _ and call the 'c' equivalent. Added gmtime_r_ -> gmtime_r shim to cutil.c This fixes the mysterious missing gmtime() seen in some compiles of Audio.so I don't see how this get_fname.F90 ever worked to produce the proper filename for the .WAV; I'd like Joe's opinion. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@314 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
88 lines
1.6 KiB
C
88 lines
1.6 KiB
C
#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>
|
|
|
|
/* 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) */
|
|
int usleep_(unsigned long *microsec)
|
|
{
|
|
return (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;
|
|
struct timezone tz;
|
|
gettimeofday(&tv,&tz);
|
|
return(tv.tv_sec+1.e-6*tv.tv_usec);
|
|
}
|