Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00032 #ifndef BCS_GENERAL_H_
00033 #define BCS_GENERAL_H_
00034
00035 #ifndef GLOBAL_H_
00036 #include "bcs_global.h"
00037 #endif
00038
00039 #include "bcs_configuration.h"
00040
00041 #include "bcs_errorcodes.h"
00042
00047 #ifdef USE_POSIX_SEM
00048 #include <semaphore.h>
00049 typedef sem_t* BCS_Semaphore;
00050 #endif
00051 #ifdef USE_SYSV_SEM
00052 #include <sys/types.h>
00053 #include <sys/ipc.h>
00054 #include <sys/sem.h>
00055 typedef int BCS_Semaphore;
00056 #endif
00057
00058
00062 #if defined USE_POSIX_QUEUE
00063 #include <mqueue.h>
00064 typedef struct {
00065 mqd_t _qc;
00066 UInt16 _size;
00067 UInt32 _id;
00068 } BCS_Queue;
00069 #else
00070 #ifdef USE_SYSV_QUEUE
00071 #include <sys/types.h>
00072 #include <sys/ipc.h>
00073 #include <sys/msg.h>
00074 typedef struct {
00075 int _qc;
00076 UInt16 _size;
00077 UInt32 _id;
00078 } BCS_Queue;
00079 #else
00080 typedef struct {
00081 void* _qc;
00082 UInt16 _size;
00083 UInt32 _id;
00084 BCS_Semaphore _mutex;
00085 BCS_Semaphore _write;
00086 BCS_Semaphore _read;
00087 } BCS_Queue;
00088 #endif
00089 #endif
00090
00094 typedef struct {
00095 Int32 _fd;
00096 BCS_Queue _sim;
00097 UInt8 _flags;
00098 } BCS_canport;
00099
00103 typedef struct {
00104 Int32 _fd;
00105 UInt8 _last;
00106 UInt8* _pVirtual;
00107 UInt8 _mPort;
00108 UInt8 _mask;
00109 } BCS_ioport;
00110
00114 typedef struct {
00115 Int32 _fd;
00116 BCS_Queue _sim;
00117 } BCS_comport;
00118
00119 struct _bcs_ff_item {
00120 struct _bcs_ff_item* next;
00121 struct _bcs_ff_item* previous;
00122 void* dt;
00123 };
00124
00128 typedef struct {
00129 struct _bcs_ff_item* first;
00130 struct _bcs_ff_item* last;
00131 pthread_mutex_t acc;
00132 pthread_mutex_t sign;
00133 pthread_cond_t cond;
00134 UInt8 used;
00135 } BCS_FF_queue;
00136
00137 #endif