#include "c.h"
#include "list.h"
#include "debug.h"
+#include "buffer.h"
#include "libmount.h"
/*
extern int mnt_optstr_fix_secontext(char **optstr, char *value, size_t valsz, char **next);
extern int mnt_optstr_fix_user(char **optstr);
+extern int mnt_buffer_append_option(struct ul_buffer *buf,
+ const char *name, size_t namesz,
+ const char *val, size_t valsz);
+
/* fs.c */
extern struct libmnt_fs *mnt_copy_mtab_fs(const struct libmnt_fs *fs);
extern int __mnt_fs_set_source_ptr(struct libmnt_fs *fs, char *source)
#include "strutils.h"
#include "mountP.h"
-#include "buffer.h"
/*
* Option location
return ul_optstr_next(optstr, name, namesz, value, valuesz);
}
-static int __buffer_append_option(struct ul_buffer *buf,
+int mnt_buffer_append_option(struct ul_buffer *buf,
const char *name, size_t namesz,
const char *val, size_t valsz)
{
ul_buffer_refer_string(&buf, *optstr);
ul_buffer_set_chunksize(&buf, osz + nsz + vsz + 3); /* to call realloc() only once */
- rc = __buffer_append_option(&buf, name, nsz, value, vsz);
+ rc = mnt_buffer_append_option(&buf, name, nsz, value, vsz);
*optstr = ul_buffer_get_data(&buf, NULL, NULL);
return rc;
ul_buffer_set_chunksize(&buf, osz + nsz + vsz + 3); /* to call realloc() only once */
- rc = __buffer_append_option(&buf, name, nsz, value, vsz);
+ rc = mnt_buffer_append_option(&buf, name, nsz, value, vsz);
if (*optstr && !rc) {
rc = ul_buffer_append_data(&buf, ",", 1);
if (!rc)
if (buf) {
if (ul_buffer_is_empty(buf))
ul_buffer_set_chunksize(buf, chunsz);
- rc = __buffer_append_option(buf, name, namesz, val, valsz);
+ rc = mnt_buffer_append_option(buf, name, namesz, val, valsz);
}
if (rc)
break;
if (valsz && mnt_optmap_entry_novalue(ent))
continue;
- rc = __buffer_append_option(&buf, name, namesz, val, valsz);
+ rc = mnt_buffer_append_option(&buf, name, namesz, val, valsz);
if (rc)
break;
}
} else
sz = strlen(ent->name);
- rc = __buffer_append_option(&buf, ent->name, sz, NULL, 0);
+ rc = mnt_buffer_append_option(&buf, ent->name, sz, NULL, 0);
if (rc)
goto err;
}