JULEA
jhelper.h
Go to the documentation of this file.
1 /*
2  * JULEA - Flexible storage framework
3  * Copyright (C) 2010-2024 Michael Kuhn
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
23 #ifndef JULEA_HELPER_H
24 #define JULEA_HELPER_H
25 
26 #if !defined(JULEA_H) && !defined(JULEA_COMPILATION)
27 #error "Only <julea.h> can be included directly."
28 #endif
29 
30 #include <glib.h>
31 #include <gio/gio.h>
32 
34 
35 G_BEGIN_DECLS
36 
54 void j_helper_get_number_string(gchar* string, guint32 length, guint32 number);
55 
65 void j_helper_set_cork(GSocketConnection* connection, gboolean enable);
66 
76 void j_helper_set_nodelay(GSocketConnection* connection, gboolean enable);
77 
86 guint64 j_helper_atomic_add(guint64 volatile* ptr, guint64 val);
87 
97 gboolean j_helper_execute_parallel(JBackgroundOperationFunc func, gpointer* data, guint length);
98 
104 guint32 j_helper_hash(gchar const* str);
105 
115 gchar* j_helper_str_replace(gchar const* str, gchar const* old, gchar const* new);
116 
125 gpointer j_helper_alloc_aligned(gsize align, gsize len);
126 
134 gboolean j_helper_file_sync(gchar const* path);
135 
146 gboolean j_helper_file_discard(gchar const* path);
147 
152 G_END_DECLS
153 
154 #endif
gpointer(* JBackgroundOperationFunc)(gpointer)
Definition: jbackground-operation.h:44
gchar * j_helper_str_replace(gchar const *str, gchar const *old, gchar const *new)
Definition: jhelper.c:101
guint64 j_helper_atomic_add(guint64 volatile *ptr, guint64 val)
Definition: jhelper.c:174
gboolean j_helper_file_discard(gchar const *path)
Definition: jhelper.c:251
void j_helper_set_cork(GSocketConnection *connection, gboolean enable)
Definition: jhelper.c:71
void j_helper_set_nodelay(GSocketConnection *connection, gboolean enable)
Definition: jhelper.c:53
gboolean j_helper_file_sync(gchar const *path)
Definition: jhelper.c:229
guint32 j_helper_hash(gchar const *str)
Definition: jhelper.c:196
gpointer j_helper_alloc_aligned(gsize align, gsize len)
Definition: jhelper.c:214
void j_helper_get_number_string(gchar *string, guint32 length, guint32 number)
Definition: jhelper.c:89
gboolean j_helper_execute_parallel(JBackgroundOperationFunc func, gpointer *data, guint length)
Definition: jhelper.c:123