This repository has been archived on 2025-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
yachat/qcm/dnotify.qcm
2025-12-25 01:38:25 +05:00

44 lines
1,018 B
Text

/*
-----BEGIN QCMOD-----
name: Linux Directory Notification
-----END QCMOD-----
*/
#include<unistd.h>
#include<fcntl.h>
#include<signal.h>
#include<sys/utsname.h>
//----------------------------------------------------------------------------
// qc_dnotify
//----------------------------------------------------------------------------
class qc_dnotify : public ConfObj
{
public:
qc_dnotify(Conf *c) : ConfObj(c) { }
QString name() const { return "Linux Directory Notification"; }
QString shortname() const { return "dnotify"; }
bool exec()
{
QString str =
"#define _GNU_SOURCE\n"
"#include<unistd.h>\n"
"#include<fcntl.h>\n"
"#include<signal.h>\n"
"#include<sys/utsname.h>\n"
"\n"
"int main()\n"
"{\n"
" DN_DELETE|DN_CREATE|DN_RENAME|DN_MULTISHOT|DN_MODIFY|DN_ATTRIB;\n"
" return 0;\n"
"}\n";
int ret;
if (!conf->doCompileAndLink(str, QStringList(), QString(), QString(), &ret) || ret != 0)
return false;
conf->addDefine("HAVE_DNOTIFY");
return true;
}
};