socsvn commit: r268802 - soc2014/zkorchev/freebsd_head/bin/ls

zkorchev at FreeBSD.org zkorchev at FreeBSD.org
Thu May 29 12:12:09 UTC 2014


Author: zkorchev
Date: Thu May 29 12:12:08 2014
New Revision: 268802
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=268802

Log:
  Updated the copy of sol files

Modified:
  soc2014/zkorchev/freebsd_head/bin/ls/sol.c
  soc2014/zkorchev/freebsd_head/bin/ls/sol.h

Modified: soc2014/zkorchev/freebsd_head/bin/ls/sol.c
==============================================================================
--- soc2014/zkorchev/freebsd_head/bin/ls/sol.c	Thu May 29 12:00:04 2014	(r268801)
+++ soc2014/zkorchev/freebsd_head/bin/ls/sol.c	Thu May 29 12:12:08 2014	(r268802)
@@ -9,9 +9,6 @@
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 4. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
  *
  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
@@ -97,6 +94,13 @@
 	return 0;
 }
 
+int sol_integer(struct sol_stream *restrict stream, long long value)
+{
+	yajl_gen_integer(stream->ctx.g, value);
+
+	return 0;
+}
+
 int sol_map_start(struct sol_stream *restrict stream)
 {
 	yajl_gen_map_open(stream->ctx.g);
@@ -135,8 +139,17 @@
 {
 	// TODO error if key is expected?
 
-	// TODO ?handle special characters
 	yajl_gen_integer(stream->ctx.g, value);
 
 	return 0;
 }
+
+int sol_map_float(struct sol_stream *restrict stream, double value)
+{
+	// TODO error if key is expected?
+
+	// TODO round mantissa?
+	yajl_gen_double(stream->ctx.g, value);
+
+	return 0;
+}

Modified: soc2014/zkorchev/freebsd_head/bin/ls/sol.h
==============================================================================
--- soc2014/zkorchev/freebsd_head/bin/ls/sol.h	Thu May 29 12:00:04 2014	(r268801)
+++ soc2014/zkorchev/freebsd_head/bin/ls/sol.h	Thu May 29 12:12:08 2014	(r268802)
@@ -1,3 +1,28 @@
+/*-
+ * Copyright (c) 2014
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
 #include <yajl/yajl_gen.h>	// libyajl
 
 enum sol_format
@@ -20,6 +45,7 @@
 int sol_array_start(struct sol_stream *restrict stream);
 int sol_array_end(struct sol_stream *restrict stream);
 
+int sol_integer(struct sol_stream *restrict stream, long long value);
 int sol_string(struct sol_stream *restrict stream, const char *data, size_t length);
 
 int sol_map_start(struct sol_stream *restrict stream);
@@ -28,3 +54,4 @@
 int sol_map_key(struct sol_stream *restrict stream, const char *key, size_t length);
 int sol_map_string(struct sol_stream *restrict stream, const char *value, size_t length);
 int sol_map_integer(struct sol_stream *restrict stream, long long value);
+int sol_map_float(struct sol_stream *restrict stream, double value);


More information about the svn-soc-all mailing list