123456789101112131415161718192021222324252627 |
- #include <QCoreApplication>
- #include "ytdhcam.h"
- #include "ytdhcamcore.h"
- SysConfShm *sysConfShm;
- bool load_shm(){
- int shmid;
- key_t key;
- if((key = ftok(SHM_PATH,static_cast<int>(SHM_PORT)))==-1)
- return false;
- if((shmid = shmget(key,sizeof(SysConfShm),IPC_CREAT|0666))==-1)
- return false;
- sysConfShm = static_cast<SysConfShm *>(shmat(shmid,nullptr,0));
- return true;
- }
- int main(int argc, char *argv[])
- {
- QCoreApplication a(argc, argv);
- if(load_shm()){
- ytDHCamCore *core = new ytDHCamCore(nullptr);
- core->start();
- }
- return a.exec();
- }
|