diff options
| author | Petr Cech <pcech@redhat.com> | 2015-11-24 10:34:10 -0500 |
|---|---|---|
| committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-02-24 13:51:09 +0100 |
| commit | cf1109e30320a994187edeb438ac7cdc36f0dd2b (patch) | |
| tree | 473eb85e61894e0948bf84e3117a1ecf8389b61a /src/tools | |
| parent | 2dd75ea79a57615808754c0ce550786edbc17d69 (diff) | |
| download | sssd-cf1109e30320a994187edeb438ac7cdc36f0dd2b.tar.gz sssd-cf1109e30320a994187edeb438ac7cdc36f0dd2b.tar.xz sssd-cf1109e30320a994187edeb438ac7cdc36f0dd2b.zip | |
TOOLS: Add comments on functions in colondb
The colondb API provides three function:
* sss_colondb_open()
* sss_colondb_write_field()
* sss_colondb_read_field()
It is not obvious that sss_colondb_open() add destructor on talloc
context which close the colondb during free context. And there is
expectation that SSS_COLONDB_SENTINEL is type of last item in line.
So this patch adds simple lightening comments in doxygen style.
Resolves:
https://fedorahosted.org/sssd/ticket/2764
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/common/sss_colondb.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/common/sss_colondb.h b/src/tools/common/sss_colondb.h index 6edd99cb..cb904008 100644 --- a/src/tools/common/sss_colondb.h +++ b/src/tools/common/sss_colondb.h @@ -59,14 +59,37 @@ struct sss_colondb_read_field { union sss_colondb_read_data data; }; +/** + * Open colon DB and return connection. + * @param[in|out] mem_ctx Memory context. Internal sss_colondb_close() is set + * on destructor of this memory context. + * @param[in] mode Open mode of db: SSS_COLONDB_READ or SSS_COLONDB_WRITE. + * @param[in] filename Name of file. + * @return Pointer to structure holding DB connection, or NULL if fail. + */ struct sss_colondb *sss_colondb_open(TALLOC_CTX *mem_ctx, enum sss_colondb_mode mode, const char *filename); +/** + * Read line from colon DB. + * @param[in|out] mem_ctx Memory context. + * @param[in] db Pointer to structure holding DB connection. + * @param[in|out] table Array of expected structure of line. It is expected + * that last item has SSS_COLONDB_SENTINEL type. + * @return EOK if success, else error code. + */ errno_t sss_colondb_readline(TALLOC_CTX *mem_ctx, struct sss_colondb *db, struct sss_colondb_read_field *table); +/** + * Write line to colon DB. + * @param[in] db Pointer to structure holding DB connection. + * @param[in] table Array with data. It is expected that last item has + * SSS_COLONDB_SENTINEL type. + * @return EOK if success, else error code. + */ errno_t sss_colondb_writeline(struct sss_colondb *db, struct sss_colondb_write_field *table); |
