Skip to content

Commit c73c978

Browse files
committed
docs: collect duplicate func descriptions in .h
1 parent 4d4b900 commit c73c978

File tree

3 files changed

+37
-61
lines changed

3 files changed

+37
-61
lines changed

include/onomondo/softsim/storage.h

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,47 @@ int ss_storage_set_path(const char *path);
4141
* \returns Pointer to the current storage path. */
4242
const char *ss_storage_get_path(void);
4343

44+
/*! Get file definition for file (tip of the path).
45+
* \param[inout] path to the file for which the definition should be read.
46+
* \returns 0 on success, -EINVAL on failure */
4447
int ss_storage_get_file_def(struct ss_list *path);
48+
49+
/*! Get content from file (tip of the path).
50+
* \param[in] path path to the file to be read.
51+
* \param[in] read_offset offset to start reading the file at.
52+
* \param[in] read_len length of data to read.
53+
* \returns buffer with content data on success, NULL on failure. */
4554
struct ss_buf *ss_storage_read_file(const struct ss_list *path, size_t read_offset, size_t read_len);
55+
56+
/*! Get the total size in bytes of a file.
57+
* \param[in] path path to the file that gets selected.
58+
* \returns size in bytes on success, 0 on failure. */
4659
size_t ss_storage_get_file_len(const struct ss_list *path);
60+
61+
/*! Write data to a file (tip of the path).
62+
* \param[in] path path to the file to be written.
63+
* \param[in] write_offset offset to start writing the file at.
64+
* \param[in] write_len length of data to be written.
65+
* \returns 0 on success, -EINVAL on failure. */
4766
int ss_storage_write_file(const struct ss_list *path, const uint8_t *data, size_t write_offset, size_t write_len);
67+
68+
/*! Delete file or directory in the file system.
69+
* \param[in] path path to the file or directory to delete.
70+
* \returns 0 on success, -EINVAL on failure. */
4871
int ss_storage_delete(const struct ss_list *path);
72+
73+
/*! Update definition file in the file system.
74+
* \param[in] path path to the file to update.
75+
* \returns 0 on success, -EINVAL on failure */
4976
int ss_storage_update_def(const struct ss_list *path);
77+
78+
/*! Create a file in the file system.
79+
* \param[in] path path to the file that gets selected.
80+
* \param[in] file_len length of the file to create (filled with 0xff).
81+
* \returns 0 success, -EINVAL on failure */
5082
int ss_storage_create_file(const struct ss_list *path, size_t file_len);
83+
84+
/*! Create a directory in the file system.
85+
* \param[in] path path to the directory to create.
86+
* \returns 0 on success, -EINVAL on failure */
5187
int ss_storage_create_dir(const struct ss_list *path);

src/softsim/storage.c

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ static int read_file_def(char *host_path, struct ss_file *file)
111111
return 0;
112112
}
113113

