Remove the execution flag from non-executables
[platform/core/connectivity/mtp-responder.git] / include / util / mtp_support.h
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 #ifndef _MTP_SUPPORT_H_
18 #define _MTP_SUPPORT_H_
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 #include "mtp_datatype.h"
25 #include "mtp_config.h"
26
27 typedef struct {
28         mtp_char *extn;
29         mtp_uint16 fmt_code;
30 } fmt_code_t;
31
32 /*
33  * Convert byte order for big endian architecture
34  */
35 void _util_conv_byte_order(void *data, mtp_int32 size);
36
37 /*
38  * Convert byte order for WCHAR string
39  */
40 void _util_conv_byte_order_wstring(mtp_uint16 *wstr, mtp_int32 size);
41 void _util_conv_byte_order_gen_str(void *str, mtp_int32 size, mtp_int32 elem_sz);
42 void _util_wchar_cpy(mtp_wchar *dest, const mtp_wchar *src);
43 void _util_wchar_ncpy(mtp_wchar *dest, const mtp_wchar *src, unsigned long n);
44 size_t _util_wchar_len(const mtp_wchar *s);
45 mtp_wchar *mtp_wcscat_charstr(mtp_wchar *str1, const mtp_char *char_str);
46 mtp_err_t _util_wchar_swprintf(mtp_wchar *mtp_wstr, mtp_int32 size,
47                 mtp_char *format, ...);
48 mtp_int32 _util_utf16_to_utf8(char *dest, mtp_int32 size, const mtp_wchar *src);
49 mtp_int32 _util_utf8_to_utf16(mtp_wchar *dest, mtp_int32 no_of_item, const char *src);
50 mtp_uint16 _util_get_fmtcode(const mtp_char *extn);
51 mtp_bool _util_get_file_extn(const mtp_char *f_name, mtp_char *f_extn);
52 mtp_bool _util_get_file_name(const mtp_char *fullpath, mtp_char *f_name);
53 mtp_bool _util_get_file_name_wo_extn(const mtp_char *fullpath, mtp_char *f_name);
54 mtp_bool _util_is_path_len_valid(const mtp_char *path);
55 mtp_bool _util_create_path(mtp_char *path, mtp_uint32 size, const mtp_char *dir,
56                 const mtp_char *filename);
57 void _util_get_parent_path(const mtp_char *fullpath, mtp_char *p_path);
58 void _util_conv_wstr_to_guid(mtp_wchar *wstr, mtp_uint64 *guid);
59 mtp_bool _util_get_unique_dir_path(const mtp_char *exist_path, mtp_char *new_path,
60                 mtp_uint32 new_path_buf_len);
61 mtp_int32 _util_system_cmd_wait(const mtp_char *cmd);
62
63 #ifdef __cplusplus
64 }
65 #endif
66
67 #endif /* _MTP_SUPPORT_H_ */