Imported Upstream version 0.8.7
[platform/upstream/multipath-tools.git] / libmultipath / generic.h
index 7f7fe66..57c123c 100644 (file)
   GNU General Public License for more details.
 
   You should have received a copy of the GNU General Public License
-  along with this program; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301,
-  USA.
+  along with this program.  If not, see <https://www.gnu.org/licenses/>.
  */
 #ifndef _GENERIC_H
 #define _GENERIC_H
 #include "vector.h"
 
+struct strbuf;
 struct gen_multipath;
 struct gen_pathgroup;
 struct gen_path;
@@ -52,26 +51,24 @@ struct gen_multipath_ops {
         * 0-terminated, no more than "len" characters including trailing '\0'.
         *
         * @param gmp: generic multipath object to act on
-        * @param buf: output buffer
-        * @param buflen: buffer size
+        * @param buf: output struct strbuf
         * @param wildcard: the multipath wildcard (see print.c)
         * @returns the number of characters printed (without trailing '\0').
         */
        int (*snprint)(const struct gen_multipath*,
-                      char *buf, int len, char wildcard);
+                      struct strbuf *buf, char wildcard);
        /**
         * method: style(gmp, buf, len, verbosity)
         * returns the format string to be used for the multipath object,
         * defined with the wildcards as defined in print.c
         * generic_style() should work well in most cases.
         * @param gmp: generic multipath object to act on
-        * @param buf: output buffer
-        * @param buflen: buffer size
+        * @param buf: output strbuf
         * @param verbosity: verbosity level
         * @returns number of format chars printed
         */
        int (*style)(const struct gen_multipath*,
-                    char *buf, int len, int verbosity);
+                    struct strbuf *buf, int verbosity);
 };
 
 /**
@@ -97,7 +94,7 @@ struct gen_pathgroup_ops {
         * see gen_multipath_ops->snprint() above
         */
        int (*snprint)(const struct gen_pathgroup*,
-                      char *buf, int len, char wildcard);
+                      struct strbuf *buf, char wildcard);
 };
 
 struct gen_path_ops {
@@ -106,7 +103,7 @@ struct gen_path_ops {
         * see gen_multipath_ops->snprint() above
         */
        int (*snprint)(const struct gen_path*,
-                      char *buf, int len, char wildcard);
+                      struct strbuf *buf, char wildcard);
 };
 
 struct gen_multipath {
@@ -131,6 +128,6 @@ struct gen_path {
  * foreign libraries.
  */
 int generic_style(const struct gen_multipath*,
-                 char *buf, int len, int verbosity);
+                 struct strbuf *buf, int verbosity);
 
 #endif /* _GENERIC_H */