114-
/*! Get file definition for file (tip of the path).
115-
* \param[inout] path to the file for which the definition should be read.
116-
* \returns 0 on success, -EINVAL on failure */
117114
int ss_storage_get_file_def(struct ss_list *path)
118115
{
119116
/*! Note: This function will allocate memory in file to store the file
@@ -134,11 +131,6 @@ int ss_storage_get_file_def(struct ss_list *path)
134131
return read_file_def(host_path, file);
135132
}
136133

137-
/*! Get content from file (tip of the path).
138-
* \param[in] path path to the file to be read.
139-
* \param[in] read_offset offset to start reading the file at.
140-
* \param[in] read_len length of data to read.
141-
* \returns buffer with content data on success, NULL on failure. */
142134
struct ss_buf *ss_storage_read_file(const struct ss_list *path, size_t read_offset, size_t read_len)
143135
{
144136
/*! Note: This function will allocate memory in fileto store the file
@@ -196,11 +188,6 @@ struct ss_buf *ss_storage_read_file(const struct ss_list *path, size_t read_offs
196188
return result;
197189
}
198190

199-
/*! Write data to a file (tip of the path).
200-
* \param[in] path path to the file to be written.
201-
* \param[in] write_offset offset to start writing the file at.
202-
* \param[in] write_len length of data to be written.
203-
* \returns 0 on success, -EINVAL on failure. */
204191
int ss_storage_write_file(const struct ss_list *path, const uint8_t *data, size_t write_offset, size_t write_len)
205192
{
206193
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -245,9 +232,6 @@ int ss_storage_write_file(const struct ss_list *path, const uint8_t *data, size_
245232
return 0;
246233
}
247234

248-
/*! Get the total size in bytes of a file.
249-
* \param[in] path path to the file that gets selected.
250-
* \returns size in bytes on success, 0 on failure. */
251235
size_t ss_storage_get_file_len(const struct ss_list *path)
252236
{
253237
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -274,9 +258,6 @@ size_t ss_storage_get_file_len(const struct ss_list *path)
274258
return file_size;
275259
}
276260

277-
/*! Delete file or directory in the file system.
278-
* \param[in] path path to the file or directory to delete.
279-
* \returns 0 on success, -EINVAL on failure. */
280261
int ss_storage_delete(const struct ss_list *path)
281262
{
282263
char host_path_def[SS_STORAGE_PATH_MAX + 1];
@@ -312,9 +293,6 @@ int ss_storage_delete(const struct ss_list *path)
312293
return 0;
313294
}
314295

315-
/*! Update definition file in the file system.
316-
* \param[in] path path to the file to update.
317-
* \returns 0 on success, -EINVAL on failure */
318296
int ss_storage_update_def(const struct ss_list *path)
319297
{
320298
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -358,10 +336,6 @@ int ss_storage_update_def(const struct ss_list *path)
358336
return 0;
359337
}
360338

361-
/*! Create a file in the file system.
362-
* \param[in] path path to the file that gets selected.
363-
* \param[in] file_len length of the file to create (filled with 0xff).
364-
* \returns 0 success, -EINVAL on failure */
365339
int ss_storage_create_file(const struct ss_list *path, size_t file_len)
366340
{
367341
/*! Note: This function must not be called with pathes that point to
@@ -402,14 +376,9 @@ int ss_storage_create_file(const struct ss_list *path, size_t file_len)
402376
return 0;
403377
}
404378

405-
/*! Create a directory in the file system.
406-
* \param[in] path path to the directory to create.
407-
* \returns 0 on success, -EINVAL on failure */
408379
int ss_storage_create_dir(const struct ss_list *path)
409380
{
410-
/*! Note: This function must not be called with pathes that point to
411-
* a directory! */
412-
381+
/*! Note: This function must not be called with pathes that point to a directory! */
413382
char host_path[SS_STORAGE_PATH_MAX + 1];
414383
int rc;
415384

src/softsim/storage_compact.c

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,6 @@ static int read_file_def(char *host_path, struct ss_file *file)
106106
return 0;
107107
}
108108

109-
/*! Get file definition for a file (tip of the path).
110-
* \param[inout] path to the file for which the definition should be read.
111-
* \returns 0 on success, -EINVAL on failure */
112109
int ss_storage_get_file_def(struct ss_list *path)
113110
{
114111
/*! Note: This function will allocate memory in file to store the file
@@ -130,11 +127,6 @@ int ss_storage_get_file_def(struct ss_list *path)
130127
return read_file_def(host_path, file);
131128
}
132129

133-
/*! Get content from a file (tip of the path).
134-
* \param[in] path path to the file to be read.
135-
* \param[in] read_offset offset to start reading the file at.
136-
* \param[in] read_len length of data to read.
137-
* \returns buffer with content data on success, NULL on failure. */
138130
struct ss_buf *ss_storage_read_file(const struct ss_list *path, size_t read_offset, size_t read_len)
139131
{
140132
/*! Note: This function will allocate memory in file to store the file
@@ -189,11 +181,6 @@ struct ss_buf *ss_storage_read_file(const struct ss_list *path, size_t read_offs
189181
return result;
190182
}
191183

192-
/*! Write data to a file (tip of the path).
193-
* \param[in] path path to the file to be written.
194-
* \param[in] write_offset offset to start writing the file at.
195-
* \param[in] write_len length of data to be written.
196-
* \returns 0 on success, -EINVAL on failure. */
197184
int ss_storage_write_file(const struct ss_list *path, const uint8_t *data, size_t write_offset, size_t write_len)
198185
{
199186
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -235,9 +222,6 @@ int ss_storage_write_file(const struct ss_list *path, const uint8_t *data, size_
235222
return 0;
236223
}
237224

238-
/*! Get the total size in bytes of a file.
239-
* \param[in] path path to the file that gets selected.
240-
* \returns size in bytes on success, 0 on failure. */
241225
size_t ss_storage_get_file_len(const struct ss_list *path)
242226
{
243227
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -281,9 +265,6 @@ size_t ss_storage_get_file_len(const struct ss_list *path)
281265
return file_size;
282266
}
283267

284-
/*! Delete a file or directory in the file system.
285-
* \param[in] path path to the file or directory to delete.
286-
* \returns 0 on success, -EINVAL on failure. */
287268
int ss_storage_delete(const struct ss_list *path)
288269
{
289270
char host_path_def[SS_STORAGE_PATH_MAX + 1];
@@ -321,9 +302,6 @@ int ss_storage_delete(const struct ss_list *path)
321302
return 0;
322303
}
323304

324-
/*! Update the definition file in the file system.
325-
* \param[in] path path to the file to update.
326-
* \returns 0 on success, -EINVAL on failure. */
327305
int ss_storage_update_def(const struct ss_list *path)
328306
{
329307
char host_path[SS_STORAGE_PATH_MAX + 1];
@@ -366,10 +344,6 @@ int ss_storage_update_def(const struct ss_list *path)
366344
return 0;
367345
}
368346

369-
/*! Create a file in the file system.
370-
* \param[in] path path to the file that gets selected.
371-
* \param[in] file_len length of the file to create (filled with 0xff).
372-
* \returns 0 on success, -EINVAL on failure. */
373347
int ss_storage_create_file(const struct ss_list *path, size_t file_len)
374348
{
375349
/*! Note: This function must not be called with pathes that point to a directory! */
@@ -410,9 +384,6 @@ int ss_storage_create_file(const struct ss_list *path, size_t file_len)
410384
return 0;
411385
}
412386

413-
/*! Create a directory in the file system.
414-
* \param[in] path path to the directory to create.
415-
* \returns 0 on success, -EINVAL on failure. */
416387
int ss_storage_create_dir(const struct ss_list *path)
417388
{
418389
/*! Note: This function must not be called with pathes that point to a directory! */

0 commit comments

Comments
 (0)