2012-05-22 13:09:48 -04:00
|
|
|
#include <QDebug>
|
|
|
|
#include <qsharedmemory.h>
|
|
|
|
#include <QSystemSemaphore>
|
|
|
|
|
2012-11-21 12:42:53 -05:00
|
|
|
QSharedMemory mem_jt9("mem_jt9");
|
|
|
|
QSystemSemaphore sem_jt9("sem_jt9", 1, QSystemSemaphore::Open);
|
2012-05-22 13:09:48 -04:00
|
|
|
|
|
|
|
extern "C" {
|
2012-11-21 12:42:53 -05:00
|
|
|
bool attach_jt9_();
|
|
|
|
bool create_jt9_(int nsize);
|
|
|
|
bool detach_jt9_();
|
|
|
|
bool lock_jt9_();
|
|
|
|
bool unlock_jt9_();
|
|
|
|
char* address_jt9_();
|
|
|
|
int size_jt9_();
|
2012-05-22 13:09:48 -04:00
|
|
|
|
2012-11-21 12:42:53 -05:00
|
|
|
bool acquire_jt9_();
|
|
|
|
bool release_jt9_();
|
2012-05-22 13:09:48 -04:00
|
|
|
|
|
|
|
extern struct {
|
|
|
|
char c[10];
|
2012-11-21 12:42:53 -05:00
|
|
|
} jt9com_;
|
2012-05-22 13:09:48 -04:00
|
|
|
}
|
|
|
|
|
2012-11-21 12:42:53 -05:00
|
|
|
bool attach_jt9_() {return mem_jt9.attach();}
|
|
|
|
bool create_jt9_(int nsize) {return mem_jt9.create(nsize);}
|
|
|
|
bool detach_jt9_() {return mem_jt9.detach();}
|
|
|
|
bool lock_jt9_() {return mem_jt9.lock();}
|
|
|
|
bool unlock_jt9_() {return mem_jt9.unlock();}
|
|
|
|
char* address_jt9_() {return (char*)mem_jt9.constData();}
|
|
|
|
int size_jt9_() {return (int)mem_jt9.size();}
|
2012-05-22 13:09:48 -04:00
|
|
|
|
2012-11-21 12:42:53 -05:00
|
|
|
bool acquire_jt9_() {return sem_jt9.acquire();}
|
|
|
|
bool release_jt9_() {return sem_jt9.release();}
|