Tizen 2.1 base
[platform/upstream/epson-inkjet-printer-escpr.git] / lib / epson-typedefs.h
1 /*________________________________  epson-typedefs.h   _________________________________*/\r
2 \r
3 /*       1         2         3         4         5         6         7         8        */\r
4 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/\r
5 /*******************************************|********************************************/\r
6 /*\r
7  *   Copyright (c) 2009  Seiko Epson Corporation                 All rights reserved.\r
8  *\r
9  *   Copyright protection claimed includes all forms and matters of\r
10  *   copyrightable material and information now allowed by statutory or judicial\r
11  *   law or hereinafter granted, including without limitation, material generated\r
12  *   from the software programs which are displayed on the screen such as icons,\r
13  *   screen display looks, etc.\r
14  *\r
15  */\r
16 /*******************************************|********************************************/\r
17 /*                                                                                      */\r
18 /*                           Epson Common Type Definitions                              */\r
19 /*                                                                                      */\r
20 /*******************************************|********************************************/\r
21 #ifndef EPSON_TYPEDEFS_H_\r
22 #define EPSON_TYPEDEFS_H_\r
23 #ifdef __cplusplus\r
24 extern "C" {\r
25 #endif\r
26 \r
27 /*---------------------------------  System Includes   ---------------------------------*/\r
28 /*******************************************|********************************************/\r
29 #include <stdio.h>\r
30 #include <string.h>\r
31 #include <stdlib.h>\r
32 #include <ctype.h>\r
33 #include <stdarg.h>\r
34 \r
35 #ifdef GCOMSW_EPSON_SLEEP\r
36 #include <sys/timeb.h>\r
37 #endif\r
38 \r
39 /*------------------------------- Define Basic Data Types ------------------------------*/\r
40 /*******************************************|********************************************/\r
41 typedef unsigned char  EPS_UINT8;       /* unsigned  8-bit  Min: 0          Max: 255        */\r
42 typedef unsigned short EPS_UINT16;      /* unsigned 16-bit  Min: 0          Max: 65535      */\r
43 typedef unsigned int   EPS_UINT32;      /* unsigned 32-bit  Min: 0          Max: 4294967295 */\r
44 typedef char           EPS_INT8;        /*   signed  8-bit  Min: -128       Max: 127        */\r
45 typedef short          EPS_INT16;       /*   signed 16-bit  Min: -32768     Max: 32767      */\r
46 typedef int            EPS_INT32;       /*   signed 32-bit  Min:-2147483648 Max: 2147483647 */\r
47 typedef float          EPS_FLOAT;       /*    float 32-bit  Min:3.4E-38     Max: 3.4E+38    */\r
48 typedef EPS_INT32      EPS_BOOL;        /* Boolean type                                     */\r
49 typedef EPS_INT32      EPS_ERR_CODE;    /* Error code for API's and routines                */\r
50 typedef int            EPS_SOCKET;      /* socket discripter                                */\r
51 \r
52 #if defined(unix)||defined(__unix)\r
53 typedef int            EPS_FILEDSC;     /* file discripter                                  */\r
54 #else\r
55 typedef void*          EPS_FILEDSC;     /* file discripter                                  */\r
56 #endif\r
57 \r
58 /*-----------------------------------  Definitions  ------------------------------------*/\r
59 /*******************************************|********************************************/\r
60 \r
61 /*----------------------------------- Data Structure -----------------------------------*/\r
62 /*******************************************|********************************************/\r
63 \r
64 /*--------------------------------- Basic State Types ----------------------------------*/\r
65 /*******************************************|********************************************/\r
66 #ifndef NULL\r
67 #define NULL            0                   /* Value of null                            */\r
68 #endif\r
69 \r
70 #ifndef TRUE\r
71 #define TRUE            1                   /* Value of "true"                          */\r
72 #endif\r
73 \r
74 #ifndef FALSE\r
75 #define FALSE           0                   /* Value of "false"                         */\r
76 #endif\r
77 \r
78         /*** USB                                                                            */\r
79     /*** -------------------------------------------------------------------------------*/\r
80     /* sign of invalid file discripter                                                  */\r
81 #define EPS_INVALID_FILEDSC        (EPS_FILEDSC)(-1)      \r
82 \r
83 \r
84         /*** Socket                                                                         */\r
85     /*** -------------------------------------------------------------------------------*/\r
86     /* sign of invalid socket                                                           */\r
87 #define EPS_INVALID_SOCKET        (EPS_SOCKET)(-1)        \r
88 \r
89         /*** Socket function retrieve value                                                 */\r
90     /*** -------------------------------------------------------------------------------*/\r
91 #define EPS_SOCKET_SUCCESS          (0)\r
92 #define EPS_SOCKET_ERROR            (-1)          \r
93 #define EPS_SOCKET_TIMEOUT          (-2)\r
94 \r
95     /* protocol family                                                                  */\r
96 #define EPS_PF_INET                             1               /* Internetwork protocol family                                 */\r
97         /* semantics                                                                        */\r
98 #define EPS_SOCK_STREAM                 1               /* Stream socket                                                                */\r
99 #define EPS_SOCK_DGRAM                  2               /* Datagram socket                                                              */\r
100         /* protocol                                                                         */\r
101 #define EPS_PROTOCOL_TCP                1               /* TCP protocol                                                                 */\r
102 #define EPS_PROTOCOL_UDP                2               /* UDP protocol                                                                 */\r
103         /* shutdown method                                                                  */\r
104 #define EPS_SHUTDOWN_SEND               1               /* Shutdown dir: send                                                   */\r
105 #define EPS_SHUTDOWN_RECV               2               /* Shutdown dir: receive                                                */\r
106 #define EPS_SHUTDOWN_BOTH               3               /* Shutdown dir: both                                                   */\r
107 \r
108 #ifdef __cplusplus\r
109 }\r
110 #endif\r
111 \r
112 #endif /* for EPSON_TYPEDEFS_H_                                                         */\r
113 \r
114 /*________________________________  epson-typedefs.h   _________________________________*/\r
115 \r
116 /*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/\r
117 /*       1         2         3         4         5         6         7         8        */\r
118 /*******************************************|********************************************/\r
119 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r
120 /***** End of File *** End of File *** End of File *** End of File *** End of File ******/\r
121 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/\r