libHartwer - Documentation

bcs_general.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (c) 2008-2011 Marius Zwicker / Elefant Racing Bayreuth. 
00003 * All rights reserved.
00004 *
00005 * @ERB_OPEN_LICENSE_HEADER_START@
00006 *
00007 * Licensed under the Apache License, Version 2.0 (the "License");
00008 * you may not use this file except in compliance with the License.
00009 * You may obtain a copy of the License at
00010 * 
00011 *     http://www.apache.org/licenses/LICENSE-2.0
00012 * 
00013 * Unless required by applicable law or agreed to in writing, software
00014 * distributed under the License is distributed on an "AS IS" BASIS,
00015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00016 * See the License for the specific language governing permissions and
00017 * limitations under the License.
00018 *
00019 *      http://www.elefantracing.de
00020 *
00021 * @ERB_OPEN_LICENSE_HEADER_END@
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 /* BCS_GENERAL_H_ */

Generated on Fri Feb 11 2011 18:25:46 for libHartwer by Doxygen 1.7.3
Content © 2009-2011 Elefant Racing Bayreuth & MLBA (About) – Design © 2010 Emzeat. All Rights reserved.