File: ipcomm.cpp

package info (click to toggle)
wsjtx 2.7.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,440 kB
  • sloc: cpp: 75,379; f90: 46,460; python: 27,241; ansic: 13,367; fortran: 2,382; makefile: 197; sh: 133
file content (34 lines) | stat: -rwxr-xr-x 885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <QDebug>
#include <qsharedmemory.h>
#include <QSystemSemaphore>

QSharedMemory mem_m65("mem_m65");
QSystemSemaphore sem_m65("sem_m65", 1, QSystemSemaphore::Open);

extern "C" {
  bool attach_m65_();
  bool create_m65_(int nsize);
  bool detach_m65_();
  bool lock_m65_();
  bool unlock_m65_();
  char* address_m65_();
  int size_m65_();

  bool acquire_m65_();
  bool release_m65_();

  extern struct {
    char c[10];
  } m65com_;
}

bool attach_m65_() {return mem_m65.attach();}
bool create_m65_(int nsize) {return mem_m65.create(nsize);}
bool detach_m65_() {return mem_m65.detach();}
bool lock_m65_() {return mem_m65.lock();}
bool unlock_m65_() {return mem_m65.unlock();}
char* address_m65_() {return (char*)mem_m65.constData();}
int size_m65_() {return (int)mem_m65.size();}

bool acquire_m65_() {return sem_m65.acquire();}
bool release_m65_() {return sem_m65.release();}