Renamed /lib/str_to_bytes.c and /include str_to bytes.h

The str_to_bytes files have been renamed to bytes_by_prefix in order
to make it easier for anyone to understand the purpose of the file,
the functions of the file have also been ranmed accordingly.

Furthermore any call to the file or its functions by other functions,
manpages etc. have been modified to comply with the new names.

Signed-off-by: Marios Makris <marios.makris@gmail.com>
Reviewed-by: Wanlong Gao <gaowanlong@cn.fujitsu.com>
Acked-by: Cyril Hrubis <chrubis@suse.cz>
diff --git a/README.ltp-devel.in b/README.ltp-devel.in
index 5538997..50c377e 100644
--- a/README.ltp-devel.in
+++ b/README.ltp-devel.in
@@ -44,5 +44,5 @@
 	man parse_ranges
 	man random_range
 	man rmobj
-	man str_to_bytes
+	man bytes_by_prefix
 	man write_log
diff --git a/doc/man3/str_to_bytes.3 b/doc/man3/bytes_by_prefix.3
similarity index 76%
rename from doc/man3/str_to_bytes.3
rename to doc/man3/bytes_by_prefix.3
index 0c5d2fc..ae20b60 100644
--- a/doc/man3/str_to_bytes.3
+++ b/doc/man3/bytes_by_prefix.3
@@ -1,5 +1,5 @@
 .\"
-.\" $Id: str_to_bytes.3,v 1.1 2000/07/27 16:59:03 alaffin Exp $
+.\" $Id: bytes_by_prefix.3,v 1.1 2000/07/27 16:59:03 alaffin Exp $
 .\"
 .\" Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
 .\" 
@@ -31,19 +31,19 @@
 .\" 
 .\" http://oss.sgi.com/projects/GenInfo/NoticeExplan/
 .\"
-.TH STR_TO_BYTES 3 07/25/2000 "Linux Test Project"
+.TH BYTES_BY_PREFIX 3 07/25/2000 "Linux Test Project"
 .SH NAME
-str_to_bytes \- convert a string to a int byte count
-str_to_lbytes \- convert a string to a long byte count
-str_to_llbytes \- convert a string to a long long byte count
+bytes_by_prefix \- convert a string to a int byte count
+lbytes_by_prefix \- convert a string to a long byte count
+llbytes_by_prefix \- convert a string to a long long byte count
 .SH SYNOPSIS
-int str_to_byte(char *\fIstr\fR);
+int bytes_by_prefix(char *\fIstr\fR);
 .br
-long str_to_lbyte(char *\fIstr\fR);
+long lbytes_by_prefix(char *\fIstr\fR);
 .br
-long long str_to_llbyte(char *\fIstr\fR);
+long long llbytes_by_prefix(char *\fIstr\fR);
 .SH DESCRIPTION
-\fBstr_to_bytes()\fR, \fBstr_to_lbytes()\fR, and \fBstr_to_llbytes()\fR converts
+\fBbytes_by_prefix()\fR, \fBlbytes_by_prefix()\fR, and \fBllbytes_by_prefix()\fR converts
 \fIstr\fR to an integer, long, or long long  byte count.  \fIstr\fR is an
 floating point number optionally followed by a single character multiplier.
 Currently the following multipliers are supported:
@@ -61,7 +61,7 @@
 .fi
 .sp
 \fIstr\fR is interpreted as floating point number (base 10).
-When using \fBstr_to_llbytes()\fR, the uppercase suffix will result
+When using \fBllbytes_by_prefix()\fR, the uppercase suffix will result
 in multiplying by the size of a (long long) or 8.
 .SH RETURNS
 -1 if the integer portion of \fIstr\fR is invalid, if an unsupported
@@ -69,18 +69,18 @@
 characters.  If \fIstr\fR contains a negative number, the return
 value will be negative.
 .SH EXAMPLES
-\fBstr_to_bytes("1000")\fR
+\fBbytes_by_prefix("1000")\fR
 .br
 .RS 8
 Returns 1000
 .RE
 .br
-\fBstr_to_bytes("5b")\fR
+\fBbytes_by_prefix("5b")\fR
 .br 
 .RS 8 
 Returns 5 * BSIZE.
 .RE
-\fBstr_to_bytes("1.5m")\fR
+\fBbytes_by_prefix("1.5m")\fR
 .br
 .RS 8
 Returns 1.5 * 1048576 or 1572864
