Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
clsync
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2014-12-24 14:38:01 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e1512147337c1906407a6fb5367f5225cfe756f0
e1512147
1 parent
f64c02d8
Fix of "glib.h: No such file or directory"
https://github.com/xaionaro/clsync/issues/107
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
45 deletions
common.h
glibex.h
main.c
rules.c
sync.h
common.h
View file @
e151214
...
...
@@ -67,7 +67,6 @@
#include <netinet/in.h>
#include <libgen.h>
#include <pthread.h>
#include <glib.h>
#include "configuration.h"
#ifdef HAVE_CONFIG_H
...
...
@@ -204,38 +203,6 @@ struct eventinfo {
};
typedef
struct
eventinfo
eventinfo_t
;
struct
thread_callbackfunct_arg
{
char
*
excfpath
;
char
*
incfpath
;
};
typedef
struct
thread_callbackfunct_arg
thread_callbackfunct_arg_t
;
typedef
int
(
*
thread_callbackfunct_t
)(
ctx_t
*
ctx_p
,
thread_callbackfunct_arg_t
*
arg_p
);
struct
threadinfo
{
int
thread_num
;
uint32_t
iteration
;
thread_callbackfunct_t
callback
;
thread_callbackfunct_arg_t
*
callback_arg
;
char
**
argv
;
pthread_t
pthread
;
int
exitcode
;
int
errcode
;
state_t
state
;
ctx_t
*
ctx_p
;
time_t
starttime
;
time_t
expiretime
;
int
child_pid
;
GHashTable
*
fpath2ei_ht
;
// file path -> event information
int
try_n
;
// for so-synchandler
int
n
;
api_eventinfo_t
*
ei
;
};
typedef
struct
threadinfo
threadinfo_t
;
enum
pthread_mutex_id
{
PTHREAD_MUTEX_STATE
,
PTHREAD_MUTEX_SELECT
,
...
...
@@ -244,18 +211,6 @@ enum pthread_mutex_id {
};
struct
threadsinfo
{
pthread_mutex_t
mutex
[
PTHREAD_MUTEX_MAX
];
pthread_cond_t
cond
[
PTHREAD_MUTEX_MAX
];
char
mutex_init
;
int
allocated
;
int
used
;
threadinfo_t
*
threads
;
threadinfo_t
**
threadsstack
;
// stack of threadinfo_t to be used on thread_new()
int
stacklen
;
};
typedef
struct
threadsinfo
threadsinfo_t
;
struct
dosync_arg
{
int
evcount
;
char
excf_path
[
PATH_MAX
+
1
];
...
...
glibex.h
View file @
e151214
...
...
@@ -17,6 +17,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h>
typedef
gpointer
(
*
GDupFunc
)(
gpointer
data
);
extern
GHashTable
*
g_hash_table_dup
(
GHashTable
*
ht
,
GHashFunc
hash_funct
,
GEqualFunc
key_equal_funct
,
GDestroyNotify
key_destroy_funct
,
GDestroyNotify
value_destroy_funct
,
GDupFunc
key_dup_funct
,
GDupFunc
value_dup_funct
);
...
...
main.c
View file @
e151214
...
...
@@ -29,6 +29,7 @@
#include <pwd.h> // getpwnam()
#include <grp.h> // getgrnam()
#include <glib.h> // gkf
#ifdef UNSHARE_SUPPORT
...
...
rules.c
View file @
e151214
...
...
@@ -18,6 +18,9 @@
*/
#include "common.h"
#include <glib.h> // g_hash_table_*
#include "rules.h"
#include "error.h"
...
...
sync.h
View file @
e151214
...
...
@@ -17,6 +17,54 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <glib.h> // GHashTable
struct
thread_callbackfunct_arg
{
char
*
excfpath
;
char
*
incfpath
;
};
typedef
struct
thread_callbackfunct_arg
thread_callbackfunct_arg_t
;
typedef
int
(
*
thread_callbackfunct_t
)(
ctx_t
*
ctx_p
,
thread_callbackfunct_arg_t
*
arg_p
);
struct
threadinfo
{
int
thread_num
;
uint32_t
iteration
;
thread_callbackfunct_t
callback
;
thread_callbackfunct_arg_t
*
callback_arg
;
char
**
argv
;
pthread_t
pthread
;
int
exitcode
;
int
errcode
;
state_t
state
;
ctx_t
*
ctx_p
;
time_t
starttime
;
time_t
expiretime
;
int
child_pid
;
GHashTable
*
fpath2ei_ht
;
// file path -> event information
int
try_n
;
// for so-synchandler
int
n
;
api_eventinfo_t
*
ei
;
};
typedef
struct
threadinfo
threadinfo_t
;
struct
threadsinfo
{
pthread_mutex_t
mutex
[
PTHREAD_MUTEX_MAX
];
pthread_cond_t
cond
[
PTHREAD_MUTEX_MAX
];
char
mutex_init
;
int
allocated
;
int
used
;
threadinfo_t
*
threads
;
threadinfo_t
**
threadsstack
;
// stack of threadinfo_t to be used on thread_new()
int
stacklen
;
};
typedef
struct
threadsinfo
threadsinfo_t
;
extern
int
sync_run
(
struct
ctx
*
ctx
);
extern
int
sync_dump
(
struct
ctx
*
ctx
,
const
char
*
const
dest_dir
);
extern
int
sync_term
(
int
exitcode
);
...
...
Please
register
or
login
to post a comment