/* Appriximately the same as SCPreferencesGetSignature. */ static CFDataRef get_path_signature(const char * path) { struct stat sbuf; struct signature sig; zero_struct(sig); if (stat(path, &sbuf) == -1) { return NULL; } sig.sig_dev = sbuf.st_dev; sig.sig_ino = sbuf.st_ino; sig.sig_mtime = sbuf.st_mtimespec; sig.sig_ctime = sbuf.st_ctimespec; sig.sig_size = sbuf.st_size; return CFDataCreate(kCFAllocatorDefault, (const UInt8 *)(&sig), sizeof(struct signature)); }
Mutex::Mutex(){ zero_struct(this->mutex); InitializeCriticalSection(&this->mutex); }