2024-08-19 19:06:49 +02:00
|
|
|
/**
|
|
|
|
* sci - a simple ci system
|
|
|
|
Copyright (C) 2024 Asger Gitz-Johansen
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2024-08-02 19:11:12 +02:00
|
|
|
#ifndef SCI_NOTIFY_H
|
|
|
|
#define SCI_NOTIFY_H
|
2024-08-03 13:08:46 +02:00
|
|
|
#include "pipeline.h"
|
2024-08-02 19:11:12 +02:00
|
|
|
#include <sys/inotify.h>
|
|
|
|
|
2024-08-03 13:08:46 +02:00
|
|
|
typedef void(*notify_callback)(pipeline_event* const);
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
// Start listening for changes to the provided file.
|
|
|
|
// Note that the `struct inotify_event*` provided is a managed pointer.
|
2024-08-03 13:08:46 +02:00
|
|
|
void listen_for_changes(const pipeline_conf* config, notify_callback callback);
|
2024-08-02 19:11:12 +02:00
|
|
|
|
|
|
|
#endif
|