diff options
author | Dmitri Pal <dpal@redhat.com> | 2010-11-25 20:51:49 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-12-21 11:16:09 -0500 |
commit | 94e5ad22e13733a21ac612b601eb1ba5873d2b1e (patch) | |
tree | 4aa905d7d1ff026b58bcc712deed860005e7c5fa /ini/ini_comment.h | |
parent | 8c201905d5f0720b62d036eb2308f81f4530cfad (diff) | |
download | ding-libs-94e5ad22e13733a21ac612b601eb1ba5873d2b1e.tar.gz ding-libs-94e5ad22e13733a21ac612b601eb1ba5873d2b1e.tar.xz ding-libs-94e5ad22e13733a21ac612b601eb1ba5873d2b1e.zip |
Refactoring comment object
* Added copy coment functionality
* Changed the internal implementation to
use array simple buffer instead of
the two arrays one for lines and one for lengths
* Realigned comments in the header file
* Changed the trace macros to use
simplified entry and exit macros.
* Corrected unit test to return error codes.
* Refactored unit test to use array
of test functions intead of the direct calls
* Added unit test for copy functionality.
Diffstat (limited to 'ini/ini_comment.h')
-rw-r--r-- | ini/ini_comment.h | 42 |
1 files changed, 33 insertions, 9 deletions
diff --git a/ini/ini_comment.h b/ini/ini_comment.h index 5365409..947209c 100644 --- a/ini/ini_comment.h +++ b/ini/ini_comment.h @@ -72,43 +72,67 @@ int ini_comment_insert(struct ini_comment *ic, uint32_t idx, const char *line); -/* Modify comment by appending a line. */ +/** + * Modify comment by appending a line. + */ int ini_comment_append(struct ini_comment *ic, const char *line); -/* Remove line from the comment.*/ +/** + * Remove line from the comment. + */ int ini_comment_remove(struct ini_comment *ic, uint32_t idx); -/* Clear line in the comment. Line is replaced with an empty line */ +/** + * Clear line in the comment. + * Line is replaced with an empty line + */ int ini_comment_clear(struct ini_comment *ic, uint32_t idx); -/* Replace a line in the comment */ +/** + * Replace a line in the comment + */ int ini_comment_replace(struct ini_comment *ic, uint32_t idx, const char *line); -/* Reset the comment - clean all lines.*/ +/** + * Reset the comment - clean all lines. + */ int ini_comment_reset(struct ini_comment *ic); -/* Get number of lines */ +/** + * Get number of lines + */ int ini_comment_get_numlines(struct ini_comment *ic, uint32_t *num); -/* Get line */ +/** + * Get line + */ int ini_comment_get_line(struct ini_comment *ic, uint32_t idx, char **line, uint32_t *line_len); -/* Swap lines */ +/** + * Swap lines + */ int ini_comment_swap(struct ini_comment *ic, uint32_t idx1, uint32_t idx2); +/** + * Create a copy of the comment object + */ +int ini_comment_copy(struct ini_comment *ic, + struct ini_comment **ic_copy); -/* Internal function to print comment */ +/** + * Internal function to print comment + */ void ini_comment_print(struct ini_comment *ic, FILE *file); |