[Midnightbsd-cvs] mports [16101] trunk/devel: Add Jansson 2.5 port.
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Mar 23 11:58:55 EDT 2014
Revision: 16101
http://svnweb.midnightbsd.org/mports/?rev=16101
Author: laffer1
Date: 2014-03-23 11:58:54 -0400 (Sun, 23 Mar 2014)
Log Message:
-----------
Add Jansson 2.5 port.
Jansson is a JSON library for C.
Modified Paths:
--------------
trunk/devel/Makefile
Added Paths:
-----------
trunk/devel/jansson/
trunk/devel/jansson/Makefile
trunk/devel/jansson/distinfo
trunk/devel/jansson/files/
trunk/devel/jansson/files/patch-src_hashtable.c
trunk/devel/jansson/files/patch-src_jansson.h
trunk/devel/jansson/files/patch-src_utf.h
trunk/devel/jansson/files/patch-src_value.c
trunk/devel/jansson/pkg-descr
trunk/devel/jansson/pkg-plist
Modified: trunk/devel/Makefile
===================================================================
--- trunk/devel/Makefile 2014-03-23 03:29:24 UTC (rev 16100)
+++ trunk/devel/Makefile 2014-03-23 15:58:54 UTC (rev 16101)
@@ -113,6 +113,7 @@
SUBDIR += icu
SUBDIR += imake
SUBDIR += jakarta-commons-daemon
+SUBDIR += jansson
SUBDIR += json-glib
SUBDIR += judy
SUBDIR += kBuild
Added: trunk/devel/jansson/Makefile
===================================================================
--- trunk/devel/jansson/Makefile (rev 0)
+++ trunk/devel/jansson/Makefile 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,18 @@
+# $MidnightBSD$
+
+PORTNAME= jansson
+PORTVERSION= 2.5
+CATEGORIES= devel
+MASTER_SITES= http://www.digip.org/jansson/releases/
+
+MAINTAINER= ports at MidnightBSD.org
+COMMENT= C library for encoding, decoding, and manipulating JSON data
+
+LICENSE= mit
+
+USES= pathfix pkgconfig gmake
+USE_BZIP2= yes
+USE_LDCONFIG= yes
+GNU_CONFIGURE= yes
+
+.include <bsd.port.mk>
Added: trunk/devel/jansson/distinfo
===================================================================
--- trunk/devel/jansson/distinfo (rev 0)
+++ trunk/devel/jansson/distinfo 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,2 @@
+SHA256 (jansson-2.5.tar.bz2) = 262f5a3e9ad8f5d8b3c8683e8c57b5148ff0ad97cfe3d6f10b8b15ece126e4c7
+SIZE (jansson-2.5.tar.bz2) = 312937
Added: trunk/devel/jansson/files/patch-src_hashtable.c
===================================================================
--- trunk/devel/jansson/files/patch-src_hashtable.c (rev 0)
+++ trunk/devel/jansson/files/patch-src_hashtable.c 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,56 @@
+--- src/hashtable.c.orig 2013-09-20 01:47:31.000000000 +0800
++++ src/hashtable.c 2013-09-25 06:17:31.000000000 +0800
+@@ -118,10 +118,10 @@ static int hashtable_do_del(hashtable_t
+ {
+ pair_t *pair;
+ bucket_t *bucket;
+- size_t index;
++ size_t ind;
+
+- index = hash % num_buckets(hashtable);
+- bucket = &hashtable->buckets[index];
++ ind = hash % num_buckets(hashtable);
++ bucket = &hashtable->buckets[ind];
+
+ pair = hashtable_find_pair(hashtable, bucket, key, hash);
+ if(!pair)
+@@ -163,7 +163,7 @@ static int hashtable_do_rehash(hashtable
+ {
+ list_t *list, *next;
+ pair_t *pair;
+- size_t i, index, new_size;
++ size_t i, ind, new_size;
+
+ jsonp_free(hashtable->buckets);
+
+@@ -186,8 +186,8 @@ static int hashtable_do_rehash(hashtable
+ for(; list != &hashtable->list; list = next) {
+ next = list->next;
+ pair = list_to_pair(list);
+- index = pair->hash % new_size;
+- insert_to_bucket(hashtable, &hashtable->buckets[index], &pair->list);
++ ind = pair->hash % new_size;
++ insert_to_bucket(hashtable, &hashtable->buckets[ind], &pair->list);
+ }
+
+ return 0;
+@@ -227,7 +227,7 @@ int hashtable_set(hashtable_t *hashtable
+ {
+ pair_t *pair;
+ bucket_t *bucket;
+- size_t hash, index;
++ size_t hash, ind;
+
+ /* rehash if the load ratio exceeds 1 */
+ if(hashtable->size >= num_buckets(hashtable))
+@@ -235,8 +235,8 @@ int hashtable_set(hashtable_t *hashtable
+ return -1;
+
+ hash = hash_str(key);
+- index = hash % num_buckets(hashtable);
+- bucket = &hashtable->buckets[index];
++ ind = hash % num_buckets(hashtable);
++ bucket = &hashtable->buckets[ind];
+ pair = hashtable_find_pair(hashtable, bucket, key, hash);
+
+ if(pair)
Added: trunk/devel/jansson/files/patch-src_jansson.h
===================================================================
--- trunk/devel/jansson/files/patch-src_jansson.h (rev 0)
+++ trunk/devel/jansson/files/patch-src_jansson.h 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,33 @@
+--- src/jansson.h.orig 2013-09-25 06:11:34.000000000 +0800
++++ src/jansson.h 2013-09-25 06:13:20.000000000 +0800
+@@ -148,10 +148,10 @@ int json_object_iter_set_new(json_t *obj
+ key && (value = json_object_iter_value(json_object_key_to_iter(key))); \
+ key = json_object_iter_key(json_object_iter_next(object, json_object_key_to_iter(key))))
+
+-#define json_array_foreach(array, index, value) \
+- for(index = 0; \
+- index < json_array_size(array) && (value = json_array_get(array, index)); \
+- index++)
++#define json_array_foreach(array, ind, value) \
++ for(ind = 0; \
++ ind < json_array_size(array) && (value = json_array_get(array, ind)); \
++ ind++)
+
+ static JSON_INLINE
+ int json_object_set(json_t *object, const char *key, json_t *value)
+@@ -172,11 +172,11 @@ int json_object_iter_set(json_t *object,
+ }
+
+ size_t json_array_size(const json_t *array);
+-json_t *json_array_get(const json_t *array, size_t index);
+-int json_array_set_new(json_t *array, size_t index, json_t *value);
++json_t *json_array_get(const json_t *array, size_t ind);
++int json_array_set_new(json_t *array, size_t ind, json_t *value);
+ int json_array_append_new(json_t *array, json_t *value);
+-int json_array_insert_new(json_t *array, size_t index, json_t *value);
+-int json_array_remove(json_t *array, size_t index);
++int json_array_insert_new(json_t *array, size_t ind, json_t *value);
++int json_array_remove(json_t *array, size_t ind);
+ int json_array_clear(json_t *array);
+ int json_array_extend(json_t *array, json_t *other);
+
Added: trunk/devel/jansson/files/patch-src_utf.h
===================================================================
--- trunk/devel/jansson/files/patch-src_utf.h (rev 0)
+++ trunk/devel/jansson/files/patch-src_utf.h 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,11 @@
+--- src/utf.h.orig 2010-01-30 20:53:52.000000000 +0800
++++ src/utf.h 2010-01-30 20:54:05.000000000 +0800
+@@ -8,6 +8,8 @@
+ #ifndef UTF_H
+ #define UTF_H
+
++#include <sys/types.h>
++
+ int utf8_encode(int codepoint, char *buffer, int *size);
+
+ int utf8_check_first(char byte);
Added: trunk/devel/jansson/files/patch-src_value.c
===================================================================
--- trunk/devel/jansson/files/patch-src_value.c (rev 0)
+++ trunk/devel/jansson/files/patch-src_value.c 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,110 @@
+--- src/value.c.orig 2013-09-25 06:13:36.000000000 +0800
++++ src/value.c 2013-09-25 06:15:37.000000000 +0800
+@@ -360,20 +360,20 @@ size_t json_array_size(const json_t *jso
+ return json_to_array(json)->entries;
+ }
+
+-json_t *json_array_get(const json_t *json, size_t index)
++json_t *json_array_get(const json_t *json, size_t ind)
+ {
+ json_array_t *array;
+ if(!json_is_array(json))
+ return NULL;
+ array = json_to_array(json);
+
+- if(index >= array->entries)
++ if(ind >= array->entries)
+ return NULL;
+
+- return array->table[index];
++ return array->table[ind];
+ }
+
+-int json_array_set_new(json_t *json, size_t index, json_t *value)
++int json_array_set_new(json_t *json, size_t ind, json_t *value)
+ {
+ json_array_t *array;
+
+@@ -387,14 +387,14 @@ int json_array_set_new(json_t *json, siz
+ }
+ array = json_to_array(json);
+
+- if(index >= array->entries)
++ if(ind >= array->entries)
+ {
+ json_decref(value);
+ return -1;
+ }
+
+- json_decref(array->table[index]);
+- array->table[index] = value;
++ json_decref(array->table[ind]);
++ array->table[ind] = value;
+
+ return 0;
+ }
+@@ -466,7 +466,7 @@ int json_array_append_new(json_t *json,
+ return 0;
+ }
+
+-int json_array_insert_new(json_t *json, size_t index, json_t *value)
++int json_array_insert_new(json_t *json, size_t ind, json_t *value)
+ {
+ json_array_t *array;
+ json_t **old_table;
+@@ -480,7 +480,7 @@ int json_array_insert_new(json_t *json,
+ }
+ array = json_to_array(json);
+
+- if(index > array->entries) {
++ if(ind > array->entries) {
+ json_decref(value);
+ return -1;
+ }
+@@ -492,21 +492,21 @@ int json_array_insert_new(json_t *json,
+ }
+
+ if(old_table != array->table) {
+- array_copy(array->table, 0, old_table, 0, index);
+- array_copy(array->table, index + 1, old_table, index,
+- array->entries - index);
++ array_copy(array->table, 0, old_table, 0, ind);
++ array_copy(array->table, ind + 1, old_table, ind,
++ array->entries - ind);
+ jsonp_free(old_table);
+ }
+ else
+- array_move(array, index + 1, index, array->entries - index);
++ array_move(array, ind + 1, ind, array->entries - ind);
+
+- array->table[index] = value;
++ array->table[ind] = value;
+ array->entries++;
+
+ return 0;
+ }
+
+-int json_array_remove(json_t *json, size_t index)
++int json_array_remove(json_t *json, size_t ind)
+ {
+ json_array_t *array;
+
+@@ -514,14 +514,14 @@ int json_array_remove(json_t *json, size
+ return -1;
+ array = json_to_array(json);
+
+- if(index >= array->entries)
++ if(ind >= array->entries)
+ return -1;
+
+- json_decref(array->table[index]);
++ json_decref(array->table[ind]);
+
+ /* If we're removing the last element, nothing has to be moved */
+- if(index < array->entries - 1)
+- array_move(array, index, index + 1, array->entries - index - 1);
++ if(ind < array->entries - 1)
++ array_move(array, ind, ind + 1, array->entries - ind - 1);
+
+ array->entries--;
+
Added: trunk/devel/jansson/pkg-descr
===================================================================
--- trunk/devel/jansson/pkg-descr (rev 0)
+++ trunk/devel/jansson/pkg-descr 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,14 @@
+Jansson is a C library for encoding, decoding and manipulating JSON
+data. Its main features and design principles are:
+
+- Simple and intuitive API and data model
+
+- Comprehensive documentation
+
+- No dependencies on other libraries
+
+- Full Unicode support (UTF-8)
+
+- Extensive test suite
+
+WWW: http://www.digip.org/jansson/
Added: trunk/devel/jansson/pkg-plist
===================================================================
--- trunk/devel/jansson/pkg-plist (rev 0)
+++ trunk/devel/jansson/pkg-plist 2014-03-23 15:58:54 UTC (rev 16101)
@@ -0,0 +1,7 @@
+include/jansson.h
+include/jansson_config.h
+lib/libjansson.a
+lib/libjansson.la
+lib/libjansson.so
+lib/libjansson.so.9
+libdata/pkgconfig/jansson.pc
More information about the Midnightbsd-cvs
mailing list