Skip to content
pi-c Artifact [3cbe7d7b69]
Login

Artifact [3cbe7d7b69]

Artifact 3cbe7d7b69466f555b2a64857371607513a1defae1c66e0ddf3962e058ea3eed:


/* The workspace's .pic folder: it keeps itself out of version control, and says when a fossil or
 * zit checkout would pick it up anyway (docs/dev/durability.md). */
#ifndef PIC_FOLDER_H
#define PIC_FOLDER_H

#include <stddef.h>

/* Writes DIR/.gitignore holding "*" when DIR (a workspace's .pic) has none. Never touches the
 * project's own ignore files. 1 when it wrote the file; 0 when one was there, or on a platform
 * with no filesystem. */
int pic_folder_seal(const char *dir);

/* In a fossil or zit checkout above DIR (a workspace's .pic), makes sure the project's own ignore
 * rules cover it: adds ".pic/" (relative to the checkout root) to the root .zitignore, or
 * the glob .pic/ then a star, to .fossil-settings/ignore-glob, once, creating the file when absent and leaving every
 * other line as it is. A fossil repository that holds its own ignore-glob setting is not given a
 * file that would replace it. 1 when it added the line (OUT says what and where); -1 when it could
 * not and FIRST is set (OUT is the plain warning with the exact line); 0 otherwise, and on a
 * platform with no filesystem. */
int pic_folder_vcs(const char *dir, int first, char *out, size_t cap);

/* One line per version control present (git, and zit or fossil) saying whether .pic/ is covered,
 * and the fix when not; lines are separated by newlines. 1 when there is any, else 0 and "". */
int pic_folder_report(const char *dir, char *out, size_t cap);

#endif