亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? qfilesystemwatcher_inotify.cpp

?? QT 開發環境里面一個很重要的文件
?? CPP
字號:
/******************************************************************************** Copyright (C) 1992-2006 Trolltech ASA. All rights reserved.**** This file is part of the QtCore module of the Qt Toolkit.**** This file may be used under the terms of the GNU General Public** License version 2.0 as published by the Free Software Foundation** and appearing in the file LICENSE.GPL included in the packaging of** this file.  Please review the following information to ensure GNU** General Public Licensing requirements will be met:** http://www.trolltech.com/products/qt/opensource.html**** If you are unsure which license is appropriate for your use, please** review the following information:** http://www.trolltech.com/products/qt/licensing.html or contact the** sales department at sales@trolltech.com.**** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.******************************************************************************/#include "qfilesystemwatcher.h"#include "qfilesystemwatcher_inotify_p.h"#ifndef QT_NO_FILESYSTEMWATCHER#include <qdebug.h>#include <qfile.h>#include <qfileinfo.h>#include <qsocketnotifier.h>#include <qvarlengtharray.h>#include <sys/syscall.h>#include <sys/ioctl.h>#include <unistd.h>#include <fcntl.h>#if defined(QT_NO_INOTIFY)#include <linux/types.h>#if defined(__i386__)# define __NR_inotify_init      291# define __NR_inotify_add_watch 292# define __NR_inotify_rm_watch  293#elif defined(__x86_64__)# define __NR_inotify_init      253# define __NR_inotify_add_watch 254# define __NR_inotify_rm_watch  255#elif defined(__powerpc__) || defined(__powerpc64__)# define __NR_inotify_init      275# define __NR_inotify_add_watch 276# define __NR_inotify_rm_watch  277#elif defined (__ia64__)# define __NR_inotify_init      1277# define __NR_inotify_add_watch 1278# define __NR_inotify_rm_watch  1279#elif defined (__s390__) || defined (__s390x__)# define __NR_inotify_init      284# define __NR_inotify_add_watch 285# define __NR_inotify_rm_watch  286#elif defined (__alpha__)# define __NR_inotify_init      444# define __NR_inotify_add_watch 445# define __NR_inotify_rm_watch  446#elif defined (__sparc__) || defined (__sparc64__)# define __NR_inotify_init      151# define __NR_inotify_add_watch 152# define __NR_inotify_rm_watch  156#elif defined (__arm__)# define __NR_inotify_init      316# define __NR_inotify_add_watch 317# define __NR_inotify_rm_watch  318#elif defined (__SH4__)# define __NR_inotify_init      290# define __NR_inotify_add_watch 291# define __NR_inotify_rm_watch  292#elif defined (__SH5__)# define __NR_inotify_init      318# define __NR_inotify_add_watch 319# define __NR_inotify_rm_watch  320#elif defined (__mips__)# define __NR_inotify_init      284# define __NR_inotify_add_watch 285# define __NR_inotify_rm_watch  286#elif defined (__hppa__)# define __NR_inotify_init      269# define __NR_inotify_add_watch 270# define __NR_inotify_rm_watch  271#else# error "This architecture is not supported. Please talk to qt-bugs@trolltech.com"#endif#ifdef QT_LSB// ### the LSB doesn't standardize syscall, need to wait until glib2.4 is standardizedstatic inline int syscall(...) { return -1; }#endifstatic inline int inotify_init(){    return syscall(__NR_inotify_init);}static inline int inotify_add_watch(int fd, const char *name, __u32 mask){    return syscall(__NR_inotify_add_watch, fd, name, mask);}static inline int inotify_rm_watch(int fd, __u32 wd){    return syscall(__NR_inotify_rm_watch, fd, wd);}// from linux/inotify.h// ---------- inotify.h begin -------// Copyright (C) 2005 John McCutchanextern "C" {/* * struct inotify_event - structure read from the inotify device for each event * * When you are watching a directory, you will receive the filename for events * such as IN_CREATE, IN_DELETE, IN_OPEN, IN_CLOSE, ..., relative to the wd. */struct inotify_event {        __s32           wd;             /* watch descriptor */        __u32           mask;           /* watch mask */        __u32           cookie;         /* cookie to synchronize two events */        __u32           len;            /* length (including nulls) of name */        char            name[0];        /* stub for possible name */};/* the following are legal, implemented events that user-space can watch for */#define IN_ACCESS               0x00000001      /* File was accessed */#define IN_MODIFY               0x00000002      /* File was modified */#define IN_ATTRIB               0x00000004      /* Metadata changed */#define IN_CLOSE_WRITE          0x00000008      /* Writtable file was closed */#define IN_CLOSE_NOWRITE        0x00000010      /* Unwrittable file closed */#define IN_OPEN                 0x00000020      /* File was opened */#define IN_MOVED_FROM           0x00000040      /* File was moved from X */#define IN_MOVED_TO             0x00000080      /* File was moved to Y */#define IN_CREATE               0x00000100      /* Subfile was created */#define IN_DELETE               0x00000200      /* Subfile was deleted */#define IN_DELETE_SELF          0x00000400      /* Self was deleted */#define IN_MOVE_SELF            0x00000800      /* Self was moved *//* the following are legal events.  they are sent as needed to any watch */#define IN_UNMOUNT              0x00002000      /* Backing fs was unmounted */#define IN_Q_OVERFLOW           0x00004000      /* Event queued overflowed */#define IN_IGNORED              0x00008000      /* File was ignored *//* helper events */#define IN_CLOSE                (IN_CLOSE_WRITE | IN_CLOSE_NOWRITE) /* close */#define IN_MOVE                 (IN_MOVED_FROM | IN_MOVED_TO) /* moves *//* special flags */#define IN_MASK_ADD             0x20000000#define IN_ISDIR                0x40000000      /* event occurred against dir */#define IN_ONESHOT              0x80000000      /* only send event once *//* * All of the events - we build the list by hand so that we can add flags in * the future and not break backward compatibility.  Apps will get only the * events that they originally wanted.  Be sure to add new events here! */#define IN_ALL_EVENTS   (IN_ACCESS | IN_MODIFY | IN_ATTRIB | IN_CLOSE_WRITE | \                         IN_CLOSE_NOWRITE | IN_OPEN | IN_MOVED_FROM | \                         IN_MOVED_TO | IN_DELETE | IN_CREATE | IN_DELETE_SELF | \                         IN_MOVE_SELF)}// --------- inotify.h end ----------#else /* QT_NO_INOTIFY */#include <sys/inotify.h>#endifQInotifyFileSystemWatcherEngine *QInotifyFileSystemWatcherEngine::create(){    int fd = inotify_init();    if (fd <= 0)        return 0;    return new QInotifyFileSystemWatcherEngine(fd);}QInotifyFileSystemWatcherEngine::QInotifyFileSystemWatcherEngine(int fd)    : inotifyFd(fd){    fcntl(inotifyFd, F_SETFD, FD_CLOEXEC);    moveToThread(this);}QInotifyFileSystemWatcherEngine::~QInotifyFileSystemWatcherEngine(){    foreach (int id, pathToID.values())        inotify_rm_watch(inotifyFd, id < 0 ? -id : id);    ::close(inotifyFd);}void QInotifyFileSystemWatcherEngine::run(){    QSocketNotifier sn(inotifyFd, QSocketNotifier::Read, this);    connect(&sn, SIGNAL(activated(int)), SLOT(readFromInotify()));    (void) exec();}QStringList QInotifyFileSystemWatcherEngine::addPaths(const QStringList &paths,                                                      QStringList *files,                                                      QStringList *directories){    QMutexLocker locker(&mutex);    QStringList p = paths;    QMutableListIterator<QString> it(p);    while (it.hasNext()) {        QString path = it.next();        QFileInfo fi(path);        bool isDir = fi.isDir();        if (isDir) {            if (directories->contains(path))                continue;        } else {            if (files->contains(path))                continue;        }        int wd = inotify_add_watch(inotifyFd,                                   QFile::encodeName(path),                                   (isDir                                    ? (0                                       | IN_ATTRIB                                       | IN_MOVE                                       | IN_CREATE                                       | IN_DELETE                                       | IN_DELETE_SELF                                       )                                    : (0                                       | IN_ATTRIB                                       | IN_MODIFY                                       | IN_MOVE                                       | IN_DELETE_SELF                                       )));        if (wd <= 0) {            perror("QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed");            continue;        }        it.remove();        int id = isDir ? -wd : wd;        if (id < 0) {            directories->append(path);        } else {            files->append(path);        }        pathToID.insert(path, id);        idToPath.insert(id, path);    }    start();    return p;}QStringList QInotifyFileSystemWatcherEngine::removePaths(const QStringList &paths,                                                         QStringList *files,                                                         QStringList *directories){    QMutexLocker locker(&mutex);    QStringList p = paths;    QMutableListIterator<QString> it(p);    while (it.hasNext()) {        QString path = it.next();        int id = pathToID.take(path);        QString x = idToPath.take(id);        if (x.isEmpty() || x != path)            continue;        int wd = id < 0 ? -id : id;        // qDebug() << "removing watch for path" << path << "wd" << wd;        inotify_rm_watch(inotifyFd, wd);        it.remove();        if (id < 0) {            directories->removeAll(path);        } else {            files->removeAll(path);        }    }    return p;}void QInotifyFileSystemWatcherEngine::stop(){    QMetaObject::invokeMethod(this, "quit");}void QInotifyFileSystemWatcherEngine::readFromInotify(){    QMutexLocker locker(&mutex);    // qDebug() << "QInotifyFileSystemWatcherEngine::readFromInotify";    int buffSize = 0;    ioctl(inotifyFd, FIONREAD, &buffSize);    QVarLengthArray<char, 4096> buffer(buffSize);    buffSize = read(inotifyFd, buffer.data(), buffSize);    inotify_event *ev = reinterpret_cast<inotify_event *>(buffer.data());    inotify_event *end = reinterpret_cast<inotify_event *>(buffer.data() + buffSize);    while (ev < end) {        // qDebug() << "inotify event, wd" << ev->wd << "mask" << hex << ev->mask;        int id = ev->wd;        QString path = idToPath.value(id);        if (path.isEmpty()) {            // perhaps a directory?            id = -id;            path = idToPath.value(id);            if (path.isEmpty()) {                ev += sizeof(inotify_event) + ev->len;                continue;            }        }        // qDebug() << "event for path" << path;        if ((ev->mask & (IN_DELETE_SELF | IN_UNMOUNT)) != 0) {            pathToID.remove(path);            idToPath.remove(id);            inotify_rm_watch(inotifyFd, ev->wd);            if (id < 0)                emit directoryChanged(path, true);            else                emit fileChanged(path, true);        } else {            if (id < 0)                emit directoryChanged(path, false);            else                emit fileChanged(path, false);        }        ev += sizeof(inotify_event) + ev->len;    }}#endif // QT_NO_FILESYSTEMWATCHER

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
xnxx国产精品| 亚洲综合视频在线| 亚洲精品乱码久久久久久久久| 国产精品久久久久久久久久久免费看 | 免费成人在线视频观看| 日韩高清电影一区| 国产酒店精品激情| 欧美亚洲高清一区二区三区不卡| 欧美精品v日韩精品v韩国精品v| 精品捆绑美女sm三区| 国产精品久久久久影院色老大| 亚洲综合视频在线观看| 国产一区二区精品久久99| 97国产一区二区| 日韩精品在线看片z| 亚洲三级在线免费观看| 水蜜桃久久夜色精品一区的特点| 国产综合成人久久大片91| 色天天综合色天天久久| 欧美va亚洲va国产综合| 亚洲毛片av在线| 国产精品一区专区| 777a∨成人精品桃花网| 国产精品视频麻豆| 麻豆视频观看网址久久| 97久久超碰精品国产| 欧美成人一级视频| 亚洲精品久久久久久国产精华液| 毛片av一区二区三区| 在线看日韩精品电影| 国产精品另类一区| 韩国女主播一区二区三区| 欧美日韩国产欧美日美国产精品| 欧美高清在线一区| 日本不卡不码高清免费观看| 日本乱人伦一区| 欧美国产精品一区二区三区| 久久www免费人成看片高清| 欧美性生交片4| 久久众筹精品私拍模特| 婷婷综合另类小说色区| 91国偷自产一区二区开放时间 | 国产精品麻豆欧美日韩ww| 青青草91视频| 4438x成人网最大色成网站| 一区二区高清在线| 色综合久久久久网| 亚洲欧美日韩在线| www.日韩在线| 国产人伦精品一区二区| 秋霞电影一区二区| 欧美一区中文字幕| 日本不卡在线视频| 717成人午夜免费福利电影| 亚洲小说春色综合另类电影| 91丝袜高跟美女视频| 国产精品乱人伦| 色网综合在线观看| 一区二区三区国产精品| 欧美人妖巨大在线| 另类小说色综合网站| 久久免费电影网| 色一情一伦一子一伦一区| 日韩精品一二三区| 国产视频一区二区在线观看| 成人av网站免费观看| 性感美女久久精品| 久久久精品一品道一区| 一本色道久久综合亚洲aⅴ蜜桃| 亚洲成人一区在线| 国产欧美综合在线观看第十页| 在线免费观看日韩欧美| 加勒比av一区二区| 亚洲三级在线观看| 精品久久人人做人人爽| 色噜噜夜夜夜综合网| 国内国产精品久久| 亚洲国产日韩av| 欧美高清在线视频| 欧美一级淫片007| 91色porny| 韩国成人精品a∨在线观看| 亚洲一区二区三区四区在线 | 欧美色精品在线视频| 久久99久久99| 亚洲韩国精品一区| 国产欧美日韩激情| 欧美一区二区福利在线| 色美美综合视频| 成人精品国产一区二区4080| 蜜臀av性久久久久蜜臀aⅴ四虎 | 婷婷丁香久久五月婷婷| 国产精品午夜电影| 久久人人97超碰com| 欧美丰满美乳xxx高潮www| 99久久国产综合精品麻豆| 久久99精品久久久久久动态图 | 91久久人澡人人添人人爽欧美| 久久国产夜色精品鲁鲁99| 亚洲成a人片在线观看中文| 亚洲色图欧洲色图| 国产精品免费视频观看| 久久久电影一区二区三区| 日韩精品一区二区三区视频播放 | 99久久夜色精品国产网站| 韩国精品免费视频| 精彩视频一区二区三区| 久久精品国产一区二区三区免费看| 亚洲一区二区五区| 一区二区三区四区在线播放| 亚洲欧洲日产国产综合网| 中文av字幕一区| 国产精品免费人成网站| 国产精品天干天干在线综合| 精品成人在线观看| 久久欧美中文字幕| 久久无码av三级| 久久久三级国产网站| 久久久99精品久久| ww亚洲ww在线观看国产| 日韩色在线观看| 91精品国产综合久久福利软件 | 国产欧美一区二区三区在线看蜜臀 | 国产精品不卡一区| 中文字幕永久在线不卡| 亚洲视频一区在线观看| 亚洲欧美激情在线| 一区二区三区在线视频免费| 亚洲欧美综合色| 亚洲视频在线一区二区| 一区二区三区在线免费播放| 亚洲午夜久久久久中文字幕久| 亚洲一区日韩精品中文字幕| 亚洲另类春色国产| 亚洲一区二区三区在线看| 天天色图综合网| 紧缚奴在线一区二区三区| 国产成人精品一区二区三区四区 | 久久精品国产99国产| 国产精品综合av一区二区国产馆| 国产盗摄女厕一区二区三区 | 激情伊人五月天久久综合| 美女mm1313爽爽久久久蜜臀| 久久99国产精品久久99果冻传媒| 极品尤物av久久免费看| 波多野结衣亚洲| 欧美偷拍一区二区| 日韩欧美国产三级电影视频| 国产亚洲精品免费| 亚洲欧美日韩人成在线播放| 亚洲不卡av一区二区三区| 韩日av一区二区| 99这里都是精品| 91精品国产色综合久久不卡电影| 久久先锋资源网| 一区二区三区久久| 国产精品自拍av| 欧美日韩精品三区| 2021中文字幕一区亚洲| 亚洲人成在线播放网站岛国| 免费看黄色91| 91蝌蚪porny成人天涯| 日韩三级视频在线看| 亚洲欧美另类久久久精品2019| 美美哒免费高清在线观看视频一区二区| 成人伦理片在线| 日韩一区二区三区在线视频| 国产精品国产三级国产普通话三级 | 亚洲图片激情小说| 精品无人区卡一卡二卡三乱码免费卡| 91丝袜高跟美女视频| 久久久久国产精品麻豆ai换脸| 亚洲国产aⅴ成人精品无吗| 国产成人在线看| 91精品国产综合久久福利软件| 亚洲丝袜美腿综合| 国产91精品一区二区| 欧美一区二区三区人| 国内精品伊人久久久久av一坑 | 亚洲免费观看高清完整版在线| 麻豆精品精品国产自在97香蕉 | 亚洲午夜国产一区99re久久| 国产一区二区三区免费在线观看 | 不卡高清视频专区| 精品国产伦一区二区三区免费| 午夜久久久久久久久久一区二区| 蜜臀国产一区二区三区在线播放| k8久久久一区二区三区| 精品久久一二三区| 日本伊人午夜精品| 欧美性大战久久| 日韩理论电影院| av午夜精品一区二区三区| 国产精品拍天天在线| 床上的激情91.| 国产精品青草综合久久久久99| 国产自产视频一区二区三区| 日韩免费观看高清完整版在线观看| 日韩成人免费看| 91精品国模一区二区三区|