summaryrefslogtreecommitdiff
path: root/util/nvramtool/common.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-01-13 21:00:23 +0000
committerStefan Reinauer <stepan@openbios.org>2010-01-13 21:00:23 +0000
commit90b96b68e0fedbc1d76e8547cad39c57021d5119 (patch)
tree115d59e288347288b4ab1fa913bc783383a55805 /util/nvramtool/common.c
parent766db7ea09addca79d91436cb7ac06a9bff491a5 (diff)
downloadcoreboot-90b96b68e0fedbc1d76e8547cad39c57021d5119.tar.xz
indent all of nvramtool to make it fit into coreboot's
coding style Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5007 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'util/nvramtool/common.c')
-rw-r--r--util/nvramtool/common.c97
1 files changed, 50 insertions, 47 deletions
diff --git a/util/nvramtool/common.c b/util/nvramtool/common.c
index bf2158b1d4..c80c2da6df 100644
--- a/util/nvramtool/common.c
+++ b/util/nvramtool/common.c
@@ -42,27 +42,29 @@ const char prog_version[] = "2.1";
* Get a line of input from file 'f'. Store result in 'line' which is an
* array of 'line_buf_size' bytes.
****************************************************************************/
-int get_line_from_file (FILE *f, char line[], int line_buf_size)
- { if (fgets(line, line_buf_size, f) == NULL)
- return LINE_EOF;
+int get_line_from_file(FILE * f, char line[], int line_buf_size)
+{
+ if (fgets(line, line_buf_size, f) == NULL)
+ return LINE_EOF;
- /* If the file contains a line that is too long, then it's best to let the
- * user know right away rather than passing back a truncated result that
- * will lead to problems later on.
- */
- return (strlen(line) == ((size_t) (line_buf_size - 1))) ?
- LINE_TOO_LONG : OK;
- }
+ /* If the file contains a line that is too long, then it's best
+ * to let the user know right away rather than passing back a
+ * truncated result that will lead to problems later on.
+ */
+ return (strlen(line) == ((size_t) (line_buf_size - 1))) ?
+ LINE_TOO_LONG : OK;
+}
/****************************************************************************
* out_of_memory
*
* We ran out of memory. Print an error message and die.
****************************************************************************/
-void out_of_memory (void)
- { fprintf(stderr, "%s: Out of memory.\n", prog_name);
- exit(1);
- }
+void out_of_memory(void)
+{
+ fprintf(stderr, "%s: Out of memory.\n", prog_name);
+ exit(1);
+}
/****************************************************************************
* usage
@@ -70,36 +72,37 @@ void out_of_memory (void)
* Write a usage message to 'outfile'. If 'outfile' is 'stderr' then exit
* with a value of 1. Otherwise exit with a value of 0.
****************************************************************************/
-void usage (FILE *outfile)
- { fprintf(outfile,
- "Usage: %s [-y LAYOUT_FILE | -t] PARAMETER ...\n\n"
- " Read/write coreboot parameters or show info from "
- "coreboot table.\n\n"
- " -y LAYOUT_FILE: Use CMOS layout specified by "
- "LAYOUT_FILE.\n"
- " -t: Use CMOS layout specified by CMOS option "
- "table.\n"
- " [-n] -r NAME: Show parameter NAME. If -n is given, "
- "show value only.\n"
- " -e NAME: Show all possible values for parameter "
- "NAME.\n"
- " -a: Show names and values for all "
- "parameters.\n"
- " -w NAME=VALUE: Set parameter NAME to VALUE.\n"
- " -p INPUT_FILE: Set parameters according to INPUT_FILE.\n"
- " -i: Same as -p but file contents taken from "
- "standard input.\n"
- " -c [VALUE]: Show CMOS checksum or set checksum to "
- "VALUE.\n"
- " -l [ARG]: Show coreboot table info for ARG, or "
- "all ARG choices.\n"
- " -d: Show low-level dump of coreboot table.\n"
- " -Y: Show CMOS layout info.\n"
- " -b OUTPUT_FILE: Dump CMOS memory contents to file.\n"
- " -B INPUT_FILE: Write file contents to CMOS memory.\n"
- " -x: Show hex dump of CMOS memory.\n"
- " -X DUMPFILE: Show hex dump of CMOS dumpfile.\n"
- " -v: Show version info for this program.\n"
- " -h: Show this message.\n", prog_name);
- exit(outfile == stderr);
- }
+void usage(FILE * outfile)
+{
+ fprintf(outfile,
+ "Usage: %s [-y LAYOUT_FILE | -t] PARAMETER ...\n\n"
+ " Read/write coreboot parameters or show info from "
+ "coreboot table.\n\n"
+ " -y LAYOUT_FILE: Use CMOS layout specified by "
+ "LAYOUT_FILE.\n"
+ " -t: Use CMOS layout specified by CMOS option "
+ "table.\n"
+ " [-n] -r NAME: Show parameter NAME. If -n is given, "
+ "show value only.\n"
+ " -e NAME: Show all possible values for parameter "
+ "NAME.\n"
+ " -a: Show names and values for all "
+ "parameters.\n"
+ " -w NAME=VALUE: Set parameter NAME to VALUE.\n"
+ " -p INPUT_FILE: Set parameters according to INPUT_FILE.\n"
+ " -i: Same as -p but file contents taken from "
+ "standard input.\n"
+ " -c [VALUE]: Show CMOS checksum or set checksum to "
+ "VALUE.\n"
+ " -l [ARG]: Show coreboot table info for ARG, or "
+ "all ARG choices.\n"
+ " -d: Show low-level dump of coreboot table.\n"
+ " -Y: Show CMOS layout info.\n"
+ " -b OUTPUT_FILE: Dump CMOS memory contents to file.\n"
+ " -B INPUT_FILE: Write file contents to CMOS memory.\n"
+ " -x: Show hex dump of CMOS memory.\n"
+ " -X DUMPFILE: Show hex dump of CMOS dumpfile.\n"
+ " -v: Show version info for this program.\n"
+ " -h: Show this message.\n", prog_name);
+ exit(outfile == stderr);
+}