[glick2] fs: make static functions static
- From: Alexander Larsson <alexl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glick2] fs: make static functions static
- Date: Fri, 21 Oct 2011 06:36:24 +0000 (UTC)
commit c1be080c1b0b0903760aad37f85f75ae650e88b4
Author: Stefan Sauer <ensonic users sf net>
Date: Mon Oct 17 13:36:04 2011 +0200
fs: make static functions static
fs.c | 98 +++++++++++++++++++++++++++++++++--------------------------------
1 files changed, 50 insertions(+), 48 deletions(-)
---
diff --git a/fs.c b/fs.c
index a8ff47e..1e53848 100644
--- a/fs.c
+++ b/fs.c
@@ -226,29 +226,29 @@ static GlickTrigger builtin_public_triggers[] = {
}
};
-const char *glick_slice_lookup_string (GlickSlice *slice, size_t offset);
-GlickSliceInode * glick_slice_lookup_path (GlickSlice *slice, const char *path, guint32 path_hash, guint32 *inode_num);
-GlickSliceInode * glick_mount_lookup_path (GlickMount *mount, const char *path, GlickSlice **slice_out, guint32 *inode_num);
-void glick_mount_add_slice (GlickMount *mount, GlickSlice *slice);
+static const char *glick_slice_lookup_string (GlickSlice *slice, size_t offset);
+static GlickSliceInode * glick_slice_lookup_path (GlickSlice *slice, const char *path, guint32 path_hash, guint32 *inode_num);
+static GlickSliceInode * glick_mount_lookup_path (GlickMount *mount, const char *path, GlickSlice **slice_out, guint32 *inode_num);
+static void glick_mount_add_slice (GlickMount *mount, GlickSlice *slice);
static gboolean mount_ref_data_cb (GIOChannel *source,
GIOCondition condition,
gpointer data);
-GlickPublic *glick_public_lookup_by_id (guint32 id);
-GlickPublic *glick_public_lookup_by_bundle (const char *bundle_id);
-void glick_public_apply_to_mount (GlickPublic *public, GlickMount *mount);
-void glick_public_unapply_to_mount (GlickPublic *public, GlickMount *mount);
-void glick_mount_remove_slice (GlickMount *mount, GlickSlice *slice);
-void glick_thread_push (GlickThreadOp *op,
+static GlickPublic *glick_public_lookup_by_id (guint32 id);
+static GlickPublic *glick_public_lookup_by_bundle (const char *bundle_id);
+static void glick_public_apply_to_mount (GlickPublic *public, GlickMount *mount);
+static void glick_public_unapply_to_mount (GlickPublic *public, GlickMount *mount);
+static void glick_mount_remove_slice (GlickMount *mount, GlickSlice *slice);
+static void glick_thread_push (GlickThreadOp *op,
GlickThreadOpFunc thread_func,
GlickThreadOpFunc result_func);
-GlickSliceInode *glick_slice_get_inode (GlickSlice *slice, int local);
-void glick_mount_unref (GlickMount *mount);
-void glick_slice_unref (GlickSlice *slice);
-GlickSlice *glick_slice_ref (GlickSlice *slice);
+static GlickSliceInode *glick_slice_get_inode (GlickSlice *slice, int local);
+static void glick_mount_unref (GlickMount *mount);
+static void glick_slice_unref (GlickSlice *slice);
+static GlickSlice *glick_slice_ref (GlickSlice *slice);
static void glick_inode_dir_remove_stale_children (GlickInodeDir *dir);
static void glick_inode_dir_remove_all_children (GlickInodeDir *dir);
static gboolean glick_inode_is_owned (GlickInode *inode);
-void glick_mount_real_remove_slice (GlickMount *mount, GlickSlice *slice);
+static void glick_mount_real_remove_slice (GlickMount *mount, GlickSlice *slice);
#if 0
#define __debug__(x) g_print x
@@ -1755,7 +1755,7 @@ fuse_lowlevel_ops glick_fs_oper = {
/******************** End of fuse implementation ********************/
-void *
+static void *
verify_header_block (char *data,
guint32 slice_size,
guint32 block_offset,
@@ -1778,7 +1778,7 @@ verify_header_block (char *data,
/* Looks up or creates a new slice */
-GlickSlice *
+static GlickSlice *
glick_slice_create (int fd, GlickSliceRef *ref)
{
GlickSlice *slice;
@@ -1877,14 +1877,14 @@ glick_slice_create (int fd, GlickSliceRef *ref)
return NULL;
}
-GlickSlice *
+static GlickSlice *
glick_slice_ref (GlickSlice *slice)
{
slice->ref_count++;
return slice;
}
-void
+static void
glick_slice_unref (GlickSlice *slice)
{
slice->ref_count--;
@@ -1896,7 +1896,7 @@ glick_slice_unref (GlickSlice *slice)
}
}
-gboolean
+static gboolean
glick_slice_string_equal (GlickSlice *slice, guint32 str_offset, const char *other, const char *other_end)
{
const char *str, *strings_end;
@@ -1917,7 +1917,7 @@ glick_slice_string_equal (GlickSlice *slice, guint32 str_offset, const char *oth
(str == strings_end || *str == 0));
}
-gboolean
+static gboolean
glick_slice_inode_has_path (GlickSlice *slice, GlickSliceInode *inodep, const char *path, const char *path_end)
{
const char *last_slash;
@@ -1953,7 +1953,7 @@ glick_slice_inode_has_path (GlickSlice *slice, GlickSliceInode *inodep, const ch
return glick_slice_inode_has_path (slice, &slice->inodes[parent_inode], path, last_slash);
}
-const char *
+static const char *
glick_slice_lookup_string (GlickSlice *slice, size_t offset)
{
if (offset >= slice->strings_size)
@@ -1964,7 +1964,7 @@ glick_slice_lookup_string (GlickSlice *slice, size_t offset)
return slice->strings + offset;
}
-GlickSliceInode *
+static GlickSliceInode *
glick_slice_lookup_path (GlickSlice *slice, const char *path, guint32 path_hash, guint32 *inode_num)
{
guint32 hash_bin;
@@ -1996,7 +1996,7 @@ glick_slice_lookup_path (GlickSlice *slice, const char *path, guint32 path_hash,
return NULL;
}
-GlickSliceInode *
+static GlickSliceInode *
glick_slice_get_inode (GlickSlice *slice, int local)
{
if (local < slice->num_inodes)
@@ -2004,7 +2004,7 @@ glick_slice_get_inode (GlickSlice *slice, int local)
return NULL;
}
-GlickSliceInode *
+static GlickSliceInode *
glick_mount_lookup_path_except_slice (GlickMount *mount, const char *path, GlickSlice *except_slice,
GlickSlice **slice_out, guint32 *inode_num)
{
@@ -2032,21 +2032,21 @@ glick_mount_lookup_path_except_slice (GlickMount *mount, const char *path, Glick
return NULL;
}
-GlickSliceInode *
+static GlickSliceInode *
glick_mount_lookup_path (GlickMount *mount, const char *path, GlickSlice **slice_out, guint32 *inode_num)
{
return glick_mount_lookup_path_except_slice (mount, path, NULL, slice_out, inode_num);
}
-GlickMount *
+static GlickMount *
glick_mount_ref (GlickMount *mount)
{
mount->ref_count++;
return mount;
}
-void
+static void
glick_mount_unref (GlickMount *mount)
{
mount->ref_count--;
@@ -2076,7 +2076,7 @@ glick_mount_unref (GlickMount *mount)
}
}
-GlickMount *
+static GlickMount *
glick_mount_new (const char *name)
{
GlickMount *mount;
@@ -2102,7 +2102,7 @@ glick_mount_new (const char *name)
return mount;
}
-gboolean
+static gboolean
glick_mount_create_dirs (GlickMount *mount, const char *path)
{
gchar **elements;
@@ -2147,7 +2147,7 @@ glick_mount_create_dirs (GlickMount *mount, const char *path)
return TRUE;
}
-GlickMount *
+static GlickMount *
glick_mount_new_public (void)
{
GlickMount *mount;
@@ -2177,7 +2177,7 @@ glick_mount_new_public (void)
return mount;
}
-char *
+static char *
map_and_verify_bundle (int fd, struct stat *statbuf, gsize *mapped_size)
{
GlickBundleHeader *header;
@@ -2241,7 +2241,7 @@ map_and_verify_bundle (int fd, struct stat *statbuf, gsize *mapped_size)
return data;
}
-GlickMount *
+static GlickMount *
glick_mount_new_for_bundle (int fd)
{
struct stat statbuf;
@@ -2561,7 +2561,7 @@ changes_op_thread (GlickThreadOp *op)
}
}
-void
+static void
glick_mount_add_slice (GlickMount *mount, GlickSlice *slice)
{
mount->slices = g_list_prepend (mount->slices, slice);
@@ -2595,7 +2595,7 @@ glick_mount_add_slice (GlickMount *mount, GlickSlice *slice)
glick_mount_slice_changed (mount, slice);
}
-void
+static void
glick_mount_real_remove_slice (GlickMount *mount, GlickSlice *slice)
{
mount->slices = g_list_remove (mount->slices, slice);
@@ -2603,7 +2603,7 @@ glick_mount_real_remove_slice (GlickMount *mount, GlickSlice *slice)
glick_mount_slice_changed (mount, slice);
}
-void
+static void
glick_mount_remove_slice (GlickMount *mount, GlickSlice *slice)
{
if (mount->mounted &&
@@ -2636,7 +2636,7 @@ glick_mount_remove_slice (GlickMount *mount, GlickSlice *slice)
glick_mount_real_remove_slice (mount, slice);
}
-GlickMountRef *
+static GlickMountRef *
glick_mount_ref_new (int fd)
{
GlickMountRef *ref;
@@ -2653,7 +2653,7 @@ glick_mount_ref_new (int fd)
return ref;
}
-void
+static void
glick_mount_ref_free (GlickMountRef *ref)
{
glick_mount_refs = g_list_remove (glick_mount_refs, ref);
@@ -2666,7 +2666,7 @@ glick_mount_ref_free (GlickMountRef *ref)
g_free (ref);
}
-void
+static void
glick_mount_ref_handle_request (GlickMountRef *ref,
GlickMountRequestMsg *request,
int fd)
@@ -2696,7 +2696,7 @@ glick_mount_ref_handle_request (GlickMountRef *ref,
close (fd);
}
-void
+static void
glick_public_apply_to_mount (GlickPublic *public, GlickMount *mount)
{
GList *l;
@@ -2708,7 +2708,7 @@ glick_public_apply_to_mount (GlickPublic *public, GlickMount *mount)
}
}
-void
+static void
glick_public_unapply_to_mount (GlickPublic *public, GlickMount *mount)
{
GList *l;
@@ -2720,7 +2720,7 @@ glick_public_unapply_to_mount (GlickPublic *public, GlickMount *mount)
}
}
-GlickPublic *
+static GlickPublic *
glick_public_lookup_by_bundle (const char *bundle_id)
{
GList *l;
@@ -2735,7 +2735,7 @@ glick_public_lookup_by_bundle (const char *bundle_id)
return NULL;
}
-GlickPublic *
+static GlickPublic *
glick_public_lookup_by_id (guint32 id)
{
GList *l;
@@ -2750,7 +2750,7 @@ glick_public_lookup_by_id (guint32 id)
return NULL;
}
-GlickPublic *
+static GlickPublic *
glick_public_new (char *filename)
{
char *data;
@@ -3074,13 +3074,15 @@ ready_pipe_cb (GIOChannel *source,
return FALSE;
}
-static void exit_handler(int sig)
+static void
+exit_handler(int sig)
{
(void) sig;
g_main_loop_quit (mainloop);
}
-static int set_one_signal_handler(int sig, void (*handler)(int))
+static int
+set_one_signal_handler(int sig, void (*handler)(int))
{
struct sigaction sa;
struct sigaction old_sa;
@@ -3100,7 +3102,7 @@ static int set_one_signal_handler(int sig, void (*handler)(int))
return TRUE;
}
-int
+static int
main_loop (struct fuse_session *se)
{
int res = 0;
@@ -3141,7 +3143,7 @@ main_loop (struct fuse_session *se)
return res < 0 ? -1 : 0;
}
-void
+static void
glick_thread_push (GlickThreadOp *op,
GlickThreadOpFunc thread_func,
GlickThreadOpFunc result_func)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]