agendafs
A filesystem for your calendar.
git clone git://mccd.space/agendafscommit 01fe88ba8d6fc0bc990b446a94c0d3a55e2e4324
parent 97a34c3d98a936d1a33fd19d9068e934dd075b08
Author: Marc Coquand <marc@coquand.email>
Date: Sun, 1 Jun 2025 21:28:03 +0100
get rid of static keyword
Diffstat:
| M | main.c | | | 32 | ++++++++++++++++---------------- |
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/main.c b/main.c
@@ -64,7 +64,7 @@ free_journal_entry(void *val)
free(entry);
}
-static time_t
+time_t
parse_datetime(const char *datetime)
{
struct tm tm = {0};
@@ -82,7 +82,7 @@ parse_datetime(const char *datetime)
}
// Folds are [\r]\n followed by ' ' or '\t'
-static int
+int
skip_fold(const char *p)
{
// '\r\n' + ' ' OR '\t'
@@ -134,7 +134,7 @@ extract_ical_field(const char *ical, const char *field_name)
return final;
}
-static int
+int
compile_regexes(regex_t *regex_dtstamp, regex_t *regex_lastmod,
regex_t *regex_fuse_file)
{
@@ -151,7 +151,7 @@ compile_regexes(regex_t *regex_dtstamp, regex_t *regex_lastmod,
}
// Extracts the matched text from regexp
-static char *
+char *
extract_match(const char *content, regmatch_t match)
{
size_t len = match.rm_eo - match.rm_so;
@@ -163,7 +163,7 @@ extract_match(const char *content, regmatch_t match)
// RFC 5545 specifies how human-readable text is escaped
// https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.11
-static void
+void
unescape_text(char *desc)
{
char *src = desc;
@@ -206,7 +206,7 @@ done:
// RFC 5545 specifies how human-readable text is escaped
// https://datatracker.ietf.org/doc/html/rfc5545#section-3.3.11
-static char *
+char *
escape_text(const char *src)
{
size_t len = strlen(src);
@@ -258,7 +258,7 @@ escape_text(const char *src)
return realloc(escaped, actual_len);
}
-static journal_entry *
+journal_entry *
get_entry_from_fuse_path(const char *path)
{
if (!path || path[0] != '/') {
@@ -279,7 +279,7 @@ get_entry_from_fuse_path(const char *path)
return entry;
}
-static int
+int
parse_ics_file(const char *file_path, journal_entry *entry)
{
FILE *file = fopen(file_path, "r");
@@ -426,7 +426,7 @@ get_unique_filename(time_t created_at, struct hashmap *entries_map)
// entries_original_key
// entries_fuse_key
// Should only be run once
-static void
+void
load_journal_entries()
{
pthread_mutex_lock(&entries_mutex);
@@ -580,7 +580,7 @@ unlock_and_return:
return ret_code;
}
-static int
+int
journal_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi,
enum fuse_readdir_flags flags)
@@ -604,7 +604,7 @@ journal_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
return 0;
}
-static int
+int
journal_open(const char *path, struct fuse_file_info *fi)
{
pthread_mutex_lock(&entries_mutex);
@@ -615,7 +615,7 @@ journal_open(const char *path, struct fuse_file_info *fi)
return ret;
}
-static int
+int
journal_read(const char *path, char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
@@ -766,7 +766,7 @@ get_original_filepath(const journal_entry *entry)
return filepath;
}
-static int
+int
journal_write(const char *path, const char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
@@ -852,7 +852,7 @@ timestamp_from_filename(const char *filename)
return timestamp;
}
-static int
+int
do_journal_entry_rename(time_t new_created_at, const char *old, const char *new)
{
const char *old_basename = strrchr(old, '/');
@@ -893,7 +893,7 @@ do_journal_entry_rename(time_t new_created_at, const char *old, const char *new)
}
// Aka remove or delete
-static int
+int
journal_unlink(const char *file)
{
pthread_mutex_lock(&entries_mutex);
@@ -939,7 +939,7 @@ journal_unlink(const char *file)
return 0;
}
-static int
+int
journal_rename(const char *old, const char *new, unsigned int flags)
{
pthread_mutex_lock(&entries_mutex);