@@ -88,10 +88,10 @@
 
 .SH LIMITATIONS
 
-\fBstr_to_bytes()\fR and \fBstr_to_lbytes()\fR when compiled as
+\fBbytes_by_prefix()\fR and \fBlbytes_by_prefix()\fR when compiled as
 a 32 bit IRIX binary can only return a max number of 2g (2147483647).
-However, \fBstr_to_lbytes()\fR is not limited by the 2g limit when
-compiled as 64 bit binary, where \fBstr_to_bytes()\fR still is limited.
+However, \fBlbytes_by_prefix()\fR is not limited by the 2g limit when
+compiled as 64 bit binary, where \fBbytes_by_prefix()\fR still is limited.
 
 Note that the size of long will vary depending how if compiled as
 a 32 or 64 bit binary.  The size of a long long is always 8.
diff --git a/doc/man3/parse_ranges.3 b/doc/man3/parse_ranges.3
index 9259317..d7830a3 100644
--- a/doc/man3/parse_ranges.3
+++ b/doc/man3/parse_ranges.3
@@ -161,7 +161,7 @@
 .SH "SEE ALSO"
 random_range(3),
 random_range_seed(3),
-str_to_bytes(3).
+bytes_by_prefix(3).
 .SH DIAGNOSTICS
 parse_ranges() returns -1 on error or the number of ranges parsed.  No space
 will be malloc'd if parse_ranges() fails.  Error
diff --git a/include/str_to_bytes.h b/include/bytes_by_prefix.h
similarity index 89%
rename from include/str_to_bytes.h
rename to include/bytes_by_prefix.h
index 314eb88..f3465fa 100644
--- a/include/str_to_bytes.h
+++ b/include/bytes_by_prefix.h
@@ -29,11 +29,11 @@
  *
  * http://oss.sgi.com/projects/GenInfo/NoticeExplan/
  */
-#ifndef _STR_TO_BYTES_
-#define _STR_TO_BYTES_
+#ifndef _BYTES_BY_PREFIX_
+#define _BYTES_BY_PREFIX_
 
-int str_to_bytes(char *);
-long str_to_lbytes(char *);
-long long str_to_llbytes(char *);
+int bytes_by_prefix(char *);
+long lbytes_by_prefix(char *);
+long long llbytes_by_prefix(char *);
 
 #endif
diff --git a/lib/str_to_bytes.c b/lib/bytes_by_prefix.c
similarity index 88%
rename from lib/str_to_bytes.c
rename to lib/bytes_by_prefix.c
index f18291c..b9ac565 100644
--- a/lib/str_to_bytes.c
+++ b/lib/bytes_by_prefix.c
@@ -31,10 +31,10 @@
  */
 #include <stdio.h>
 #include <sys/param.h>
-#include "str_to_bytes.h"
+#include "bytes_by_prefix.h"
 
 /****************************************************************************
- * str_to_bytes(s)
+ * bytes_by_prefix(s)
  *
  * Computes the number of bytes described by string s.  s is assumed to be
  * a base 10 positive (ie. >= 0) number followed by an optional single
@@ -50,7 +50,7 @@
  *              g       2^30 (1073741824)
  *              G       2^30 (1073741824) * sizeof(long)
  *
- * for instance, "1k" and "1024" would both cause str_to_bytes to return 1024.
+ * for instance, "1k" and "1024" would both cause bytes_by_prefix to return 1024
  *
  * Returns -1 if mult is an invalid character, or if the integer portion of
  * s is not a positive integer.
@@ -72,7 +72,7 @@
 #define G_MULT	1073741824	/* Giga or 2^30 */
 #define T_MULT	1099511627776	/* tera or 2^40 */
 
-int str_to_bytes(char *s)
+int bytes_by_prefix(char *s)
 {
 	char mult, junk;
 	int nconv;
@@ -105,7 +105,7 @@
 	}
 }
 
