4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 * @desc Helper functions for working with files
26 #ifndef _RESOURCED_FILE_HELPER_H_
27 #define _RESOURCED_FILE_HELPER_H_
29 #include "resourced.h"
32 * @desc write string to the file
33 * @param path - path to the file, str - string is written to the file
34 * @return negative value if error
36 resourced_ret_c fwrite_str(const char *path, const char *str);
38 resourced_ret_c fwrite_int(const char *path, const int number);
40 resourced_ret_c fwrite_uint(const char *path, const u_int32_t number);
42 resourced_ret_c fread_int(const char *path, u_int32_t *number);
44 resourced_ret_c fwrite_array(const char *path, const void *array,
45 const size_t size_of_elem,
46 const size_t numb_of_elem);
48 char *cread(const char *path);
49 char *cgets(char **contents);
50 #endif /*_RESOURCED_FILE_HELPER_H_*/