Skip to content
suit Artifact [fed174046b]
Login

Artifact [fed174046b]

Artifact fed174046bdd690a63029ef4110b5cbf269450ed40a5c7257cdbcf8784d74bb1:


#ifndef SUIT_WARDROBES_H
#define SUIT_WARDROBES_H

#include "conf.h"

// The wardrobes that take part in placing: every folder directly under
// $SUIT_HOME/store with a valid name that does not start with "." and holds a
// regular file suit.conf (docs/conf-format.md, "More than one wardrobe").

// Find them in SUIT_HOME's store, in byte order of name. Returns 0; 1 after a
// message when the store or a suit.conf cannot be looked at; 2 after a message
// when more than WARDROBE_MAX wardrobes have a suit.conf or none does.
int wardrobes_find(Wards *w, const char *suit_home);

// wardrobes_find, except that with SAY_NONE false it says nothing when no
// wardrobe has a suit.conf (it still returns 2, with W->n 0).
int wardrobes_look(Wards *w, const char *suit_home, bool say_none);

// Read every wardrobe's config of W into the combined set C and check it as one.
// Returns 0, or 1 after a message `FILE:LINE: what` naming the wardrobe's file.
int wardrobes_load(const Wards *w, Conf *c);

#endif