Changeset 1183:eb366f837862


Ignore:
Timestamp:
03/16/09 10:01:26 (3 years ago)
Author:
niam
Branch:
default
Message:

fixed compilation issues; header cleanup in io::(event|file::(fifo|regular|temp)|network::(client|connection|exchange|http)|pipe); fixed process protector creation in io::channel, io::event, tools::logger

Location:
trunk
Files:
35 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/libdodo/ioEvent.h

    r1166 r1183  
    3434#include <libdodo/directives.h> 
    3535 
    36 #include <poll.h> 
    37  
    38 #include <libdodo/ioEventEx.h> 
    3936#include <libdodo/types.h> 
    40 #include <libdodo/toolsMisc.h> 
    41 #include <libdodo/ioEventInfo.h> 
    42 #include <libdodo/pcSyncProcessSection.h> 
    43 #include <libdodo/pcSyncProtector.h> 
    4437 
    4538namespace dodo 
    4639{ 
     40        namespace pc 
     41        { 
     42                namespace sync 
     43                { 
     44                        class section; 
     45                }; 
     46        }; 
     47 
    4748        namespace io 
    4849        { 
     50                class eventInfo; 
     51 
    4952                /** 
    5053                 * @struct __eventInOutDescriptors 
  • trunk/include/libdodo/ioFileFifo.h

    r1166 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <unistd.h> 
    36 #include <sys/types.h> 
    37 #include <sys/stat.h> 
    38  
    39 #include <libdodo/toolsMisc.h> 
    40 #include <libdodo/toolsFilesystem.h> 
    41 #include <libdodo/ioFileFifoEx.h> 
    4235#include <libdodo/types.h> 
    4336#include <libdodo/ioChannel.h> 
     
    5043                { 
    5144#ifndef IO_WO_XEXEC 
    52  
    5345                        /** 
    5446                         * @enum fileOperationTypeEnum defines type of operation for hook 
     
    5951                                FIFO_OPERATION_CLOSE 
    6052                        }; 
    61  
    6253#endif 
    6354 
     
    189180                                short mode;         ///< file open mode[see fileOpenmodeEnum] 
    190181 
    191                                 FILE *handler;      ///< file handler 
     182                                void *handler;      ///< file handler 
    192183 
    193184                                bool blocked;       ///< true if stream is blocked 
  • trunk/include/libdodo/ioFileRegular.h

    r1166 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <unistd.h> 
    36 #include <sys/types.h> 
    37 #include <sys/stat.h> 
    38  
    39 #include <libdodo/toolsMisc.h> 
    40 #include <libdodo/toolsFilesystem.h> 
    41 #include <libdodo/ioFileRegularEx.h> 
    4235#include <libdodo/types.h> 
    4336#include <libdodo/ioChannel.h> 
     
    5043                { 
    5144#ifndef IO_WO_XEXEC 
    52  
    5345                        /** 
    5446                         * @enum regularOperationTypeEnum defines type of operation for hook 
     
    5951                                REGULAR_OPERATION_CLOSE 
    6052                        }; 
    61  
    6253#endif 
    6354 
     
    194185                                short mode;         ///< file open mode[see fileOpenmodeEnum] 
    195186 
    196                                 FILE *handler;      ///< file handler 
     187                                void *handler;      ///< file handler 
    197188                        }; 
    198189                }; 
  • trunk/include/libdodo/ioFileTemp.h

    r1166 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <unistd.h> 
    36 #include <sys/types.h> 
    37 #include <sys/stat.h> 
    38  
    39 #include <libdodo/toolsMisc.h> 
    40 #include <libdodo/toolsFilesystem.h> 
    41 #include <libdodo/ioFileTempEx.h> 
    42 #include <libdodo/types.h> 
    4335#include <libdodo/ioChannel.h> 
    4436 
     
    5042                { 
    5143#ifndef IO_WO_XEXEC 
    52  
    5344                        /** 
    5445                         * @enum tempOperationTypeEnum defines type of operation for hook 
     
    5950                                TEMP_OPERATION_CLOSE 
    6051                        }; 
    61  
    6252#endif 
    6353 
     
    169159                          private: 
    170160 
    171                                 FILE *handler; ///< file handler 
     161                                void *handler; ///< file handler 
    172162                        }; 
    173163                }; 
  • trunk/include/libdodo/ioMemory.h

    r1166 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <unistd.h> 
    36 #include <sys/types.h> 
    37 #include <sys/stat.h> 
    38  
    3935#include <libdodo/types.h> 
    4036#include <libdodo/ioChannel.h> 
    41 #include <libdodo/ioMemoryEx.h> 
    4237 
    4338namespace dodo 
  • trunk/include/libdodo/ioNetworkClient.h

    r1164 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <sys/types.h> 
    36 #include <sys/stat.h> 
    37 #include <netinet/in.h> 
    38 #include <arpa/inet.h> 
    39 #include <netdb.h> 
    40 #include <sys/un.h> 
    41 #include <sys/socket.h> 
    42 #include <net/if.h> 
    43 #include <sys/ioctl.h> 
    44 #include <fcntl.h> 
    45  
    46 #include <libdodo/toolsFilesystem.h> 
    47 #include <libdodo/ioNetworkClientEx.h> 
    4835#include <libdodo/types.h> 
    4936#include <libdodo/ioNetworkConnection.h> 
    50 #include <libdodo/ioNetworkExchange.h> 
    5137#include <libdodo/xexec.h> 
    52 #include <libdodo/ioEventInfo.h> 
    5338 
    5439namespace dodo 
     
    6247                                class client; 
    6348                        }; 
     49 
     50                        class exchange; 
    6451 
    6552                        /** 
     
    7764 
    7865#ifndef IO_WO_XEXEC 
    79  
    8066                        /** 
    8167                         * @class __xexecIoNetworkClientCollectedData 
     
    9379                                __xexecIoNetworkClientCollectedData(xexec *executor, short execObject); 
    9480                        }; 
    95  
    9681#endif 
    9782 
     
    182167 
    183168#ifndef IO_WO_XEXEC 
    184  
    185169                                __xexecIoNetworkClientCollectedData collectedData;  ///< data collected for xexec 
    186  
    187170#endif 
    188171                        }; 
  • trunk/include/libdodo/ioNetworkConnection.h

    r1160 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <sys/types.h> 
    36 #include <sys/socket.h> 
    37 #include <unistd.h> 
    38 #include <fcntl.h> 
    39  
    40 #include <libdodo/toolsFilesystem.h> 
    41 #include <libdodo/ioNetworkConnectionEx.h> 
    4235#include <libdodo/types.h> 
    4336 
     
    7770                                CONNECTION_OPTION_BROADCAST,            ///< Permits  sending of broadcast messages, if this is supported by the protocol. 
    7871                                CONNECTION_OPTION_OOB_INLINE,           ///< Out-of-band(marked urgent) data keep inline in recieve operation. 
    79 #ifdef SO_REUSEPORT 
    80                                 CONNECTION_OPTION_REUSE_PORT,           ///< Should allow reuse of local port. 
    81 #endif 
    8272                        }; 
    8373 
  • trunk/include/libdodo/ioNetworkExchange.h

    r1166 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <sys/types.h> 
    36 #include <netinet/in.h> 
    37 #include <arpa/inet.h> 
    38 #include <netdb.h> 
    39 #include <sys/un.h> 
    40 #include <sys/socket.h> 
    41 #include <net/if.h> 
    42 #include <sys/ioctl.h> 
    43 #include <fcntl.h> 
    44 #include <poll.h> 
    45  
    4635#include <libdodo/ioNetworkConnection.h> 
    4736#include <libdodo/ioChannel.h> 
    48 #include <libdodo/ioNetworkExchangeEx.h> 
    49 #include <libdodo/types.h> 
    5037#include <libdodo/xexec.h> 
    5138 
  • trunk/include/libdodo/ioNetworkHttp.h

    r1164 r1183  
    3333#include <libdodo/directives.h> 
    3434 
    35 #include <unistd.h> 
    36 #include <sys/types.h> 
    37 #include <sys/stat.h> 
    38  
    39 #include <libdodo/toolsMisc.h> 
    40 #include <libdodo/ioNetworkClient.h> 
    41 #include <libdodo/ioNetworkSslClient.h> 
    42 #include <libdodo/toolsNetwork.h> 
    43 #include <libdodo/ioNetworkHttpEx.h> 
     35#include <libdodo/toolsCode.h> 
     36#include <libdodo/ioSsl.h> 
    4437#include <libdodo/types.h> 
    45 #include <libdodo/cgiDialogue.h> 
    4638 
    4739namespace dodo 
    4840{ 
     41        namespace cgi 
     42        { 
     43                struct __cgiCookie; 
     44        }; 
     45 
    4946        namespace io 
    5047        { 
    5148                namespace network 
    5249                { 
     50                        class exchange; 
     51 
    5352#define HTTP_REQUESTHEADERSTATEMENTS 12 
    5453 
     
    169168 
    170169#ifdef OPENSSL_EXT 
    171  
    172170                                /** 
    173171                                 * set certificates information 
     
    180178                                 */ 
    181179                                virtual void removeSertificates(); 
    182  
    183180#endif 
    184181 
     
    396393 
    397394#ifdef OPENSSL_EXT 
    398  
    399395                                        SCHEME_HTTPS, 
    400  
    401396#endif 
    402397                                }; 
     
    437432 
    438433#ifdef OPENSSL_EXT 
    439  
    440434                                io::ssl::__certificates certs;  ///< SSL certificates 
    441435                                bool certsSet; 
    442  
    443436#endif 
    444437                        }; 
  • trunk/include/libdodo/ioPipe.h

    r1166 r1183  
    3131#define _IOPIPE_H_ 1 
    3232 
    33 #include <fcntl.h> 
    34 #include <sys/un.h> 
    35 #include <sys/socket.h> 
    36 #include <netinet/in.h> 
    37 #include <arpa/inet.h> 
    38 #include <netdb.h> 
    39  
    4033#include <libdodo/directives.h> 
    4134 
    42 #include <libdodo/toolsMisc.h> 
    43 #include <libdodo/ioPipeEx.h> 
    44 #include <libdodo/types.h> 
    4535#include <libdodo/ioChannel.h> 
    46 #include <libdodo/ioNetwork.h> 
    4736 
    4837namespace dodo 
     
    5039        namespace io 
    5140        { 
     41                namespace network 
     42                { 
     43                        struct __peerInfo; 
     44                }; 
     45 
    5246                /** 
    5347                 * @enum pipeOperationTypeEnum defines type of operation for hook 
     
    166160                        virtual void _writeStream(const char * const data); 
    167161 
    168                         FILE *inHandle;     ///< input stream descriptor 
    169                         FILE *outHandle;    ///< output stream descriptor 
     162                        void *inHandle;     ///< input stream descriptor 
     163                        void *outHandle;    ///< output stream descriptor 
    170164 
    171165                  private: 
  • trunk/include/libdodo/rpcHttpClient.h

    r1160 r1183  
    3333#include <libdodo/directives.h> 
    3434 
     35#include <libdodo/cgi.h> 
    3536#include <libdodo/types.h> 
    3637#include <libdodo/ioNetworkHttp.h> 
  • trunk/include/libdodo/rpcJsonClient.h

    r1160 r1183  
    3737#include <libdodo/rpcClient.h> 
    3838#include <libdodo/rpcJsonMethod.h> 
     39#include <libdodo/dataFormatJsonNode.h> 
    3940#include <libdodo/rpcJsonResponse.h> 
    4041 
  • trunk/include/libdodo/rpcJsonMethod.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatJsonNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcMethod.h> 
  • trunk/include/libdodo/rpcJsonResponse.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatJsonNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcResponse.h> 
  • trunk/include/libdodo/rpcJsonValue.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatJsonNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcValue.h> 
  • trunk/include/libdodo/rpcXmlClient.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatXmlNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcClient.h> 
  • trunk/include/libdodo/rpcXmlMethod.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatXmlNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcMethod.h> 
  • trunk/include/libdodo/rpcXmlResponse.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatXmlNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcResponse.h> 
  • trunk/include/libdodo/rpcXmlValue.h

    r1160 r1183  
    3434 
    3535#include <libdodo/types.h> 
     36#include <libdodo/dataFormatXmlNode.h> 
    3637#include <libdodo/toolsString.h> 
    3738#include <libdodo/rpcValue.h> 
  • trunk/src/cgiBasicExchange.cc

    r1177 r1183  
    2929 
    3030#include <libdodo/directives.h> 
     31 
     32#include <stdlib.h> 
    3133 
    3234#include <libdodo/cgiBasicExchange.h> 
  • trunk/src/cgiDialogue.cc

    r1177 r1183  
    3838#include <libdodo/cgiExchange.h> 
    3939#include <libdodo/cgiDialogueEx.h> 
     40#include <libdodo/toolsString.h> 
     41#include <libdodo/toolsCode.h> 
     42#include <libdodo/toolsMisc.h> 
    4043 
    4144using namespace dodo::cgi; 
  • trunk/src/graphicsTransform.cc

    r1181 r1183  
    8888        } 
    8989 
    90         GetExceptionInfo(&(im->exInfo)); 
     90        GetExceptionInfo((ExceptionInfo *)im->exInfo); 
    9191 
    92         Image *image = ScaleImage(im->collectedData.handle->imHandle, width, height, &(im->exInfo)); 
     92        Image *image = ScaleImage(im->collectedData.handle->imHandle, width, height, (ExceptionInfo *)im->exInfo); 
    9393 
    9494        if (image == NULL) 
    9595        { 
    96                 throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_SCALE, exception::ERRNO_IMAGEMAGICK, im->exInfo.error_number, im->exInfo.reason, __LINE__, __FILE__, im->exInfo.description); 
     96                throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_SCALE, exception::ERRNO_IMAGEMAGICK, ((ExceptionInfo *)im->exInfo)->error_number, ((ExceptionInfo *)im->exInfo)->reason, __LINE__, __FILE__, ((ExceptionInfo *)im->exInfo)->description); 
    9797        } 
    9898 
     
    114114        float mult = (float)size / (float)((im->collectedData.handle->imHandle->columns > im->collectedData.handle->imHandle->rows) ? im->collectedData.handle->imHandle->columns : im->collectedData.handle->imHandle->rows); 
    115115 
    116         GetExceptionInfo(&(im->exInfo)); 
     116        GetExceptionInfo((ExceptionInfo *)im->exInfo); 
    117117 
    118         Image *image = ScaleImage(im->collectedData.handle->imHandle, (unsigned long)floor(im->collectedData.handle->imHandle->columns * mult), (unsigned long)floor(im->collectedData.handle->imHandle->rows * mult), &(im->exInfo)); 
     118        Image *image = ScaleImage(im->collectedData.handle->imHandle, (unsigned long)floor(im->collectedData.handle->imHandle->columns * mult), (unsigned long)floor(im->collectedData.handle->imHandle->rows * mult), (ExceptionInfo *)im->exInfo); 
    119119 
    120120        if (image == NULL) 
    121121        { 
    122                 throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_SCALE, exception::ERRNO_IMAGEMAGICK, im->exInfo.error_number, im->exInfo.reason, __LINE__, __FILE__, im->exInfo.description); 
     122                throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_SCALE, exception::ERRNO_IMAGEMAGICK, ((ExceptionInfo *)im->exInfo)->error_number, ((ExceptionInfo *)im->exInfo)->reason, __LINE__, __FILE__, ((ExceptionInfo *)im->exInfo)->description); 
    123123        } 
    124124 
     
    138138        } 
    139139 
    140         GetExceptionInfo(&(im->exInfo)); 
     140        GetExceptionInfo((ExceptionInfo *)im->exInfo); 
    141141 
    142         Image *image = RotateImage(im->collectedData.handle->imHandle, angle, &(im->exInfo)); 
     142        Image *image = RotateImage(im->collectedData.handle->imHandle, angle, (ExceptionInfo *)im->exInfo); 
    143143 
    144144        if (image == NULL) 
    145145        { 
    146                 throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_ROTATE, exception::ERRNO_IMAGEMAGICK, im->exInfo.error_number, im->exInfo.reason, __LINE__, __FILE__, im->exInfo.description); 
     146                throw exception::basic(exception::ERRMODULE_GRAPHICSTRANSFORM, TRANSFORMEX_ROTATE, exception::ERRNO_IMAGEMAGICK, ((ExceptionInfo *)im->exInfo)->error_number, ((ExceptionInfo *)im->exInfo)->reason, __LINE__, __FILE__, ((ExceptionInfo *)im->exInfo)->description); 
    147147        } 
    148148 
  • trunk/src/ioChannel.cc

    r1180 r1183  
    6666                if (protection == CHANNEL_PROTECTION_PROCESS) 
    6767                { 
    68                         keeper = new pc::sync::process::section; 
     68                        keeper = new pc::sync::process::section(0); 
    6969                } 
    7070        } 
  • trunk/src/ioEvent.cc

    r1162 r1183  
    2828 */ 
    2929 
     30 
     31#include <libdodo/directives.h> 
     32 
     33#include <poll.h> 
     34 
    3035#include <libdodo/ioEvent.h> 
     36#include <libdodo/ioEventEx.h> 
     37#include <libdodo/types.h> 
     38#include <libdodo/toolsMisc.h> 
     39#include <libdodo/ioEventInfo.h> 
     40#include <libdodo/pcSyncProcessSection.h> 
     41#include <libdodo/pcSyncProtector.h> 
    3142 
    3243using namespace dodo::io; 
     
    4152 
    4253event::event() : descs(0), 
    43                                  keeper(new pc::sync::process::section) 
     54                                 keeper(new pc::sync::process::section(0)) 
    4455{ 
    4556} 
  • trunk/src/ioFileFifo.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <unistd.h> 
     33#include <sys/types.h> 
     34#include <sys/stat.h> 
     35 
    3036#include <libdodo/ioFileFifo.h> 
     37#include <libdodo/toolsFilesystem.h> 
     38#include <libdodo/ioFileFifoEx.h> 
     39#include <libdodo/types.h> 
     40#include <libdodo/ioChannel.h> 
     41#include <libdodo/pcSyncProtector.h> 
    3142 
    3243using namespace dodo::io::file; 
     
    3950{ 
    4051#ifndef IO_WO_XEXEC 
    41  
    4252        collectedData.setExecObject(XEXEC_OBJECT_IOFILEFIFO); 
    43  
    4453#endif 
    4554} 
     
    5867{ 
    5968#ifndef IO_WO_XEXEC 
    60  
    6169        collectedData.setExecObject(XEXEC_OBJECT_IOFILEFIFO); 
    62  
    6370#endif 
    6471 
     
    148155{ 
    149156#ifndef IO_WO_XEXEC 
    150  
    151157        collectedData.setExecObject(XEXEC_OBJECT_IOFILEFIFO); 
    152  
    153158#endif 
    154159 
     
    160165                int oldDesc, newDesc; 
    161166 
    162                 oldDesc = fileno(fd.handler); 
     167                oldDesc = fileno((FILE *)fd.handler); 
    163168                if (oldDesc == -1) 
    164169                { 
     
    199204        if (handler != NULL) 
    200205        { 
    201                 fclose(handler); 
     206                fclose((FILE *)handler); 
    202207        } 
    203208} 
     
    215220        } 
    216221 
    217         return fileno(handler); 
     222        return fileno((FILE *)handler); 
    218223} 
    219224 
     
    230235        } 
    231236 
    232         return fileno(handler); 
     237        return fileno((FILE *)handler); 
    233238} 
    234239 
     
    242247        if (handler != NULL) 
    243248        { 
    244                 if (fclose(handler) != 0) 
     249                if (fclose((FILE *)handler) != 0) 
    245250                { 
    246251                        throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX_CLONE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    262267                int oldDesc, newDesc; 
    263268 
    264                 oldDesc = fileno(fd.handler); 
     269                oldDesc = fileno((FILE *)fd.handler); 
    265270                if (oldDesc == -1) 
    266271                { 
     
    309314        if (handler != NULL) 
    310315        { 
    311                 if (fclose(handler) != 0) 
     316                if (fclose((FILE *)handler) != 0) 
    312317                { 
    313318                        throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX_CLOSE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    340345        if (handler != NULL) 
    341346        { 
    342                 if (fclose(handler) != 0) 
     347                if (fclose((FILE *)handler) != 0) 
    343348                { 
    344349                        throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX_OPEN, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    459464        int blockFlag; 
    460465 
    461         int desc = fileno(handler); 
     466        int desc = fileno((FILE *)handler); 
    462467        if (desc == -1) 
    463468        { 
     
    514519                        while (true) 
    515520                        { 
    516                                 if ((n = fread(data, 1, batch, handler)) == 0) 
    517                                 { 
    518                                         if (feof(handler) != 0 || errno == EAGAIN) 
     521                                if ((n = fread(data, 1, batch, (FILE *)handler)) == 0) 
     522                                { 
     523                                        if (feof((FILE *)handler) != 0 || errno == EAGAIN) 
    519524                                        { 
    520525                                                break; 
     
    526531                                        } 
    527532 
    528                                         if (ferror(handler) != 0) 
     533                                        if (ferror((FILE *)handler) != 0) 
    529534                                        { 
    530535                                                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    547552                        while (true) 
    548553                        { 
    549                                 if ((n = fread(data, 1, batch, handler)) == 0) 
    550                                 { 
    551                                         if (feof(handler) != 0 || errno == EAGAIN) 
     554                                if ((n = fread(data, 1, batch, (FILE *)handler)) == 0) 
     555                                { 
     556                                        if (feof((FILE *)handler) != 0 || errno == EAGAIN) 
    552557                                        { 
    553558                                                break; 
     
    559564                                        } 
    560565 
    561                                         if (ferror(handler) != 0) 
     566                                        if (ferror((FILE *)handler) != 0) 
    562567                                        { 
    563568                                                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    598603                        while (true) 
    599604                        { 
    600                                 if ((n = fwrite(data, 1, batch, handler)) == 0) 
     605                                if ((n = fwrite(data, 1, batch, (FILE *)handler)) == 0) 
    601606                                { 
    602607                                        if (errno == EINTR) 
     
    610615                                        } 
    611616 
    612                                         if (ferror(handler) != 0) 
     617                                        if (ferror((FILE *)handler) != 0) 
    613618                                        { 
    614619                                                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    631636                        while (true) 
    632637                        { 
    633                                 if ((n = fwrite(data, 1, batch, handler)) == 0) 
     638                                if ((n = fwrite(data, 1, batch, (FILE *)handler)) == 0) 
    634639                                { 
    635640                                        if (errno == EINTR) 
     
    643648                                        } 
    644649 
    645                                         if (ferror(handler) != 0) 
     650                                        if (ferror((FILE *)handler) != 0) 
    646651                                        { 
    647652                                                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    670675        } 
    671676 
    672         if (fflush(handler) != 0) 
     677        if (fflush((FILE *)handler) != 0) 
    673678        { 
    674679                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX_FLUSH, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    692697        while (true) 
    693698        { 
    694                 if (fgets(a_data, readSize, handler) == NULL) 
     699                if (fgets(a_data, readSize, (FILE *)handler) == NULL) 
    695700                { 
    696701                        if (errno == EINTR) 
     
    704709                        } 
    705710 
    706                         if (ferror(handler) != 0) 
     711                        if (ferror((FILE *)handler) != 0) 
    707712                        { 
    708713                                throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    736741                while (true) 
    737742                { 
    738                         if (fputc('\n', handler) == EOF) 
     743                        if (fputc('\n', (FILE *)handler) == EOF) 
    739744                        { 
    740745                                if (errno == EINTR) 
     
    748753                                } 
    749754 
    750                                 if (ferror(handler) != 0) 
     755                                if (ferror((FILE *)handler) != 0) 
    751756                                { 
    752757                                        throw exception::basic(exception::ERRMODULE_IOFILEFIFO, FIFOEX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
  • trunk/src/ioFileRegular.cc

    r1166 r1183  
     1 
    12/*************************************************************************** 
    23 *            ioFileRegular.cc 
     
    2829 */ 
    2930 
     31#include <libdodo/directives.h> 
     32 
     33#include <unistd.h> 
     34#include <sys/types.h> 
     35#include <sys/stat.h> 
     36 
    3037#include <libdodo/ioFileRegular.h> 
     38#include <libdodo/toolsFilesystem.h> 
     39#include <libdodo/ioFileRegularEx.h> 
     40#include <libdodo/types.h> 
     41#include <libdodo/pcSyncProtector.h> 
     42#include <libdodo/ioChannel.h> 
    3143 
    3244using namespace dodo::io::file; 
     
    4052{ 
    4153#ifndef IO_WO_XEXEC 
    42  
    4354        collectedData.setExecObject(XEXEC_OBJECT_IOFILEREGULAR); 
    44  
    4555#endif 
    4656} 
     
    6070{ 
    6171#ifndef IO_WO_XEXEC 
    62  
    6372        collectedData.setExecObject(XEXEC_OBJECT_IOFILEREGULAR); 
    64  
    6573#endif 
    6674 
     
    147155{ 
    148156#ifndef IO_WO_XEXEC 
    149  
    150157        collectedData.setExecObject(XEXEC_OBJECT_IOFILEREGULAR); 
    151  
    152158#endif 
    153159 
     
    155161        outSize = fd.outSize; 
    156162 
    157         if (fd.handler != NULL) 
     163        if (fd.handler !=  NULL) 
    158164        { 
    159165                int oldDesc, newDesc; 
    160166 
    161                 oldDesc = fileno(fd.handler); 
     167                oldDesc = fileno((FILE *)fd.handler); 
    162168                if (oldDesc == -1) 
    163169                { 
     
    203209regular::~regular() 
    204210{ 
    205         if (handler != NULL) 
    206         { 
    207                 fclose(handler); 
     211        if (handler !=  NULL) 
     212        { 
     213                fclose((FILE *)handler); 
    208214        } 
    209215} 
     
    221227        } 
    222228 
    223         return fileno(handler); 
     229        return fileno((FILE *)handler); 
    224230} 
    225231 
     
    236242        } 
    237243 
    238         return fileno(handler); 
     244        return fileno((FILE *)handler); 
    239245} 
    240246 
     
    246252        pc::sync::protector pg(keeper); 
    247253 
    248         if (handler != NULL) 
    249         { 
    250                 if (fclose(handler) != 0) 
     254        if (handler !=  NULL) 
     255        { 
     256                if (fclose((FILE *)handler) != 0) 
    251257                { 
    252258                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX_CLONE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    265271        outSize = fd.outSize; 
    266272 
    267         if (fd.handler != NULL) 
     273        if (fd.handler !=  NULL) 
    268274        { 
    269275                int oldDesc, newDesc; 
    270276 
    271                 oldDesc = fileno(fd.handler); 
     277                oldDesc = fileno((FILE *)fd.handler); 
    272278                if (oldDesc == -1) 
    273279                { 
     
    321327#endif 
    322328 
    323         if (handler != NULL) 
    324         { 
    325                 if (fclose(handler) != 0) 
     329        if (handler !=  NULL) 
     330        { 
     331                if (fclose((FILE *)handler) != 0) 
    326332                { 
    327333                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX_CLOSE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    352358        mode = a_mode; 
    353359 
    354         if (handler != NULL) 
    355         { 
    356                 if (fclose(handler) != 0) 
     360        if (handler !=  NULL) 
     361        { 
     362                if (fclose((FILE *)handler) != 0) 
    357363                { 
    358364                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX_OPEN, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    447453        unsigned long pos = blockOffset ? this->pos * inSize : this->pos; 
    448454 
    449         if (fseek(handler, pos, SEEK_SET) == -1) 
     455        if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    450456        { 
    451457                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    456462        while (true) 
    457463        { 
    458                 if (fread(a_data, inSize, 1, handler) == 0) 
    459                 { 
    460                         if (feof(handler) != 0 || errno == EAGAIN) 
     464                if (fread(a_data, inSize, 1, (FILE *)handler) == 0) 
     465                { 
     466                        if (feof((FILE *)handler) != 0 || errno == EAGAIN) 
    461467                        { 
    462468                                break; 
     
    468474                        } 
    469475 
    470                         if (ferror(handler) != 0) 
     476                        if (ferror((FILE *)handler) != 0) 
    471477                        { 
    472478                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    492498                if (append) 
    493499                { 
    494                         if (fseek(handler, 0, SEEK_END) == -1) 
     500                        if (fseek((FILE *)handler, 0, SEEK_END) == -1) 
    495501                        { 
    496502                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    502508                        if (!overwrite) 
    503509                        { 
    504                                 if (fseek(handler, pos, SEEK_SET) == -1) 
     510                                if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    505511                                { 
    506512                                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    509515                                char *t_buf = new char[outSize]; 
    510516 
    511                                 size_t read = fread(t_buf, outSize, 1, handler); 
     517                                size_t read = fread(t_buf, outSize, 1, (FILE *)handler); 
    512518 
    513519                                delete [] t_buf; 
     
    519525                        } 
    520526 
    521                         if (fseek(handler, pos, SEEK_SET) == -1) 
     527                        if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    522528                        { 
    523529                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    528534        while (true) 
    529535        { 
    530                 if (fwrite(a_data, outSize, 1, handler) == 0) 
     536                if (fwrite(a_data, outSize, 1, (FILE *)handler) == 0) 
    531537                { 
    532538                        if (errno == EINTR) 
     
    540546                        } 
    541547 
    542                         if (ferror(handler) != 0) 
     548                        if (ferror((FILE *)handler) != 0) 
    543549                        { 
    544550                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    594600        } 
    595601 
    596         if (fflush(handler) != 0) 
     602        if (fflush((FILE *)handler) != 0) 
    597603        { 
    598604                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX_FLUSH, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    614620        if (blockOffset) 
    615621        { 
    616                 if (fseek(handler, 0, SEEK_SET) == -1) 
     622                if (fseek((FILE *)handler, 0, SEEK_SET) == -1) 
    617623                { 
    618624                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    621627                for (unsigned long i = 0; i < pos; ++i) 
    622628                { 
    623                         if (fgets(a_data, readSize, handler) == NULL) 
     629                        if (fgets(a_data, readSize, (FILE *)handler) == NULL) 
    624630                        { 
    625631                                switch (errno) 
     
    639645                } 
    640646        } 
    641         else if (fseek(handler, pos, SEEK_SET) == -1) 
     647        else if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    642648        { 
    643649                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    648654        while (true) 
    649655        { 
    650                 if (fgets(a_data, readSize, handler) == NULL) 
     656                if (fgets(a_data, readSize, (FILE *)handler) == NULL) 
    651657                { 
    652658                        if (errno == EINTR) 
     
    660666                        } 
    661667 
    662                         if (ferror(handler) != 0) 
     668                        if (ferror((FILE *)handler) != 0) 
    663669                        { 
    664670                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    684690        if (mode != REGULAR_OPENMODE_APPEND) 
    685691        { 
    686                 if (fseek(handler, 0, SEEK_END) == -1) 
     692                if (fseek((FILE *)handler, 0, SEEK_END) == -1) 
    687693                { 
    688694                        throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__, path); 
     
    701707        while (true) 
    702708        { 
    703                 if (fwrite(a_data, _outSize, 1, handler) == 0) 
     709                if (fwrite(a_data, _outSize, 1, (FILE *)handler) == 0) 
    704710                { 
    705711                        if (errno == EINTR) 
     
    708714                        } 
    709715 
    710                         if (ferror(handler) != 0) 
     716                        if (ferror((FILE *)handler) != 0) 
    711717                        { 
    712718                                throw exception::basic(exception::ERRMODULE_IOFILEREGULAR, REGULAREX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
  • trunk/src/ioFileTemp.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <unistd.h> 
     33#include <sys/types.h> 
     34#include <sys/stat.h> 
     35 
    3036#include <libdodo/ioFileTemp.h> 
     37#include <libdodo/ioFileTempEx.h> 
     38#include <libdodo/types.h> 
     39#include <libdodo/ioChannel.h> 
     40#include <libdodo/pcSyncProtector.h> 
    3141 
    3242using namespace dodo::io::file; 
     
    4151{ 
    4252#ifndef IO_WO_XEXEC 
    43  
    4453        collectedData.setExecObject(XEXEC_OBJECT_IOFILETEMP); 
    45  
    4654#endif 
    4755 
     
    6775{ 
    6876#ifndef IO_WO_XEXEC 
    69  
    7077        collectedData.setExecObject(XEXEC_OBJECT_IOFILETEMP); 
    71  
    7278#endif 
    7379 
     
    7985                int oldDesc, newDesc; 
    8086 
    81                 oldDesc = fileno(fd.handler); 
     87                oldDesc = fileno((FILE *)fd.handler); 
    8288                if (oldDesc == -1) 
    8389                { 
     
    106112        if (handler != NULL) 
    107113        { 
    108                 fclose(handler); 
     114                fclose((FILE *)handler); 
    109115        } 
    110116} 
     
    122128        } 
    123129 
    124         return fileno(handler); 
     130        return fileno((FILE *)handler); 
    125131} 
    126132 
     
    137143        } 
    138144 
    139         return fileno(handler); 
     145        return fileno((FILE *)handler); 
    140146} 
    141147 
     
    149155        if (handler != NULL) 
    150156        { 
    151                 if (fclose(handler) != 0) 
     157                if (fclose((FILE *)handler) != 0) 
    152158                { 
    153159                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX_CLONE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    168174                int oldDesc, newDesc; 
    169175 
    170                 oldDesc = fileno(fd.handler); 
     176                oldDesc = fileno((FILE *)fd.handler); 
    171177                if (oldDesc == -1) 
    172178                { 
     
    203209        if (handler != NULL) 
    204210        { 
    205                 if (fclose(handler) != 0) 
     211                if (fclose((FILE *)handler) != 0) 
    206212                { 
    207213                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX_CLOSE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    230236        if (handler != NULL) 
    231237        { 
    232                 if (fclose(handler) != 0) 
     238                if (fclose((FILE *)handler) != 0) 
    233239                { 
    234240                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX_OPEN, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    261267        unsigned long pos = blockOffset ? this->pos * inSize : this->pos; 
    262268 
    263         if (fseek(handler, pos * inSize, SEEK_SET) == -1) 
     269        if (fseek((FILE *)handler, pos * inSize, SEEK_SET) == -1) 
    264270        { 
    265271                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    270276        while (true) 
    271277        { 
    272                 if (fread(a_data, inSize, 1, handler) == 0) 
    273                 { 
    274                         if (feof(handler) != 0 || errno == EAGAIN) 
     278                if (fread(a_data, inSize, 1, (FILE *)handler) == 0) 
     279                { 
     280                        if (feof((FILE *)handler) != 0 || errno == EAGAIN) 
    275281                        { 
    276282                                break; 
     
    282288                        } 
    283289 
    284                         if (ferror(handler) != 0) 
     290                        if (ferror((FILE *)handler) != 0) 
    285291                        { 
    286292                                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    304310        if (append) 
    305311        { 
    306                 if (fseek(handler, 0, SEEK_END) == -1) 
     312                if (fseek((FILE *)handler, 0, SEEK_END) == -1) 
    307313                { 
    308314                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    314320                if (!overwrite) 
    315321                { 
    316                         if (fseek(handler, pos, SEEK_SET) == -1) 
     322                        if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    317323                        { 
    318324                                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    321327                        char *t_buf = new char[outSize]; 
    322328 
    323                         size_t read = fread(t_buf, outSize, 1, handler); 
     329                        size_t read = fread(t_buf, outSize, 1, (FILE *)handler); 
    324330 
    325331                        delete [] t_buf; 
     
    331337                } 
    332338 
    333                 if (fseek(handler, pos, SEEK_SET) == -1) 
     339                if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    334340                { 
    335341                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    339345        while (true) 
    340346        { 
    341                 if (fwrite(a_data, outSize, 1, handler) == 0) 
     347                if (fwrite(a_data, outSize, 1, (FILE *)handler) == 0) 
    342348                { 
    343349                        if (errno == EINTR) 
     
    351357                        } 
    352358 
    353                         if (ferror(handler) != 0) 
     359                        if (ferror((FILE *)handler) != 0) 
    354360                        { 
    355361                                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    405411        } 
    406412 
    407         if (fflush(handler) != 0) 
     413        if (fflush((FILE *)handler) != 0) 
    408414        { 
    409415                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX_FLUSH, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    425431        if (blockOffset) 
    426432        { 
    427                 if (fseek(handler, 0, SEEK_SET) == -1) 
     433                if (fseek((FILE *)handler, 0, SEEK_SET) == -1) 
    428434                { 
    429435                        throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    432438                for (unsigned long i = 0; i < pos; ++i) 
    433439                { 
    434                         if (fgets(a_data, readSize, handler) == NULL) 
     440                        if (fgets(a_data, readSize, (FILE *)handler) == NULL) 
    435441                        { 
    436442                                switch (errno) 
     
    450456                } 
    451457        } 
    452         else if (fseek(handler, pos, SEEK_SET) == -1) 
     458        else if (fseek((FILE *)handler, pos, SEEK_SET) == -1) 
    453459        { 
    454460                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    459465        while (true) 
    460466        { 
    461                 if (fgets(a_data, readSize, handler) == NULL) 
     467                if (fgets(a_data, readSize, (FILE *)handler) == NULL) 
    462468                { 
    463469                        if (errno == EINTR) 
     
    471477                        } 
    472478 
    473                         if (ferror(handler) != 0) 
     479                        if (ferror((FILE *)handler) != 0) 
    474480                        { 
    475481                                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    493499        } 
    494500 
    495         if (fseek(handler, 0, SEEK_END) == -1) 
     501        if (fseek((FILE *)handler, 0, SEEK_END) == -1) 
    496502        { 
    497503                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    509515        while (true) 
    510516        { 
    511                 if (fwrite(a_data, _outSize, 1, handler) == 0) 
     517                if (fwrite(a_data, _outSize, 1, (FILE *)handler) == 0) 
    512518                { 
    513519                        if (errno == EINTR) 
     
    516522                        } 
    517523 
    518                         if (ferror(handler) != 0) 
     524                        if (ferror((FILE *)handler) != 0) 
    519525                        { 
    520526                                throw exception::basic(exception::ERRMODULE_IOFILETEMP, TEMPEX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
  • trunk/src/ioMemory.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
    3032#include <libdodo/ioMemory.h> 
     33#include <libdodo/types.h> 
     34#include <libdodo/ioChannel.h> 
     35#include <libdodo/ioMemoryEx.h> 
     36#include <libdodo/pcSyncProtector.h> 
    3137 
    3238using namespace dodo::io; 
     
    3844{ 
    3945#ifndef IO_WO_XEXEC 
    40  
    4146        collectedData.setExecObject(XEXEC_OBJECT_IOMEMORY); 
    42  
    4347#endif 
    4448} 
     
    5357{ 
    5458#ifndef IO_WO_XEXEC 
    55  
    5659        collectedData.setExecObject(XEXEC_OBJECT_IOFILEREGULAR); 
    57  
    5860#endif 
    5961 
     
    7274{ 
    7375#ifndef IO_WO_XEXEC 
    74  
    7576        collectedData.setExecObject(XEXEC_OBJECT_IOFILEREGULAR); 
    76  
    7777#endif 
    7878} 
     
    9090{ 
    9191        throw exception::basic(exception::ERRMODULE_IOMEMORY, MEMORYEX_GETINDESCRIPTOR, exception::ERRNO_LIBDODO, MEMORYEX_CANTBEUSEDWITHIOEVENT, IOMEMORYEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__); 
    92  
    93         return -1; 
    9492} 
    9593 
     
    10098{ 
    10199        throw exception::basic(exception::ERRMODULE_IOMEMORY, MEMORYEX_GETOUTDESCRIPTOR, exception::ERRNO_LIBDODO, MEMORYEX_CANTBEUSEDWITHIOEVENT, IOMEMORYEX_CANTBEUSEDWITHIOEVENT_STR, __LINE__, __FILE__); 
    102  
    103         return -1; 
    104100} 
    105101 
  • trunk/src/ioNetworkClient.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <sys/types.h> 
     33#include <sys/stat.h> 
     34#include <netinet/in.h> 
     35#include <arpa/inet.h> 
     36#include <netdb.h> 
     37#include <sys/un.h> 
     38#include <sys/socket.h> 
     39#include <net/if.h> 
     40#include <sys/ioctl.h> 
     41#include <fcntl.h> 
     42 
    3043#include <libdodo/ioNetworkClient.h> 
     44#include <libdodo/ioNetworkClientEx.h> 
     45#include <libdodo/types.h> 
     46#include <libdodo/ioNetworkConnection.h> 
     47#include <libdodo/ioNetworkExchange.h> 
     48#include <libdodo/xexec.h> 
    3149 
    3250using namespace dodo::io::network; 
    3351 
    3452#ifndef IO_WO_XEXEC 
    35  
    3653__xexecIoNetworkClientCollectedData::__xexecIoNetworkClientCollectedData(xexec *executor, 
    3754                                                                                                                                                 short execObject) : __xexecCollectedData(executor, execObject) 
    3855{ 
    3956} 
    40  
    4157#endif 
    4258 
     
    4460 
    4561client::client(client &fs) 
    46  
    47 #ifndef IO_WO_XEXEC 
    48  
     62#ifndef IO_WO_XEXEC 
    4963        : collectedData(this, XEXEC_OBJECT_IONETWORKCLIENT) 
    50  
    51 #endif 
    52  
     64#endif 
    5365{ 
    5466} 
     
    6173                                                           blockInherited(false) 
    6274#ifndef IO_WO_XEXEC 
    63  
    6475                                                           , 
    6576                                                           collectedData(this, XEXEC_OBJECT_IONETWORKCLIENT) 
    66  
    6777#endif 
    6878{ 
  • trunk/src/ioNetworkConnection.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <sys/socket.h> 
     33#include <fcntl.h> 
     34 
    3035#include <libdodo/ioNetworkConnection.h> 
     36#include <libdodo/ioNetworkConnectionEx.h> 
    3137 
    3238using namespace dodo::io::network; 
     
    268274                        break; 
    269275 
    270 #ifdef SO_REUSEPORT 
    271  
    272                 case CONNECTION_OPTION_REUSE_PORT: 
    273  
    274                         real_option = SO_REUSEPORT; 
    275  
    276                         break; 
    277  
    278 #endif 
    279  
    280276                default: 
    281277 
  • trunk/src/ioNetworkExchange.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <arpa/inet.h> 
     33#include <poll.h> 
     34 
    3035#include <libdodo/ioNetworkExchange.h> 
     36#include <libdodo/ioNetworkConnection.h> 
     37#include <libdodo/ioChannel.h> 
     38#include <libdodo/ioNetworkExchangeEx.h> 
     39#include <libdodo/types.h> 
     40#include <libdodo/pcSyncProtector.h> 
    3141 
    3242using namespace dodo::io::network; 
     
    4858{ 
    4959#ifndef IO_WO_XEXEC 
    50  
    5160        collectedData.setExecObject(XEXEC_OBJECT_IONETWORKEXCHANGE); 
    52  
    5361#endif 
    5462 
     
    7381{ 
    7482#ifndef IO_WO_XEXEC 
    75  
    7683        collectedData.setExecObject(XEXEC_OBJECT_IONETWORKEXCHANGE); 
    77  
    7884#endif 
    7985} 
     
    8591{ 
    8692#ifndef IO_WO_XEXEC 
    87  
    8893        collectedData.setExecObject(XEXEC_OBJECT_IONETWORKEXCHANGE); 
    89  
    9094#endif 
    9195 
  • trunk/src/ioNetworkHttp.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <unistd.h> 
     33#include <sys/types.h> 
     34#include <sys/stat.h> 
     35 
    3036#include <libdodo/ioNetworkHttp.h> 
     37#include <libdodo/toolsCode.h> 
     38#include <libdodo/ioNetworkClient.h> 
     39#include <libdodo/ioNetworkSslClient.h> 
     40#include <libdodo/toolsNetwork.h> 
     41#include <libdodo/ioNetworkHttpEx.h> 
     42#include <libdodo/ioNetworkClientEx.h> 
     43#include <libdodo/ioNetworkExchangeEx.h> 
     44#include <libdodo/types.h> 
     45#include <libdodo/cgi.h> 
    3146 
    3247using namespace dodo::io::network; 
  • trunk/src/ioPipe.cc

    r1166 r1183  
    2828 */ 
    2929 
     30#include <libdodo/directives.h> 
     31 
     32#include <stdio.h> 
     33#include <arpa/inet.h> 
     34#include <fcntl.h> 
     35 
    3036#include <libdodo/ioPipe.h> 
     37#include <libdodo/ioPipeEx.h> 
     38#include <libdodo/ioChannel.h> 
     39#include <libdodo/ioNetworkConnection.h> 
     40#include <libdodo/pcSyncProtector.h> 
    3141 
    3242using namespace dodo; 
     
    4151{ 
    4252#ifndef IO_WO_XEXEC 
    43  
    4453        collectedData.setExecObject(XEXEC_OBJECT_IOPIPE); 
    45  
    4654#endif 
    4755 
     
    7987{ 
    8088#ifndef IO_WO_XEXEC 
    81  
    8289        collectedData.setExecObject(XEXEC_OBJECT_IOPIPE); 
    83  
    8490#endif 
    8591 
     
    9197                int oldDesc, newDesc; 
    9298 
    93                 oldDesc = fileno(fd.inHandle); 
     99                oldDesc = fileno((FILE *)fd.inHandle); 
    94100                if (oldDesc == -1) 
    95101                { 
     
    109115                } 
    110116 
    111                 oldDesc = fileno(fd.outHandle); 
     117                oldDesc = fileno((FILE *)fd.outHandle); 
    112118                if (oldDesc == -1) 
    113119                { 
     
    135141        if (inHandle != NULL) 
    136142        { 
    137                 fclose(inHandle); 
     143                fclose((FILE *)inHandle); 
    138144        } 
    139145 
    140146        if (outHandle != NULL) 
    141147        { 
    142                 fclose(outHandle); 
     148                fclose((FILE *)outHandle); 
    143149        } 
    144150} 
     
    153159        if (inHandle != NULL) 
    154160        { 
    155                 if (fclose(inHandle) != 0) 
     161                if (fclose((FILE *)inHandle) != 0) 
    156162                { 
    157163                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_CLONE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    163169        if (outHandle != NULL) 
    164170        { 
    165                 if (fclose(outHandle) != 0) 
     171                if (fclose((FILE *)outHandle) != 0) 
    166172                { 
    167173                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_CLONE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    181187                int oldDesc, newDesc; 
    182188 
    183                 oldDesc = fileno(fd.inHandle); 
     189                oldDesc = fileno((FILE *)fd.inHandle); 
    184190                if (oldDesc == -1) 
    185191                { 
     
    199205                } 
    200206 
    201                 oldDesc = fileno(fd.outHandle); 
     207                oldDesc = fileno((FILE *)fd.outHandle); 
    202208                if (oldDesc == -1) 
    203209                { 
     
    231237        } 
    232238 
    233         return fileno(inHandle); 
     239        return fileno((FILE *)inHandle); 
    234240} 
    235241 
     
    246252        } 
    247253 
    248         return fileno(outHandle); 
     254        return fileno((FILE *)outHandle); 
    249255} 
    250256 
     
    263269        if (inHandle != NULL) 
    264270        { 
    265                 if (fclose(inHandle) != 0) 
     271                if (fclose((FILE *)inHandle) != 0) 
    266272                { 
    267273                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_CLOSE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    273279        if (outHandle != NULL) 
    274280        { 
    275                 if (fclose(outHandle) != 0) 
     281                if (fclose((FILE *)outHandle) != 0) 
    276282                { 
    277283                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_CLOSE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    300306        if (inHandle != NULL) 
    301307        { 
    302                 if (fclose(inHandle) != 0) 
     308                if (fclose((FILE *)inHandle) != 0) 
    303309                { 
    304310                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_OPEN, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    310316        if (outHandle != NULL) 
    311317        { 
    312                 if (fclose(outHandle) != 0) 
     318                if (fclose((FILE *)outHandle) != 0) 
    313319                { 
    314320                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_OPEN, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    368374                        while (true) 
    369375                        { 
    370                                 if ((n = fread(data, 1, batch, inHandle)) == 0) 
     376                                if ((n = fread(data, 1, batch, (FILE *)inHandle)) == 0) 
    371377                                { 
    372                                         if (feof(inHandle) != 0 || errno == EAGAIN) 
     378                                        if (feof((FILE *)inHandle) != 0 || errno == EAGAIN) 
    373379                                        { 
    374380                                                break; 
     
    380386                                        } 
    381387 
    382                                         if (ferror(inHandle) != 0) 
     388                                        if (ferror((FILE *)inHandle) != 0) 
    383389                                        { 
    384390                                                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    401407                        while (true) 
    402408                        { 
    403                                 if ((n = fread(data, 1, batch, inHandle)) == 0) 
     409                                if ((n = fread(data, 1, batch, (FILE *)inHandle)) == 0) 
    404410                                { 
    405                                         if (feof(inHandle) != 0 || errno == EAGAIN) 
     411                                        if (feof((FILE *)inHandle) != 0 || errno == EAGAIN) 
    406412                                        { 
    407413                                                break; 
     
    413419                                        } 
    414420 
    415                                         if (ferror(inHandle) != 0) 
     421                                        if (ferror((FILE *)inHandle) != 0) 
    416422                                        { 
    417423                                                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__READ, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    452458                        while (true) 
    453459                        { 
    454                                 if ((n = fwrite(data, 1, batch, outHandle)) == 0) 
     460                                if ((n = fwrite(data, 1, batch, (FILE *)outHandle)) == 0) 
    455461                                { 
    456462                                        if (errno == EINTR) 
     
    464470                                        } 
    465471 
    466                                         if (ferror(outHandle) != 0) 
     472                                        if (ferror((FILE *)outHandle) != 0) 
    467473                                        { 
    468474                                                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    485491                        while (true) 
    486492                        { 
    487                                 if ((n = fwrite(data, 1, batch, outHandle)) == 0) 
     493                                if ((n = fwrite(data, 1, batch, (FILE *)outHandle)) == 0) 
    488494                                { 
    489495                                        if (errno == EINTR) 
     
    497503                                        } 
    498504 
    499                                         if (ferror(outHandle) != 0) 
     505                                        if (ferror((FILE *)outHandle) != 0) 
    500506                                        { 
    501507                                                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__WRITE, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    524530        } 
    525531 
    526         if (fflush(outHandle) != 0) 
     532        if (fflush((FILE *)outHandle) != 0) 
    527533        { 
    528534                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX_FLUSH, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    548554        socklen_t len = sizeof(sockaddr_in6); 
    549555 
    550         int desc = fileno(inHandle); 
     556        int desc = fileno((FILE *)inHandle); 
    551557        if (desc == -1) 
    552558        { 
     
    634640        int desc; 
    635641 
    636         desc = fileno(inHandle); 
     642        desc = fileno((FILE *)inHandle); 
    637643        if (desc == -1) 
    638644        { 
     
    660666        } 
    661667 
    662         desc = fileno(outHandle); 
     668        desc = fileno((FILE *)outHandle); 
    663669        if (desc == -1) 
    664670        { 
     
    705711        while (true) 
    706712        { 
    707                 if (fgets(a_data, readSize, inHandle) == NULL) 
     713                if (fgets(a_data, readSize, (FILE *)inHandle) == NULL) 
    708714                { 
    709715                        if (errno == EINTR) 
     
    717723                        } 
    718724 
    719                         if (ferror(inHandle) != 0) 
     725                        if (ferror((FILE *)inHandle) != 0) 
    720726                        { 
    721727                                throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__READSTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
     
    749755                while (true) 
    750756                { 
    751                         if (fputc('\n', outHandle) == EOF) 
     757                        if (fputc('\n', (FILE *)outHandle) == EOF) 
    752758                        { 
    753759                                if (errno == EINTR) 
     
    761767                                } 
    762768 
    763                                 if (ferror(outHandle) != 0) 
     769                                if (ferror((FILE *)outHandle) != 0) 
    764770                                { 
    765771                                        throw exception::basic(exception::ERRMODULE_IOPIPE, PIPEEX__WRITESTREAM, exception::ERRNO_ERRNO, errno, strerror(errno), __LINE__, __FILE__); 
  • trunk/src/toolsLogger.cc

    r1162 r1183  
    6565                                   timeFormat(" %d/%m/%Y.%H-%M-%S: "), 
    6666                                   forward(false), 
    67                                    keeper(new pc::sync::process::section) 
     67                                   keeper(new pc::sync::process::section(0)) 
    6868{ 
    6969} 
  • trunk/tests/image_test/test.cc

    r1181 r1183  
    155155        catch (dodo::exception::basic ex) 
    156156        { 
    157                 cout << endl << ex.baseErrstr << endl << ex.line << endl << ex.baseErrno << endl; 
     157                cout << endl << ex.baseErrstr << endl << ex.line << endl << ex.baseErrno << endl << ex.getCallStack() <<  endl; 
    158158        } 
    159159 
Note: See TracChangeset for help on using the changeset viewer.