-long str_to_lbytes(char *s)
+long lbytes_by_prefix(char *s)
 {
 	char mult, junk;
 	long nconv;
@@ -142,7 +142,7 @@
  * Force 64 bits number when compiled as 32 IRIX binary.
  * This allows for a number bigger than 2G.
  */
-long long str_to_llbytes(char *s)
+long long llbytes_by_prefix(char *s)
 {
 	char mult, junk;
 	long nconv;
@@ -182,20 +182,20 @@
 	int ind;
 
 	if (argc == 1) {
-		fprintf(stderr, "missing str_to_bytes() parameteres\n");
+		fprintf(stderr, "missing bytes_by_prefix() parameteres\n");
 		exit(1);
 	}
 
 	for (ind = 1; ind < argc; ind++) {
 
-		printf("str_to_bytes(%s) returned %d\n",
-		       argv[ind], str_to_bytes(argv[ind]));
+		printf("bytes_by_prefix(%s) returned %d\n",
+		       argv[ind], bytes_by_prefix(argv[ind]));
 
-		printf("str_to_lbytes(%s) returned %ld\n",
-		       argv[ind], str_to_lbytes(argv[ind]));
+		printf("lbytes_by_prefix(%s) returned %ld\n",
+		       argv[ind], lbytes_by_prefix(argv[ind]));
 
-		printf("str_to_llbytes(%s) returned %lld\n",
-		       argv[ind], str_to_llbytes(argv[ind]));
+		printf("llbytes_by_prefix(%s) returned %lld\n",
+		       argv[ind], llbytes_by_prefix(argv[ind]));
 	}
 }
 
diff --git a/ltp-devel.spec.in b/ltp-devel.spec.in
index 83d0942..8205723 100644
--- a/ltp-devel.spec.in
+++ b/ltp-devel.spec.in
@@ -28,7 +28,7 @@
 @prefix@/include/libtestsuite.h
 @prefix@/include/usctest.h
 @prefix@/include/string_to_tokens.h
-@prefix@/include/str_to_bytes.h
+@prefix@/include/bytes_by_prefix.h
 @prefix@/include/databin.h
 @prefix@/include/open_flags.h
 @prefix@/include/write_log.h
@@ -53,7 +53,7 @@
 @mandir@/man3/parse_open_flags.3
 @mandir@/man3/tst_res.3
 @mandir@/man3/write_log.3
-@mandir@/man3/str_to_bytes.3
+@mandir@/man3/bytes_by_prefix.3
 @mandir@/man3/tst_set_error.3
 @mandir@/man3/parse_opts.3
 @mandir@/man3/string_to_tokens.3
diff --git a/testcases/kernel/fs/doio/iogen.c b/testcases/kernel/fs/doio/iogen.c
index 167edbd..f594007 100644
--- a/testcases/kernel/fs/doio/iogen.c
+++ b/testcases/kernel/fs/doio/iogen.c
@@ -61,7 +61,7 @@
 #include "libkern.h"
 #endif
 #include "doio.h"
-#include "str_to_bytes.h"
+#include "bytes_by_prefix.h"
 #include "string_to_tokens.h"
 #include "open_flags.h"
 #include "random_range.h"
@@ -1555,7 +1555,7 @@
 	    break;
 
 	case 'r':
-	    if ((Rawmult = str_to_bytes(optarg)) == -1 ||
+	    if ((Rawmult = bytes_by_prefix(optarg)) == -1 ||
 		          Rawmult < 11 || Rawmult % BSIZE) {
 		fprintf(stderr, "iogen%s:  Illegal -r arg (%s).  Must be > 0 and multipe of BSIZE (%d)\n",
 			TagName, optarg, BSIZE);
@@ -1587,7 +1587,7 @@
 	    break;
 
 	case 't':
-	    if ((Mintrans = str_to_bytes(optarg)) == -1) {
+	    if ((Mintrans = bytes_by_prefix(optarg)) == -1) {
 		fprintf(stderr, "iogen%s:  Illegal -t arg (%s):  Must have the form num[bkm]\n", TagName, optarg);
 		exit(1);
 	    }
@@ -1595,7 +1595,7 @@
 	    break;
 
 	case 'T':
-	    if ((Maxtrans = str_to_bytes(optarg)) == -1) {
+	    if ((Maxtrans = bytes_by_prefix(optarg)) == -1) {
 		fprintf(stderr, "iogen%s:  Illegal -T arg (%s):  Must have the form num[bkm]\n", TagName, optarg);
 		exit(1);
 	    }
@@ -1740,7 +1740,7 @@
 
 	    if ((cp = strchr(argv[optind], ':')) != NULL) {
 	        *cp = '\0';
-	        if ((len = str_to_bytes(argv[optind])) == -1) {
+	        if ((len = bytes_by_prefix(argv[optind])) == -1) {
 		    fprintf(stderr,
 			    "iogen%s:  illegal file length (%s) for file %s\n",
 			    TagName, argv[optind], cp+1);