2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek#pragma once
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek/***
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek This file is part of systemd.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek Copyright 2014 Zbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek systemd is free software; you can redistribute it and/or modify it
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek under the terms of the GNU Lesser General Public License as published by
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek the Free Software Foundation; either version 2.1 of the License, or
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek (at your option) any later version.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek systemd is distributed in the hope that it will be useful, but
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek WITHOUT ANY WARRANTY; without even the implied warranty of
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek Lesser General Public License for more details.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek You should have received a copy of the GNU Lesser General Public License
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek along with systemd; If not, see <http://www.gnu.org/licenses/>.
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek***/
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
a8fbdf5424be099ba1b2b1ec261c02b8759d6b0cThomas Hindoe Paaboel Andersen#include "hashmap.h"
f5a4b0d3534bb13ef734a857647ab04be236c6f3Thomas Hindoe Paaboel Andersen#include "macro.h"
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek#include "set.h"
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek#include "unit-name.h"
f5a4b0d3534bb13ef734a857647ab04be236c6f3Thomas Hindoe Paaboel Andersen
8eea868708923a092ee85d6146ba4c04b7baea06Zbigniew Jędrzejewski-Szmekint drop_in_file(const char *dir, const char *unit, unsigned level,
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek const char *name, char **_p, char **_q);
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
8eea868708923a092ee85d6146ba4c04b7baea06Zbigniew Jędrzejewski-Szmekint write_drop_in(const char *dir, const char *unit, unsigned level,
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek const char *name, const char *data);
2968644080fd103062f070e83edd620e0a58c44dZbigniew Jędrzejewski-Szmek
8eea868708923a092ee85d6146ba4c04b7baea06Zbigniew Jędrzejewski-Szmekint write_drop_in_format(const char *dir, const char *unit, unsigned level,
f5a4b0d3534bb13ef734a857647ab04be236c6f3Thomas Hindoe Paaboel Andersen const char *name, const char *format, ...) _printf_(5, 6);
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek/**
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek * This callback will be called for each directory entry @entry,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek * with @filepath being the full path to the entry.
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek *
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek * If return value is negative, loop will be aborted.
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek */
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmektypedef int (*dependency_consumer_t)(UnitDependency dependency,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek const char *entry,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek const char* filepath,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek void *arg);
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmekint unit_file_process_dir(
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek Set * unit_path_cache,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek const char *unit_path,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek const char *name,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek const char *suffix,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek UnitDependency dependency,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek dependency_consumer_t consumer,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek void *arg,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek char ***strv);
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmekint unit_file_find_dropin_paths(
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek char **lookup_path,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek Set *unit_path_cache,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek Set *names,
1a7f1b385cd9de8a0da934fadc379860f914ef33Zbigniew Jędrzejewski-Szmek char ***paths);