2 * Copyright (c) 2011 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef _FILE_SYNC_SERVICE_H_
18 #define _FILE_SYNC_SERVICE_H_
20 #ifdef HAVE_BIG_ENDIAN
21 static inline unsigned __swap_uint32(unsigned x)
23 return (((x) & 0xFF000000) >> 24)
24 | (((x) & 0x00FF0000) >> 8)
25 | (((x) & 0x0000FF00) << 8)
26 | (((x) & 0x000000FF) << 24);
28 #define htoll(x) __swap_uint32(x)
29 #define ltohl(x) __swap_uint32(x)
30 #define MKID(a,b,c,d) ((d) | ((c) << 8) | ((b) << 16) | ((a) << 24))
34 #define MKID(a,b,c,d) ((a) | ((b) << 8) | ((c) << 16) | ((d) << 24))
37 #define ID_STAT MKID('S','T','A','T')
38 #define ID_LIST MKID('L','I','S','T')
39 #define ID_ULNK MKID('U','L','N','K')
40 #define ID_SEND MKID('S','E','N','D')
41 #define ID_RECV MKID('R','E','C','V')
42 #define ID_DENT MKID('D','E','N','T')
43 #define ID_DONE MKID('D','O','N','E')
44 #define ID_DATA MKID('D','A','T','A')
45 #define ID_OKAY MKID('O','K','A','Y')
46 #define ID_FAIL MKID('F','A','I','L')
47 #define ID_QUIT MKID('Q','U','I','T')
78 void init_sdk_sync_permit_rule_regx(void);
80 void file_sync_service(int fd, void *cookie);
81 void file_sync_subproc(int fd, void *cookie);
82 int do_sync_ls(const char *path);
83 int do_sync_push(const char *lpath, const char *rpath, int verifyApk, int isUtf8);
84 int do_sync_sync(const char *lpath, const char *rpath, int listonly);
85 int do_sync_pull(const char *rpath, const char *lpath);
87 #define SYNC_DATA_MAX (64*1024)