<commit_before>/**
 * File  : filesystem_api.h
 * Author: <NAME>
 * Date  : 2017-07-20
 *
 * Copyright (c) 2017 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef API_PROJECT_FS_API_INCLUDED
#define API_PROJECT_FS_API_INCLUDED

#define RESULT_SUCCESS      "ok"
#define RESULT_READ_SUCCESS "contenuto"
#define RESULT_FAILURE      "no"

/**
 * Nothing but a wrapper of fs__init: initialize the hash table and create the root.
 * @post the hash table has been allocated in memory and the root has been created.
 */
void fs_init(void);

/**
 * Nothing but a wrapper of fs__exit: destroy the whole filesystem tree (including root) and free all the space.
 * @post the whole filesystem tree and hashtable have been freed.
 */
void fs_exit(void);

/**
 * Create a file represented by the given path.
 * @param path  : the path representing the file to be created.
 * @param is_dir: whether the file to be created is a directory or not.
 * @post  in case of success the new file is in the proper position in both the hash table and the tree.
 * @out   RESULT_SUCCESS in case of success; RESULT_ERROR in case of error.
 */
void fs_create(char* path, bool is_dir);

/**
 * Delete the file represented by the given path and, if requested and if any, all its children.
 * @param path     : the path representing the file to be deleted.
 * @param recursive: whether to delete all the file's children (recursively) or not.<commit_msg>Added missing include.<commit_after>/**
 * File  : filesystem_api.h
 * Author: <NAME>
 * Date  : 2017-08-14
 *
 * Copyright (c) 2017 <NAME>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef API_PROJECT_FS_API_INCLUDED
#define API_PROJECT_FS_API_INCLUDED

#include <stdbool.h>

#define RESULT_SUCCESS      "ok"
#define RESULT_READ_SUCCESS "contenuto"
#define RESULT_FAILURE      "no"

/**
 * Nothing but a wrapper of fs__init: initialize the hash table and create the root.
 * @post the hash table has been allocated in memory and the root has been created.
 */
void fs_init(void);

/**
 * Nothing but a wrapper of fs__exit: destroy the whole filesystem tree (including root) and free all the space.
 * @post the whole filesystem tree and hashtable have been freed.
 */
void fs_exit(void);

/**
 * Create a file represented by the given path.
 * @param path  : the path representing the file to be created.
 * @param is_dir: whether the file to be created is a directory or not.
 * @post  in case of success the new file is in the proper position in both the hash table and the tree.
 * @out   RESULT_SUCCESS in case of success; RESULT_ERROR in case of error.
 */
void fs_create(char* path, bool is_dir);

/**
 * Delete the file represented by the given path and, if requested and if any, all its children.
 * @param path     : the path representing the file to be deleted.
 * @param recursive: whether to delete all the file's children (recursively) or not.
{'fraction_non_alphanumeric': 0.0766488413547237, 'fraction_numerical': 0.008148714031066972, 'mean_word_length': 3.743961352657005, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1417818', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1078, 'n_words': 543}