#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+#ifdef _WIN32
+#include <io.h>
+#else
#include <sys/types.h>
+#include <unistd.h>
+#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
#define FCGI_stdout stdout
#define FCGI_stderr stderr
#define logstream stderr
-#endif //SERVER
+#endif /*SERVER*/
targetlist_param_t * gene_targetlist()
{
target->jptstream = isJPTfeasible( *jp2idx);
target->next=NULL;
- if( targetlist->first) // there are one or more entries
+ if( targetlist->first) /* there are one or more entries*/
targetlist->last->next = target;
- else // first entry
+ else /* first entry*/
targetlist->first = target;
targetlist->last = target;
int fd;
char *data;
- // download remote target file to local storage
+ /* download remote target file to local storage*/
if( strncmp( filepath, "http://", 7) == 0){
if( (fd = open_remotefile( filepath, tmpfname)) == -1)
return -1;
return -1;
}
}
- // Check resource is a JP family file.
+ /* Check resource is a JP family file.*/
if( lseek( fd, 0, SEEK_SET)==-1){
close(fd);
fprintf( FCGI_stdout, "Reason: Target %s broken (lseek error)\r\n", filepath);
return -1;
}
- data = (char *)malloc( 12); // size of header
+ data = (char *)malloc( 12); /* size of header*/
if( read( fd, data, 12) != 12){
free( data);
int open_remotefile( char filepath[], char tmpfname[])
{
#ifndef SERVER
-
+ (void)filepath;
+ (void)tmpfname;
fprintf( FCGI_stderr, "Remote file can not be opened in local mode\n");
return -1;
curl_easy_cleanup(curl_handle);
return fd;
-#endif //SERVER
+#endif /*SERVER*/
}
#ifdef SERVER
return written;
}
-#endif //SERVER
+#endif /*SERVER*/