mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-13 15:41:50 -05:00
f715ea6347
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2756 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
35 lines
885 B
C++
35 lines
885 B
C++
#include <QDebug>
|
|
#include <qsharedmemory.h>
|
|
#include <QSystemSemaphore>
|
|
|
|
QSharedMemory mem_jt9("mem_jt9");
|
|
QSystemSemaphore sem_jt9("sem_jt9", 1, QSystemSemaphore::Open);
|
|
|
|
extern "C" {
|
|
bool attach_jt9_();
|
|
bool create_jt9_(int nsize);
|
|
bool detach_jt9_();
|
|
bool lock_jt9_();
|
|
bool unlock_jt9_();
|
|
char* address_jt9_();
|
|
int size_jt9_();
|
|
|
|
bool acquire_jt9_();
|
|
bool release_jt9_();
|
|
|
|
extern struct {
|
|
char c[10];
|
|
} jt9com_;
|
|
}
|
|
|
|
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();}
|
|
|
|
bool acquire_jt9_() {return sem_jt9.acquire();}
|
|
bool release_jt9_() {return sem_jt9.release();}
|