]> www.infradead.org Git - mtd-utils.git/commitdiff
Remove unused ubiutils_print_text from ubi-utils common
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 1 Sep 2016 13:08:06 +0000 (15:08 +0200)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Thu, 17 Nov 2016 10:36:56 +0000 (11:36 +0100)
The function ubiutils_print_text was previously used by ubinize to
pretty-print parts of the help text. Since the help text has been
moved to a man page, the function is no longer used/needed.

Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
ubi-utils/include/ubiutils-common.h
ubi-utils/ubiutils-common.c

index 9762837e63aff5fa1543b5bfc6d5d88bdfe993b7..99c18f73cf6bf23440ecb487e2d0a594286b873e 100644 (file)
@@ -25,7 +25,6 @@ extern "C" {
 
 long long ubiutils_get_bytes(const char *str);
 void ubiutils_print_bytes(long long bytes, int bracket);
-void ubiutils_print_text(FILE *stream, const char *txt, int len);
 int ubiutils_srand(void);
 
 #ifdef __cplusplus
index 6609a6b4649d0d4b24fa1b92ebccea5fb967cfaf..563678596c2dcc48344af2b0e70d8dc830d1c047 100644 (file)
@@ -128,59 +128,6 @@ void ubiutils_print_bytes(long long bytes, int bracket)
                printf(")");
 }
 
-/**
- * ubiutils_print_text - print text and fold it.
- * @stream: file stream to print to
- * @text: text to print
- * @width: maximum allowed text width
- *
- * Print text and fold it so that each line would not have more then @width
- * characters.
- */
-void ubiutils_print_text(FILE *stream, const char *text, int width)
-{
-       int pos, bpos = 0;
-       const char *p;
-       char line[1024];
-
-       if (width > 1023) {
-               fprintf(stream, "%s\n", text);
-               return;
-       }
-       p = text;
-       pos = 0;
-       while (p[pos]) {
-               while (!isspace(p[pos])) {
-                       line[pos] = p[pos];
-                       if (!p[pos])
-                               break;
-                       ++pos;
-                       if (pos == width) {
-                               line[pos] = '\0';
-                               fprintf(stream, "%s\n", line);
-                               p += pos;
-                               pos = 0;
-                       }
-               }
-               while (pos < width) {
-                       line[pos] = p[pos];
-                       if (!p[pos]) {
-                               bpos = pos;
-                               break;
-                       }
-                       if (isspace(p[pos]))
-                               bpos = pos;
-                       ++pos;
-               }
-               line[bpos] = '\0';
-               fprintf(stream, "%s\n", line);
-               p += bpos;
-               pos = 0;
-               while (p[pos] && isspace(p[pos]))
-                       ++p;
-       }
-}
-
 /**
  * ubiutils_srand - randomly seed the standard pseudo-random generator.
  *