Remove unistd.h from win32 compilation

This commit is contained in:
Mathieu Malaterre 2012-01-30 09:51:32 +00:00
parent ec0c69af7a
commit 326c58b4e1
2 changed files with 29 additions and 24 deletions

View File

@ -34,40 +34,40 @@
#include "bool.h" #include "bool.h"
//! maximum number of meta request box /** maximum number of meta request box */
#define MAX_NUMOFBOX 10 #define MAX_NUMOFBOX 10
//! cnew aux transport name /** cnew aux transport name */
typedef enum cnew_transport { non, http, tcp, udp} cnew_transport_t; typedef enum cnew_transport { non, http, tcp, udp} cnew_transport_t;
//! image return type /** image return type */
typedef enum image_return { JPPstream, JPTstream, UNKNOWN=-1} image_return_t; typedef enum image_return { JPPstream, JPTstream, UNKNOWN=-1} image_return_t;
//! Query parameters /** Query parameters */
typedef struct query_param{ typedef struct query_param{
char *target; //!< target name char *target; /**< target name */
char *tid; //!< target identifier char *tid; /**< target identifier */
int fx, fy; //!< frame size (fx,fy) int fx, fy; /**< frame size (fx,fy) */
int rx, ry, rw, rh; //!< roi region int rx, ry, rw, rh; /**< roi region */
int layers; //!< quality layers int layers; /**< quality layers */
int lastcomp; //!< last component number int lastcomp; /**< last component number */
bool *comps; //!< components (dynamic array) for jpp-stream, null means all components bool *comps; /**< components (dynamic array) for jpp-stream, null means all components */
char *cid; //!< channel identifier char *cid; /**< channel identifier */
cnew_transport_t cnew; //!< transport name if there is new channel request, else non cnew_transport_t cnew; /**< transport name if there is new channel request, else non */
char *cclose; //!< list of closing channel identifiers, separated by '\0' char *cclose; /**< list of closing channel identifiers, separated by '\0' */
int numOfcclose; //!< number of closing channels int numOfcclose; /**< number of closing channels */
char box_type[MAX_NUMOFBOX][4]; //!< interested box-types char box_type[MAX_NUMOFBOX][4]; /**< interested box-types */
int limit[MAX_NUMOFBOX]; //!< limit value, -1: skeleton request "r", 0: entire contents int limit[MAX_NUMOFBOX]; /**< limit value, -1: skeleton request "r", 0: entire contents */
bool w[MAX_NUMOFBOX]; //!< Metadata request qualifier flags bool w[MAX_NUMOFBOX]; /**< Metadata request qualifier flags */
bool s[MAX_NUMOFBOX]; bool s[MAX_NUMOFBOX];
bool g[MAX_NUMOFBOX]; bool g[MAX_NUMOFBOX];
bool a[MAX_NUMOFBOX]; bool a[MAX_NUMOFBOX];
bool priority[MAX_NUMOFBOX]; //!< priority flag bool priority[MAX_NUMOFBOX]; /**< priority flag */
int root_bin; //!< root-bin int root_bin; /**< root-bin */
int max_depth; //!< max-depth int max_depth; /**< max-depth */
bool metadata_only; //!< metadata-only request bool metadata_only; /**< metadata-only request */
image_return_t return_type; //!< image return type image_return_t return_type; /**< image return type */
int len; //!< maximum response length int len; /**< maximum response length */
} query_param_t; } query_param_t;

View File

@ -41,7 +41,11 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#ifdef _WIN32
#include <io.h>
#else
#include <unistd.h> #include <unistd.h>
#endif
#include "openjpip.h" #include "openjpip.h"
int int
@ -49,6 +53,7 @@ main(int argc, char *argv[])
{ {
int fd; int fd;
index_t *jp2idx; index_t *jp2idx;
if( argc < 2 ) return 1;
if( (fd = open( argv[1], O_RDONLY)) == -1){ if( (fd = open( argv[1], O_RDONLY)) == -1){
fprintf( stderr, "Error: Target %s not found\n", argv[1]); fprintf( stderr, "Error: Target %s not found\n", argv[1]);