2 * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
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 _MTP_SUPPORT_H_
18 #define _MTP_SUPPORT_H_
24 #include "mtp_datatype.h"
25 #include "mtp_config.h"
33 * Convert byte order for big endian architecture
35 void _util_conv_byte_order(void *data, mtp_int32 size);
38 * Convert byte order for WCHAR string
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);
67 #endif /* _MTP_SUPPORT_H_ */