Compare commits

..

No commits in common. "master" and "fix/lua_length_checking" have entirely different histories.

37 changed files with 1136 additions and 4402 deletions

1
.gitignore vendored
View File

@ -4,7 +4,6 @@
*.lo *.lo
*.log *.log
*.trs *.trs
*.pc
sample sample
Makefile Makefile
.deps/ .deps/

View File

@ -11,7 +11,7 @@ Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "BiSON" s.name = "BiSON"
s.version = "1.2.5" s.version = "1.1.1"
s.summary = "A portable BSON C library" s.summary = "A portable BSON C library"
@ -48,7 +48,7 @@ Pod::Spec.new do |s|
# #
# When using multiple platforms # When using multiple platforms
s.ios.deployment_target = "9.0" s.ios.deployment_target = "6.0"
s.osx.deployment_target = "10.7" s.osx.deployment_target = "10.7"
s.watchos.deployment_target = "2.0" s.watchos.deployment_target = "2.0"
s.tvos.deployment_target = "9.0" s.tvos.deployment_target = "9.0"

View File

@ -0,0 +1,73 @@
apply plugin: "com.jfrog.bintray"
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'maven-publish'
def siteUrl = 'https://github.com/smartdevicelink/bson_c_lib/' // Homepage URL of the library
def gitUrl = 'https://github.com/smartdevicelink/bson_c_lib.git' // Git repository URL
group = "com.smartdevicelink" // Maven Group ID for the artifact
version = "X.X.X" // Set POM version here as well
def libDescription = 'BSON library for SmartDeviceLink'
install {
repositories.mavenInstaller {
pom {
project {
packaging 'aar'
// Add your description here
name 'com.smartdevicelink:bson_java_port'
description = libDescription
url siteUrl
// Set your license
licenses {
license {
name 'BSD 3-Clause'
url 'https://opensource.org/licenses/BSD-3-Clause'
}
}
scm {
connection gitUrl
developerConnection gitUrl
url siteUrl
}
}
}
}
}
task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
classifier = 'sources'
}
artifacts {
archives sourcesJar
}
bintray {
Properties props = new Properties()
props.load(new FileInputStream("$projectDir/bintray.properties"))
// Authorization
user = props.getProperty("bintray.user")
key = props.getProperty("bintray.key")
configurations = ['archives']
pkg {
repo = props.getProperty("bintray.repo")
name = props.getProperty("bintray.artifact")
websiteUrl = siteUrl
vcsUrl = gitUrl
userOrg = props.getProperty("bintray.userorg")
licenses = ["BSD 3-Clause"]
publish = props.getProperty("bintray.publish") // Will upload to jCenter
version {
name = props.getProperty("bintray.version") // Change to release version
desc = libDescription
released = new Date() // Will be the current date & time
vcsTag = props.getProperty("bintray.vcs") // Should match git tag
}
}
}

View File

@ -0,0 +1,8 @@
bintray.user=user
bintray.key=key
bintray.repo=sdl_android
bintray.artifact=bson_java_port
bintray.userorg=smartdevicelink
bintray.publish=false
bintray.version=x.x.x
bintray.vcs=x.x.x

View File

@ -1,12 +1,14 @@
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
android { android {
compileSdkVersion 28 compileSdkVersion 21
buildToolsVersion "27.0.3"
defaultConfig { defaultConfig {
minSdkVersion 8 minSdkVersion 8
targetSdkVersion 26 targetSdkVersion 19
versionCode 2 versionCode 1
versionName "1.2.5" versionName "1.1.1"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
ndk{ ndk{
abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64" abiFilters "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
@ -41,9 +43,9 @@ buildscript {
mavenCentral() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.13.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
} }
} }
apply plugin: "com.vanniktech.maven.publish" apply from: 'bintray.gradle'

View File

@ -1,31 +0,0 @@
GROUP=com.smartdevicelink
POM_ARTIFACT_ID=bson_java_port
VERSION_NAME=1.2.5
POM_NAME=bson_java_port
POM_PACKAGING=aar
POM_DESCRIPTION=Library for converting to and from BSON
POM_INCEPTION_YEAR=2017
POM_URL=https://github.com/smartdevicelink/bson_c_lib
POM_SCM_URL=https://github.com/smartdevicelink/bson_c_lib
POM_SCM_CONNECTION=scm:git@github.com:smartdevicelink/bson_c_lib.git
POM_SCM_DEV_CONNECTION=scm:git@github.com:smartdevicelink/bson_c_lib.git
POM_LICENCE_NAME=BSD 3-Clause
POM_LICENCE_URL=https://opensource.org/licenses/BSD-3-Clause
POM_LICENCE_DIST=repo
RELEASE_REPOSITORY_URL=https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/
SNAPSHOT_REPOSITORY_URL=https://s01.oss.sonatype.org/content/repositories/snapshots/
POM_DEVELOPER_ID=
POM_DEVELOPER_NAME=
POM_DEVELOPER_URL=
signing.keyId=
signing.password=
signing.secretKeyRingFile=
SONATYPE_NEXUS_USERNAME=
SONATYPE_NEXUS_PASSWORD=

View File

@ -1,14 +1,13 @@
package com.livio.bsonjavaport; package com.livio.bsonjavaport;
import com.livio.BSON.BsonEncoder; import android.test.AndroidTestCase;
import junit.framework.TestCase; import com.livio.BSON.BsonEncoder;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.Iterator; import java.util.Iterator;
import java.util.Map; import java.util.Map;
import java.util.Random;
import java.util.Set; import java.util.Set;
/** /**
@ -16,11 +15,10 @@ import java.util.Set;
* *
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a> * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/ */
public class BsonEncoderTests extends TestCase { public class BsonEncoderTests extends AndroidTestCase{
private HashMap<String, Object> testMapA; private HashMap<String, Object> testMapA;
private HashMap<String, Object> testMapB; private HashMap<String, Object> testMapB;
private HashMap<String, Object> testMapC;
private byte[] testMapAbytes, testMapBbytes; private byte[] testMapAbytes, testMapBbytes;
public void setUp() throws Exception{ public void setUp() throws Exception{
@ -54,41 +52,6 @@ public class BsonEncoderTests extends TestCase {
"00" + "00" +
"00" "00"
); );
testMapC = new HashMap<>();
HashMap<String, Object> map2 = new HashMap<>();
HashMap<String, Object> map3 = new HashMap<>();
ArrayList<Object> list2 = new ArrayList<>();
ArrayList<Object> list3 = new ArrayList<>();
testMapC.put("correct", true);
testMapC.put("one", 64);
testMapC.put("two", 2.5);
testMapC.put("chars", "aaaaaaaaaaaa");
map2.put("a", 604);
map2.put("b", "AnotherString");
map2.put("c", 2.45);
testMapC.put("MapTest", map2);
list2.add(23);
list2.add(5.4);
list2.add("A string");
map3.put("i", 64);
map3.put("Test", 4);
list3.add(235);
list3.add(5.54);
list3.add("AString");
map3.put("secondarray", list3);
list2.add(map3);
testMapC.put("ArrayTest", list2);
} }
public void testEncoding(){ public void testEncoding(){
@ -97,7 +60,7 @@ public class BsonEncoderTests extends TestCase {
try { try {
assertEquals(observedMapAbytes[i], testMapAbytes[i]); assertEquals(observedMapAbytes[i], testMapAbytes[i]);
}catch (Exception e){ }catch (Exception e){
fail(); assert(false);
} }
} }
@ -106,7 +69,7 @@ public class BsonEncoderTests extends TestCase {
try { try {
assertEquals(observedMapBbytes[i], testMapBbytes[i]); assertEquals(observedMapBbytes[i], testMapBbytes[i]);
}catch (Exception e){ }catch (Exception e){
fail(); assert(false);
} }
} }
} }
@ -115,22 +78,8 @@ public class BsonEncoderTests extends TestCase {
HashMap<String, Object> decodedMapA = BsonEncoder.decodeFromBytes(testMapAbytes); HashMap<String, Object> decodedMapA = BsonEncoder.decodeFromBytes(testMapAbytes);
HashMap<String, Object> decodedMapB = BsonEncoder.decodeFromBytes(testMapBbytes); HashMap<String, Object> decodedMapB = BsonEncoder.decodeFromBytes(testMapBbytes);
assertTrue(compareHashMaps(testMapA, decodedMapA)); assert(compareHashMaps(testMapA, decodedMapA));
assertTrue(compareHashMaps(testMapB, decodedMapB)); assert(compareHashMaps(testMapB, decodedMapB));
}
public void testDecodingRandomData() {
// Checking for proper handling of invalid data
byte[] randomBytes = new byte[200];
new Random().nextBytes(randomBytes);
BsonEncoder.decodeFromBytes(randomBytes);
}
public void testEncodeDecodeConsistency() {
// Test nested objects and arrays
byte[] bytes = BsonEncoder.encodeToBytes(testMapC);
HashMap<String, Object> outMap = BsonEncoder.decodeFromBytes(bytes);
assertEquals(testMapC, outMap);
} }
private boolean compareHashMaps(HashMap<String,Object> testMap, HashMap<String,Object> obsvMap){ private boolean compareHashMaps(HashMap<String,Object> testMap, HashMap<String,Object> obsvMap){

View File

@ -8,130 +8,105 @@ public class BsonEncoder {
static { static {
System.loadLibrary("bson-c-lib"); System.loadLibrary("bson-c-lib");
} }
@SuppressWarnings("unchecked")
public static byte[] encodeToBytes(HashMap<String, Object> map) throws ClassCastException {
long bsonRef = buildBsonObject(map);
byte[] bytes = bson_object_to_bytes(bsonRef);
deinitializeBsonObject(bsonRef); public static byte[] encodeToBytes(HashMap<String, Object> map) throws ClassCastException {
long bsonRef = initializeBsonObject();
long arrayRef = -1;
return bytes; for (String key : map.keySet()) {
} Object value = map.get(key);
if (value instanceof List){
arrayRef = buildBsonArray((List<Object>) value);
bson_object_put_array(bsonRef, key, arrayRef);
} else if (value instanceof Integer) {
bson_object_put_int32(bsonRef, key, (Integer) value);
} else if (value instanceof Long) {
bson_object_put_int64(bsonRef, key, (Long) value);
} else if (value instanceof String) {
bson_object_put_string(bsonRef, key, (String) value);
} else if (value instanceof Boolean) {
bson_object_put_bool(bsonRef, key, (Boolean) value);
} else if (value instanceof Double) {
bson_object_put_double(bsonRef, key, (Double) value);
}
}
public static HashMap<String, Object> decodeFromBytes(byte[] bytes){ byte[] bytes = bson_object_to_bytes(bsonRef);
HashMap<String, Object> map = new HashMap<String, Object>(); deinitializeBsonObject(bsonRef);
long bsonRef = bson_object_from_bytes(bytes); return bytes;
if (bsonRef == -1) { }
return map;
}
map = bson_object_get_hashmap(bsonRef);
deinitializeBsonObject(bsonRef);
return map; public static HashMap<String, Object> decodeFromBytes(byte[] bytes){
}
private static long buildBsonObject(HashMap<String, Object> elements) throws ClassCastException { HashMap<String, Object> map = new HashMap<String, Object>();
long bsonRef = initializeBsonObject();
for (String key : elements.keySet()) { long bsonRef = bson_object_from_bytes(bytes);
Object value = elements.get(key); map = bson_object_get_hashmap(bsonRef);
if (value instanceof HashMap){ return map;
long subObjRef = buildBsonObject((HashMap<String, Object>) value); }
bson_object_put_object(bsonRef, key, subObjRef);
} else if (value instanceof List){
long arrayRef = buildBsonArray((List<Object>) value);
bson_object_put_array(bsonRef, key, arrayRef);
} else if (value instanceof Integer) {
bson_object_put_int32(bsonRef, key, (Integer) value);
} else if (value instanceof Long) {
bson_object_put_int64(bsonRef, key, (Long) value);
} else if (value instanceof String) {
bson_object_put_string(bsonRef, key, (String) value);
} else if (value instanceof Boolean) {
bson_object_put_bool(bsonRef, key, (Boolean) value);
} else if (value instanceof Double) {
bson_object_put_double(bsonRef, key, (Double) value);
}
}
return bsonRef; private static long buildBsonArray(List<Object> elements) {
}
private static long buildBsonArray(List<Object> elements) throws ClassCastException { long bsonRef = initializeBsonArray();
long bsonRef = initializeBsonArray(elements.size());
for(Object value : elements){ for(Object e : elements){
if (value instanceof HashMap){ if (e instanceof Integer) {
long subObjRef = buildBsonObject((HashMap<String, Object>) value); bson_array_add_int32(bsonRef, (Integer) e);
bson_array_add_object(bsonRef, subObjRef); } else if (e instanceof Long) {
} else if (value instanceof List){ bson_array_add_int64(bsonRef, (Long) e);
long arrayRef = buildBsonArray((List<Object>) value); } else if (e instanceof String) {
bson_array_add_array(bsonRef, arrayRef); bson_array_add_string(bsonRef, (String) e);
} else if (value instanceof Integer) { } else if (e instanceof Boolean) {
bson_array_add_int32(bsonRef, (Integer) value); bson_array_add_bool(bsonRef, (Boolean) e);
} else if (value instanceof Long) { } else if (e instanceof Double) {
bson_array_add_int64(bsonRef, (Long) value); bson_array_add_double(bsonRef, (Double) e);
} else if (value instanceof String) { }
bson_array_add_string(bsonRef, (String) value); }
} else if (value instanceof Boolean) {
bson_array_add_bool(bsonRef, (Boolean) value);
} else if (value instanceof Double) {
bson_array_add_double(bsonRef, (Double) value);
}
}
return bsonRef; return bsonRef;
} }
// BSON Object Methods // BSON Object Methods
private static native long initializeBsonObject(); private static native long initializeBsonObject();
private static native void deinitializeBsonObject(long bsonRef); private static native void deinitializeBsonObject(long bsonRef);
private static native boolean bson_object_put_object(long bsonRef, String key, long value); private static native boolean bson_object_put_array(long bsonRef, String key, long arrayRef);
private static native boolean bson_object_put_array(long bsonRef, String key, long value); private static native boolean bson_object_put_int32(long bsonRef, String key, int value);
private static native boolean bson_object_put_int32(long bsonRef, String key, int value); private static native boolean bson_object_put_int64(long bsonRef, String key, long value);
private static native boolean bson_object_put_int64(long bsonRef, String key, long value); private static native boolean bson_object_put_string(long bsonRef, String key, String value);
private static native boolean bson_object_put_string(long bsonRef, String key, String value); private static native boolean bson_object_put_bool(long bsonRef, String key, boolean value);
private static native boolean bson_object_put_bool(long bsonRef, String key, boolean value); private static native boolean bson_object_put_double(long bsonRef, String key, double value);
private static native boolean bson_object_put_double(long bsonRef, String key, double value); private static native byte[] bson_object_to_bytes(long bsonRef);
private static native byte[] bson_object_to_bytes(long bsonRef); private static native long bson_object_from_bytes(byte[] data);
private static native long bson_object_from_bytes(byte[] data); private static native HashMap<String, Object> bson_object_get_hashmap(long bsonRef);
private static native HashMap<String, Object> bson_object_get_hashmap(long bsonRef); // BSON Array methods
//private static native List<String, Object> bson_object_get_list(long bsonRef); private static native long initializeBsonArray();
// BSON Array methods private static native void deinitializeBsonArray(long bsonRef);
private static native long initializeBsonArray(long size); private static native boolean bson_array_add_int32(long bsonRef, int value);
private static native void deinitializeBsonArray(long bsonRef); private static native boolean bson_array_add_int64(long bsonRef, long value);
private static native boolean bson_array_add_object(long bsonRef, long value); private static native boolean bson_array_add_string(long bsonRef, String value);
private static native boolean bson_array_add_array(long bsonRef, long value); private static native boolean bson_array_add_bool(long bsonRef, boolean value);
private static native boolean bson_array_add_int32(long bsonRef, int value); private static native boolean bson_array_add_double(long bsonRef, double value);
private static native boolean bson_array_add_int64(long bsonRef, long value);
private static native boolean bson_array_add_string(long bsonRef, String value);
private static native boolean bson_array_add_bool(long bsonRef, boolean value);
private static native boolean bson_array_add_double(long bsonRef, double value);
} }

View File

@ -2,5 +2,4 @@ LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS) include $(CLEAR_VARS)
LOCAL_MODULE := bson-c-lib LOCAL_MODULE := bson-c-lib
LOCAL_SRC_FILES := bson_jni.c ../../../../../src/bson_object.c ../../../../../src/emhashmap/emhashmap.c ../../../../../src/bson_array.c ../../../../../src/bson_util.c LOCAL_SRC_FILES := bson_jni.c ../../../../../src/bson_object.c ../../../../../src/emhashmap/emhashmap.c ../../../../../src/bson_array.c ../../../../../src/bson_util.c
LOCAL_LDFLAGS += -Wl,--exclude-libs,libunwind.a
include $(BUILD_SHARED_LIBRARY) include $(BUILD_SHARED_LIBRARY)

View File

@ -1,451 +1,377 @@
#include "../../../../../src/bson_object.h"
#include <jni.h> #include <jni.h>
#include <syslog.h> #include "../../../../../src/bson_object.h"
jobject bson_object_to_hashmap(JNIEnv *env, BsonObject *bsonRef); BsonObject bsonObject;
jobject bson_array_to_list(JNIEnv *env, BsonArray *bsonRef); BsonArray bsonArray;
JNIEXPORT jlong JNICALL
Java_com_livio_BSON_BsonEncoder_initializeBsonObject(JNIEnv *env, jclass type) {
BsonObject *bsonObject = malloc(sizeof(BsonObject));
bson_object_initialize_default(bsonObject);
return (long)bsonObject;
}
JNIEXPORT void JNICALL Java_com_livio_BSON_BsonEncoder_deinitializeBsonObject(
JNIEnv *env, jclass type, jlong bsonRef) {
bson_object_deinitialize((BsonObject *)bsonRef);
free((BsonObject *)bsonRef);
}
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1int32( Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1int32(JNIEnv *env, jclass type,
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jint value) { jlong bsonRef,
const char *key = (*env)->GetStringUTFChars(env, key_, 0); jstring key_, jint value) {
const char* key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf = jboolean tf = (jboolean) bson_object_put_int32((BsonObject*) bsonRef, (char *) key, value);
(jboolean)bson_object_put_int32((BsonObject *)bsonRef, key, value);
(*env)->ReleaseStringUTFChars(env, key_, key); (*env)->ReleaseStringUTFChars(env, key_, key);
return tf; return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1int64(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jlong value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf =
(jboolean)bson_object_put_int64((BsonObject *)bsonRef, key, value);
(*env)->ReleaseStringUTFChars(env, key_, key);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1string(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jstring value_) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
const char *value = (*env)->GetStringUTFChars(env, value_, 0);
jboolean tf = (jboolean)bson_object_put_string((BsonObject *)bsonRef, key,
(char *)value);
(*env)->ReleaseStringUTFChars(env, key_, key);
(*env)->ReleaseStringUTFChars(env, value_, value);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1bool(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jboolean value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
bson_boolean bsonBoolean = BOOLEAN_INVALID;
if (value == false) {
bsonBoolean = BOOLEAN_FALSE;
} else if (value == true) {
bsonBoolean = BOOLEAN_TRUE;
}
jboolean ret =
(jboolean)bson_object_put_bool((BsonObject *)bsonRef, key, bsonBoolean);
(*env)->ReleaseStringUTFChars(env, key_, key);
return ret;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1double(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jdouble value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf =
(jboolean)bson_object_put_double((BsonObject *)bsonRef, key, value);
(*env)->ReleaseStringUTFChars(env, key_, key);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1object(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jlong value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf = (jboolean)bson_object_put_object((BsonObject *)bsonRef, key,
(BsonObject *)value);
(*env)->ReleaseStringUTFChars(env, key_, key);
// The BsonObject struct has been copied into the root object, no need to keep
// the original version
free((BsonObject *)value);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1array(
JNIEnv *env, jclass type, jlong bsonRef, jstring key_, jlong value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf = (jboolean)bson_object_put_array((BsonObject *)bsonRef, key,
(BsonArray *)value);
(*env)->ReleaseStringUTFChars(env, key_, key);
// The BsonArray struct has been copied into the object, no need to keep the
// original version
free((BsonArray *)value);
return tf;
} }
JNIEXPORT jbyteArray JNICALL JNIEXPORT jbyteArray JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1to_1bytes(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1object_1to_1bytes(JNIEnv *env,
jclass type, jobject instance,
jlong bsonRef) { jlong bsonRef) {
jbyte *bytes = (jbyte *)bson_object_to_bytes((BsonObject *)bsonRef); jbyte* bytes = (jbyte*) bson_object_to_bytes((BsonObject*) bsonRef);
jsize capacity = (jsize)bson_object_size((BsonObject *)bsonRef); jsize capacity = (jsize) bson_object_size((BsonObject*) bsonRef);
jbyteArray array = (*env)->NewByteArray(env, capacity); jbyteArray array = (*env)->NewByteArray(env, capacity);
(*env)->SetByteArrayRegion(env, array, 0, capacity, (jbyte *)bytes); (*env)->SetByteArrayRegion(env, array, 0, capacity, (jbyte*) bytes);
return array; return array;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1int64(JNIEnv *env,
jobject instance,
jlong bsonRef,
jstring key_,
jlong value) {
const char* key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf = (jboolean) bson_object_put_int64((BsonObject*) bsonRef, (char *) key, value);
(*env)->ReleaseStringUTFChars(env, key_, key);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1string(JNIEnv *env, jclass type,
jlong bsonRef,
jstring key_,
jstring value_) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
const char* value = (*env)->GetStringUTFChars(env, value_, 0);
jboolean tf = (jboolean) bson_object_put_string((BsonObject*) bsonRef, (char *) key, (char*) value);
(*env)->ReleaseStringUTFChars(env, key_, key);
(*env)->ReleaseStringUTFChars(env, value_, value);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1bool(JNIEnv *env, jclass type,
jlong bsonRef, jstring key_,
jboolean value) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
bson_boolean bsonBoolean = BOOLEAN_INVALID;
if(value == false){
bsonBoolean = BOOLEAN_FALSE;
}else if(value == true){
bsonBoolean = BOOLEAN_TRUE;
}
jboolean ret = (jboolean) bson_object_put_bool(&bsonObject, (char *) key, bsonBoolean);
(*env)->ReleaseStringUTFChars(env, key_, key);
return ret;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1double(JNIEnv *env, jclass type,
jlong bsonRef,
jstring key_,
jdouble value) {
const char* key = (*env)->GetStringUTFChars(env, key_, 0);
jboolean tf = (jboolean) bson_object_put_double((BsonObject*) bsonRef, (char *) key, value);
(*env)->ReleaseStringUTFChars(env, key_, key);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1object(JNIEnv *env, jclass type,
jlong bsonRef,
jstring key_,
jbyteArray value_) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jbyte *value = (*env)->GetByteArrayElements(env, value_, NULL);
BsonObject bsonFromBytes = bson_object_from_bytes((uint8_t*) value);
jboolean tf = (jboolean) bson_object_put_object((BsonObject*) bsonRef, key, &bsonFromBytes);
(*env)->ReleaseStringUTFChars(env, key_, key);
(*env)->ReleaseByteArrayElements(env, value_, value, 0);
return tf;
} }
JNIEXPORT jlong JNICALL JNIEXPORT jlong JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1from_1bytes(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1object_1from_1bytes(JNIEnv *env,
jclass type, jobject instance,
jbyteArray data_) { jbyteArray data_) {
BsonObject *bsonObject = malloc(sizeof(BsonObject)); jbyte *data = (*env)->GetByteArrayElements(env, data_, NULL);
jbyte *data = (*env)->GetByteArrayElements(env, data_, NULL);
jsize len = (*env)->GetArrayLength(env, data_);
size_t bytesRead = bsonObject = bson_object_from_bytes((uint8_t *) data);
bson_object_from_bytes_len(bsonObject, (uint8_t *)data, (size_t)len);
(*env)->ReleaseByteArrayElements(env, data_, data, 0); (*env)->ReleaseByteArrayElements(env, data_, data, 0);
if (bytesRead != (size_t)len) {
syslog(LOG_CRIT, "Unexpected length of object, returning -1");
free(bsonObject);
return -1;
}
return (jlong)bsonObject; return (jlong) &bsonObject;
} }
JNIEXPORT jlong JNICALL Java_com_livio_BSON_BsonEncoder_initializeBsonArray( JNIEXPORT jlong JNICALL
JNIEnv *env, jclass type, jlong size) { Java_com_livio_BSON_BsonEncoder_initializeBsonArray(JNIEnv *env, jclass type) {
int default_size = 5;
bson_array_initialize(&bsonArray, (size_t) default_size);
return (jlong) &bsonArray;
BsonArray *bsonArray = malloc(sizeof(BsonArray));
bson_array_initialize(bsonArray, (size_t)size);
return (jlong)bsonArray;
} }
JNIEXPORT void JNICALL Java_com_livio_BSON_BsonEncoder_deinitializeBsonArray( JNIEXPORT void JNICALL
JNIEnv *env, jclass type, jlong bsonRef) { Java_com_livio_BSON_BsonEncoder_deinitializeBsonArray(JNIEnv *env, jclass type,
jlong bsonRef) {
bson_array_deinitialize((BsonArray*) bsonRef);
bson_array_deinitialize((BsonArray *)bsonRef);
free((BsonArray *)bsonRef);
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1int32(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1int32(JNIEnv *env, jclass type,
jclass type, jlong bsonRef, jint value) {
jlong bsonRef,
jint value) {
jboolean tf = (jboolean)bson_array_add_int32((BsonArray *)bsonRef, value); jboolean tf = (jboolean) bson_array_add_int32((BsonArray*) bsonRef, value);
return tf;
return tf;
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1int64(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1int64(JNIEnv *env, jclass type,
jclass type, jlong bsonRef,
jlong bsonRef, jlong value) {
jlong value) {
jboolean tf = (jboolean)bson_array_add_int64((BsonArray *)bsonRef, value); jboolean tf = (jboolean) bson_array_add_int64((BsonArray*) bsonRef, value);
return tf;
return tf;
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1string(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1string(JNIEnv *env, jclass type,
jclass type, jlong bsonRef,
jlong bsonRef, jstring value_) {
jstring value_) { const char *value = (*env)->GetStringUTFChars(env, value_, 0);
const char *value = (*env)->GetStringUTFChars(env, value_, 0);
jboolean tf = jboolean tf = (jboolean) bson_array_add_string((BsonArray*) bsonRef, (char*) value);
(jboolean)bson_array_add_string((BsonArray *)bsonRef, (char *)value);
(*env)->ReleaseStringUTFChars(env, value_, value); (*env)->ReleaseStringUTFChars(env, value_, value);
return tf; return tf;
} }
JNIEXPORT jboolean JNICALL JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1bool(JNIEnv *env, jclass type, Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1bool(JNIEnv *env, jclass type,
jlong bsonRef, jlong bsonRef,
jboolean value) { jboolean value) {
bson_boolean bsonBoolean = BOOLEAN_INVALID; bson_boolean bsonBoolean = BOOLEAN_INVALID;
if (value == false) { if(value == false){
bsonBoolean = BOOLEAN_FALSE; bsonBoolean = BOOLEAN_FALSE;
} else if (value == true) { }else if(value == true){
bsonBoolean = BOOLEAN_TRUE; bsonBoolean = BOOLEAN_TRUE;
}
jboolean ret =
(jboolean)bson_array_add_bool((BsonArray *)bsonRef, bsonBoolean);
return ret;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1double(JNIEnv *env,
jclass type,
jlong bsonRef,
jdouble value) {
jboolean tf = (jboolean)bson_array_add_double((BsonArray *)bsonRef, value);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1object(JNIEnv *env,
jclass type,
jlong bsonRef,
jlong value) {
jboolean tf = (jboolean)bson_array_add_object((BsonArray *)bsonRef,
(BsonObject *)value);
// The BsonObject struct has been copied into the array, no need to keep the
// original version
free((BsonObject *)value);
return tf;
}
JNIEXPORT jboolean JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1array(JNIEnv *env,
jclass type,
jlong bsonRef,
jlong value) {
jboolean tf =
(jboolean)bson_array_add_array((BsonArray *)bsonRef, (BsonArray *)value);
// The BsonArray struct has been copied into the root array, no need to keep
// the original version
free((BsonArray *)value);
return tf;
}
jobject bson_object_to_hashmap(JNIEnv *env, BsonObject *bsonRef) {
// initialize the HashMap class
jclass mapClass = (*env)->FindClass(env, "java/util/HashMap");
jsize map_len = (jsize)bson_object_size((BsonObject *)bsonRef);
jmethodID init = (*env)->GetMethodID(env, mapClass, "<init>", "(I)V");
jobject hashMap = (*env)->NewObject(env, mapClass, init, map_len);
// initialize the put method of the HashMap class
jmethodID put = (*env)->GetMethodID(
env, mapClass, "put",
"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
MapIterator it = bson_object_iterator(bsonRef);
MapEntry *entry;
while ((entry = emhashmap_iterator_next(&it)) != NULL) {
jstring key = (*env)->NewStringUTF(env, entry->key);
BsonElement *element = entry->value;
if (element->type == TYPE_DOCUMENT) {
BsonObject *ref = (BsonObject *)element->value;
jobject obj = bson_object_to_hashmap(env, ref);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_ARRAY) {
BsonArray *array = (BsonArray *)element->value;
jobject obj = bson_array_to_list(env, array);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_INT32) {
jint result = *(int32_t *)element->value;
jclass intClass = (*env)->FindClass(env, "java/lang/Integer");
jmethodID intInit = (*env)->GetMethodID(env, intClass, "<init>", "(I)V");
jobject obj = (*env)->NewObject(env, intClass, intInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_INT64) {
jlong result = *(int64_t *)element->value;
jclass longClass = (*env)->FindClass(env, "java/lang/Long");
jmethodID longInit =
(*env)->GetMethodID(env, longClass, "<init>", "(J)V");
jobject obj = (*env)->NewObject(env, longClass, longInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_STRING) {
jstring obj = (*env)->NewStringUTF(env, (char *)element->value);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_BOOLEAN) {
bson_boolean bb = *(bson_boolean *)element->value;
jboolean result = false;
if (bb == BOOLEAN_FALSE || bb == BOOLEAN_INVALID) {
result = false;
} else if (bb == BOOLEAN_TRUE) {
result = true;
}
jclass boolClass = (*env)->FindClass(env, "java/lang/Boolean");
jmethodID boolInit =
(*env)->GetMethodID(env, boolClass, "<init>", "(Z)V");
jobject obj = (*env)->NewObject(env, boolClass, boolInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} else if (element->type == TYPE_DOUBLE) {
jdouble result = *(double *)element->value;
jclass doubleClass = (*env)->FindClass(env, "java/lang/Double");
jmethodID doubleInit =
(*env)->GetMethodID(env, doubleClass, "<init>", "(D)V");
jobject obj = (*env)->NewObject(env, doubleClass, doubleInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
} }
}
return hashMap; jboolean ret = (jboolean) bson_array_add_bool((BsonArray*) bsonRef, bsonBoolean);
return ret;
} }
jobject bson_array_to_list(JNIEnv *env, BsonArray *bsonRef) { JNIEXPORT jboolean JNICALL
// initialize the ArrayList class Java_com_livio_BSON_BsonEncoder_bson_1array_1add_1double(JNIEnv *env, jclass type,
jclass listClass = (*env)->FindClass(env, "java/util/ArrayList"); jlong bsonRef,
jdouble value) {
jsize list_len = (jsize)bsonRef->count; jboolean tf = (jboolean) bson_array_add_double((BsonArray*) bsonRef, value);
jmethodID initList = (*env)->GetMethodID(env, listClass, "<init>", "(I)V"); return tf;
jobject list = (*env)->NewObject(env, listClass, initList, list_len);
// initialize the Add method of the class }
jmethodID add =
(*env)->GetMethodID(env, listClass, "add", "(Ljava/lang/Object;)Z");
size_t i; JNIEXPORT jboolean JNICALL
for (i = 0; i < bsonRef->count; i++) { Java_com_livio_BSON_BsonEncoder_bson_1object_1put_1array(JNIEnv *env,
BsonElement *element = bson_array_get(bsonRef, (size_t)i); jobject instance,
if (element->type == TYPE_DOCUMENT) { jlong bsonRef,
BsonObject *ref = (BsonObject *)element->value; jstring key_,
jlong arrayRef) {
const char *key = (*env)->GetStringUTFChars(env, key_, 0);
jobject obj = bson_object_to_hashmap(env, ref); jboolean tf = (jboolean) bson_object_put_array((BsonObject*) bsonRef, (char*) key, (BsonArray*) arrayRef);
(*env)->CallBooleanMethod(env, list, add, obj); (*env)->ReleaseStringUTFChars(env, key_, key);
} else if (element->type == TYPE_ARRAY) {
BsonArray *array = (BsonArray *)element->value;
jobject obj = bson_array_to_list(env, array); return tf;
}
(*env)->CallBooleanMethod(env, list, add, obj); JNIEXPORT jlong JNICALL
} else if (element->type == TYPE_INT32) { Java_com_livio_BSON_BsonEncoder_initializeBsonObject(JNIEnv *env, jclass type) {
jint result = *(int32_t *)element->value;
jclass intClass = (*env)->FindClass(env, "java/lang/Integer"); bson_object_initialize_default(&bsonObject);
jmethodID intInit = (*env)->GetMethodID(env, intClass, "<init>", "(I)V"); return (long) &bsonObject;
jobject obj = (*env)->NewObject(env, intClass, intInit, result);
(*env)->CallBooleanMethod(env, list, add, obj); }
} else if (element->type == TYPE_INT64) {
jlong result = *(int64_t *)element->value;
jclass longClass = (*env)->FindClass(env, "java/lang/Long"); JNIEXPORT void JNICALL
jmethodID longInit = Java_com_livio_BSON_BsonEncoder_deinitializeBsonObject(JNIEnv *env, jclass type,
(*env)->GetMethodID(env, longClass, "<init>", "(J)V"); jlong bsonRef) {
jobject obj = (*env)->NewObject(env, longClass, longInit, result);
(*env)->CallBooleanMethod(env, list, add, obj); bson_object_deinitialize((BsonObject*) bsonRef);
} else if (element->type == TYPE_STRING) {
jstring obj = (*env)->NewStringUTF(env, (char *)element->value);
(*env)->CallBooleanMethod(env, list, add, obj);
} else if (element->type == TYPE_BOOLEAN) {
bson_boolean bb = *(bson_boolean *)element->value;
jboolean result = false;
if (bb == BOOLEAN_FALSE || bb == BOOLEAN_INVALID) {
result = false;
} else if (bb == BOOLEAN_TRUE) {
result = true;
}
jclass boolClass = (*env)->FindClass(env, "java/lang/Boolean");
jmethodID boolInit =
(*env)->GetMethodID(env, boolClass, "<init>", "(Z)V");
jobject obj = (*env)->NewObject(env, boolClass, boolInit, result);
(*env)->CallBooleanMethod(env, list, add, obj);
} else if (element->type == TYPE_DOUBLE) {
jdouble result = *(double *)element->value;
jclass doubleClass = (*env)->FindClass(env, "java/lang/Double");
jmethodID doubleInit =
(*env)->GetMethodID(env, doubleClass, "<init>", "(D)V");
jobject obj = (*env)->NewObject(env, doubleClass, doubleInit, result);
(*env)->CallBooleanMethod(env, list, add, obj);
}
}
return list;
} }
JNIEXPORT jobject JNICALL JNIEXPORT jobject JNICALL
Java_com_livio_BSON_BsonEncoder_bson_1object_1get_1hashmap(JNIEnv *env, Java_com_livio_BSON_BsonEncoder_bson_1object_1get_1hashmap(JNIEnv *env, jclass type,
jclass type, jlong bsonRef) {
jlong bsonRef) {
if (bsonRef == -1) {
syslog(LOG_CRIT, "Invalid BSON Object");
return (*env)->NewGlobalRef(env, NULL);
}
return bson_object_to_hashmap(env, (BsonObject *)bsonRef); // initialize the HashMap class
jclass mapClass = (*env)->FindClass(env, "java/util/HashMap");
jsize map_len = (jsize) bson_object_size((BsonObject*) bsonRef);
jmethodID init = (*env)->GetMethodID(env, mapClass, "<init>", "(I)V");
jobject hashMap = (*env)->NewObject(env, mapClass, init, map_len);
// initialize the put method of the HashMap class
jmethodID put = (*env)->GetMethodID(env, mapClass, "put",
"(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;");
MapIterator it = bson_object_iterator((BsonObject*) bsonRef);
MapEntry* entry;
while((entry = emhashmap_iterator_next(&it)) != NULL){
jstring key = (*env)->NewStringUTF(env, entry->key);
BsonElement* element = entry->value;
if(element->type == TYPE_ARRAY){
BsonArray* array = (BsonArray *)element->value;
// initialize the ArrayList class
jclass listClass = (*env)->FindClass(env, "java/util/ArrayList");
jsize list_len = (jsize) array->count;
jmethodID initList = (*env)->GetMethodID(env, listClass, "<init>", "(I)V");
jobject objList = (*env)->NewObject(env, listClass, initList, list_len);
// initialize the Add method of the class
jmethodID add = (*env)->GetMethodID(env, listClass, "add", "(Ljava/lang/Object;)Z");
int i;
for(i = 0; i < array->count; i++){
BsonElement* a_elmnt = bson_array_get(array, (size_t) i);
if(a_elmnt->type == TYPE_INT32){
jint result = *(int32_t *) a_elmnt->value;
jclass intClass = (*env)->FindClass(env, "java/lang/Integer");
jmethodID intInit = (*env)->GetMethodID(env, intClass, "<init>", "(I)V");
jobject obj = (*env)->NewObject(env, intClass, intInit, result);
(*env)->CallBooleanMethod(env, objList, add, obj);
}else if(a_elmnt->type == TYPE_INT64){
jlong result = *(int64_t *) a_elmnt->value;
jclass longClass = (*env)->FindClass(env, "java/lang/Long");
jmethodID longInit = (*env)->GetMethodID(env, longClass, "<init>", "(J)V");
jobject obj = (*env)->NewObject(env, longClass, longInit, result);
(*env)->CallBooleanMethod(env, objList, add, obj);
}else if(a_elmnt->type == TYPE_STRING){
jstring obj = (*env)->NewStringUTF(env, (char *) a_elmnt->value);
(*env)->CallBooleanMethod(env, objList, add, obj);
}else if(a_elmnt->type == TYPE_BOOLEAN){
bson_boolean bb = *(bson_boolean *) a_elmnt->value;
jboolean result = false;
if(bb == BOOLEAN_FALSE || bb == BOOLEAN_INVALID){
result = false;
}else if(bb == BOOLEAN_TRUE){
result = true;
}
jclass boolClass = (*env)->FindClass(env, "java/lang/Boolean");
jmethodID boolInit = (*env)->GetMethodID(env, boolClass, "<init>", "(Z)V");
jobject obj = (*env)->NewObject(env, boolClass, boolInit, result);
(*env)->CallBooleanMethod(env, objList, add, obj);
}else if(a_elmnt->type == TYPE_DOUBLE){
jdouble result = *(double *) a_elmnt->value;
jclass doubleClass = (*env)->FindClass(env, "java/lang/Double");
jmethodID doubleInit = (*env)->GetMethodID(env, doubleClass, "<init>", "(D)V");
jobject obj = (*env)->NewObject(env, doubleClass, doubleInit, result);
(*env)->CallBooleanMethod(env, objList, add, obj);
}
}
(*env)->CallObjectMethod(env, hashMap, put, key, objList);
}else if(element->type == TYPE_INT32){
jint result = *(int32_t *) element->value;
jclass intClass = (*env)->FindClass(env, "java/lang/Integer");
jmethodID intInit = (*env)->GetMethodID(env, intClass, "<init>", "(I)V");
jobject obj = (*env)->NewObject(env, intClass, intInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
}else if(element->type == TYPE_INT64){
jlong result = *(int64_t *) element->value;
jclass longClass = (*env)->FindClass(env, "java/lang/Long");
jmethodID longInit = (*env)->GetMethodID(env, longClass, "<init>", "(J)V");
jobject obj = (*env)->NewObject(env, longClass, longInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
}else if(element->type == TYPE_STRING){
jstring obj = (*env)->NewStringUTF(env, (char *) element->value);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
}else if(element->type == TYPE_BOOLEAN){
bson_boolean bb = *(bson_boolean *) element->value;
jboolean result = false;
if(bb == BOOLEAN_FALSE || bb == BOOLEAN_INVALID){
result = false;
}else if(bb == BOOLEAN_TRUE){
result = true;
}
jclass boolClass = (*env)->FindClass(env, "java/lang/Boolean");
jmethodID boolInit = (*env)->GetMethodID(env, boolClass, "<init>", "(Z)V");
jobject obj = (*env)->NewObject(env, boolClass, boolInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
}else if(element->type == TYPE_DOUBLE){
jdouble result = *(double *) element->value;
jclass doubleClass = (*env)->FindClass(env, "java/lang/Double");
jmethodID doubleInit = (*env)->GetMethodID(env, doubleClass, "<init>", "(D)V");
jobject obj = (*env)->NewObject(env, doubleClass, doubleInit, result);
(*env)->CallObjectMethod(env, hashMap, put, key, obj);
}
}
return hashMap;
} }

View File

@ -9,7 +9,7 @@ buildscript {
} }
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.1.0' classpath 'com.android.tools.build:gradle:3.1.0'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
} }

View File

@ -1,6 +1,6 @@
#Wed May 01 11:39:48 EDT 2019 #Tue May 22 14:21:10 EDT 2018
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip

View File

@ -1,4 +1,4 @@
Copyright (c) 2017 - 2020 SmartDeviceLink Consortium, Inc. Copyright (c) 2017 SmartDeviceLink Consortium, Inc.
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -1,7 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
confdir = $(sysconfdir)
conf_DATA = libbson.pc
SUBDIRS = src SUBDIRS = src
if BUILD_LUA if BUILD_LUA
SUBDIRS += lua SUBDIRS += lua

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -13,7 +13,6 @@
# PARTICULAR PURPOSE. # PARTICULAR PURPOSE.
@SET_MAKE@ @SET_MAKE@
VPATH = @srcdir@ VPATH = @srcdir@
am__is_gnu_make = { \ am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \ if test -z '$(MAKELEVEL)'; then \
@ -104,7 +103,7 @@ am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = config.h CONFIG_HEADER = config.h
CONFIG_CLEAN_FILES = libbson.pc CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES = CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@) AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@ -133,35 +132,6 @@ am__can_run_installinfo = \
n|no|NO) false;; \ n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \ *) (install-info --version) >/dev/null 2>&1;; \
esac esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
*) f=$$p;; \
esac;
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(confdir)"
DATA = $(conf_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive distclean-recursive maintainer-clean-recursive
am__recursive_targets = \ am__recursive_targets = \
@ -192,9 +162,8 @@ ETAGS = etags
CTAGS = ctags CTAGS = ctags
CSCOPE = cscope CSCOPE = cscope
DIST_SUBDIRS = src lua test DIST_SUBDIRS = src lua test
am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in compile \
$(srcdir)/libbson.pc.in compile config.guess config.sub \ config.guess config.sub install-sh ltmain.sh missing
depcomp install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION) distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir) top_distdir = $(distdir)
@ -279,14 +248,6 @@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LUA = @LUA@
LUA_EXEC_PREFIX = @LUA_EXEC_PREFIX@
LUA_INCLUDE = @LUA_INCLUDE@
LUA_PLATFORM = @LUA_PLATFORM@
LUA_PREFIX = @LUA_PREFIX@
LUA_SHORT_VERSION = @LUA_SHORT_VERSION@
LUA_VERSION = @LUA_VERSION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -350,14 +311,10 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
luadir = @luadir@
luaexecdir = @luaexecdir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@ pdfdir = @pdfdir@
pkgluadir = @pkgluadir@
pkgluaexecdir = @pkgluaexecdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
@ -372,8 +329,6 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign AUTOMAKE_OPTIONS = foreign
confdir = $(sysconfdir)
conf_DATA = libbson.pc
SUBDIRS = src $(am__append_1) $(am__append_2) SUBDIRS = src $(am__append_1) $(am__append_2)
all: config.h all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive $(MAKE) $(AM_MAKEFLAGS) all-recursive
@ -381,7 +336,7 @@ all: config.h
.SUFFIXES: .SUFFIXES:
am--refresh: Makefile am--refresh: Makefile
@: @:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -407,9 +362,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF) $(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -420,15 +375,13 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h cd $(top_builddir) && $(SHELL) ./config.status config.h
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(srcdir)/config.h.in: $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER)) ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@
distclean-hdr: distclean-hdr:
-rm -f config.h stamp-h1 -rm -f config.h stamp-h1
libbson.pc: $(top_builddir)/config.status $(srcdir)/libbson.pc.in
cd $(top_builddir) && $(SHELL) ./config.status $@
mostlyclean-libtool: mostlyclean-libtool:
-rm -f *.lo -rm -f *.lo
@ -438,27 +391,6 @@ clean-libtool:
distclean-libtool: distclean-libtool:
-rm -f libtool config.lt -rm -f libtool config.lt
install-confDATA: $(conf_DATA)
@$(NORMAL_INSTALL)
@list='$(conf_DATA)'; test -n "$(confdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(confdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(confdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(confdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(confdir)" || exit $$?; \
done
uninstall-confDATA:
@$(NORMAL_UNINSTALL)
@list='$(conf_DATA)'; test -n "$(confdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(confdir)'; $(am__uninstall_files_from_dir)
# This directory's subdirectories are mostly independent; you can cd # This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile. # into them and run 'make' without going through this Makefile.
@ -631,7 +563,7 @@ distdir: $(DISTFILES)
! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r "$(distdir)" || chmod -R a+r "$(distdir)"
dist-gzip: distdir dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-bzip2: distdir dist-bzip2: distdir
@ -657,7 +589,7 @@ dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \ @echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2 "deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
$(am__post_remove_distdir) $(am__post_remove_distdir)
dist-zip: distdir dist-zip: distdir
@ -675,7 +607,7 @@ dist dist-all:
distcheck: dist distcheck: dist
case '$(DIST_ARCHIVES)' in \ case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \ *.tar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \ *.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \ *.tar.lz*) \
@ -685,7 +617,7 @@ distcheck: dist
*.tar.Z*) \ *.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \ *.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \ *.zip*) \
unzip $(distdir).zip ;;\ unzip $(distdir).zip ;;\
esac esac
@ -756,12 +688,9 @@ distcleancheck: distclean
exit 1; } >&2 exit 1; } >&2
check-am: all-am check-am: all-am
check: check-recursive check: check-recursive
all-am: Makefile $(DATA) config.h all-am: Makefile config.h
installdirs: installdirs-recursive installdirs: installdirs-recursive
installdirs-am: installdirs-am:
for dir in "$(DESTDIR)$(confdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-recursive install: install-recursive
install-exec: install-exec-recursive install-exec: install-exec-recursive
install-data: install-data-recursive install-data: install-data-recursive
@ -814,7 +743,7 @@ info: info-recursive
info-am: info-am:
install-data-am: install-confDATA install-data-am:
install-dvi: install-dvi-recursive install-dvi: install-dvi-recursive
@ -860,7 +789,7 @@ ps: ps-recursive
ps-am: ps-am:
uninstall-am: uninstall-confDATA uninstall-am:
.MAKE: $(am__recursive_targets) all install-am install-strip .MAKE: $(am__recursive_targets) all install-am install-strip
@ -871,15 +800,15 @@ uninstall-am: uninstall-confDATA
dist-xz dist-zip distcheck distclean distclean-generic \ dist-xz dist-zip distcheck distclean distclean-generic \
distclean-hdr distclean-libtool distclean-tags distcleancheck \ distclean-hdr distclean-libtool distclean-tags distcleancheck \
distdir distuninstallcheck dvi dvi-am html html-am info \ distdir distuninstallcheck dvi dvi-am html html-am info \
info-am install install-am install-confDATA install-data \ info-am install install-am install-data install-data-am \
install-data-am install-dvi install-dvi-am install-exec \ install-dvi install-dvi-am install-exec install-exec-am \
install-exec-am install-html install-html-am install-info \ install-html install-html-am install-info install-info-am \
install-info-am install-man install-pdf install-pdf-am \ install-man install-pdf install-pdf-am install-ps \
install-ps install-ps-am install-strip installcheck \ install-ps-am install-strip installcheck installcheck-am \
installcheck-am installdirs installdirs-am maintainer-clean \ installdirs installdirs-am maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \ maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-confDATA uninstall-am
.PRECIOUS: Makefile .PRECIOUS: Makefile

View File

@ -1,30 +0,0 @@
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "BiSON",
defaultLocalization: "en",
platforms: [
.iOS(.v9)
],
products: [
.library(name: "BiSON", targets: ["BiSON"])
],
targets: [
.target(
name: "BiSON",
path: "src",
exclude: [
"Makefile.am",
"Makefile.in",
"emhashmap/LICENSE",
"emhashmap/README.mkd",
"emhashmap/Makefile.in",
"emhashmap/Makefile.am",
"emhashmap/runtests.sh",
"emhashmap/tests/tests.c"
],
publicHeadersPath: "./"
)
]
)

View File

@ -16,7 +16,7 @@ sudo make install
### Install Dependencies ### ### Install Dependencies ###
```bash ```bash
sudo apt-get install lua5.2 liblua5.2 liblua5.2-dev sudo apt-get install liblua5.2-dev
``` ```
### Build Library ### ### Build Library ###
@ -66,7 +66,7 @@ There is a jCenter artifact for Android. Add the following to your `build.gradle
``` ```
dependencies { dependencies {
api 'com.smartdevicelink:bson_java_port:1.2.5' compile ('com.smartdevicelink:bson_java_port:1.1.1')
} }
``` ```

82
aclocal.m4 vendored
View File

@ -1,6 +1,6 @@
# generated automatically by aclocal 1.15.1 -*- Autoconf -*- # generated automatically by aclocal 1.15 -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Copyright (C) 1996-2014 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -296,7 +296,7 @@ AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl AS_VAR_IF([$1], [""], [$5], [$4])dnl
])dnl PKG_CHECK_VAR ])dnl PKG_CHECK_VAR
# Copyright (C) 2002-2017 Free Software Foundation, Inc. # Copyright (C) 2002-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -311,7 +311,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15' [am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro. dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.15.1], [], m4_if([$1], [1.15], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
]) ])
@ -327,14 +327,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.15.1])dnl [AM_AUTOMAKE_VERSION([1.15])dnl
m4_ifndef([AC_AUTOCONF_VERSION], m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*- # AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -386,7 +386,7 @@ am_aux_dir=`cd "$ac_aux_dir" && pwd`
# AM_COND_IF -*- Autoconf -*- # AM_COND_IF -*- Autoconf -*-
# Copyright (C) 2008-2017 Free Software Foundation, Inc. # Copyright (C) 2008-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -423,7 +423,7 @@ fi[]dnl
# AM_CONDITIONAL -*- Autoconf -*- # AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997-2017 Free Software Foundation, Inc. # Copyright (C) 1997-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -454,7 +454,7 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]]) Usually this means the macro was only invoked conditionally.]])
fi])]) fi])])
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -645,7 +645,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
# Generate code to set up dependency tracking. -*- Autoconf -*- # Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -721,7 +721,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*- # Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Copyright (C) 1996-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -918,7 +918,7 @@ for _am_header in $config_headers :; do
done done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -939,7 +939,7 @@ if test x"${install_sh+set}" != xset; then
fi fi
AC_SUBST([install_sh])]) AC_SUBST([install_sh])])
# Copyright (C) 2003-2017 Free Software Foundation, Inc. # Copyright (C) 2003-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -958,45 +958,9 @@ fi
rmdir .tst 2>/dev/null rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])]) AC_SUBST([am__leading_dot])])
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
# From Jim Meyering
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_MAINTAINER_MODE([DEFAULT-MODE])
# ----------------------------------
# Control maintainer-specific portions of Makefiles.
# Default is to disable them, unless 'enable' is passed literally.
# For symmetry, 'disable' may be passed as well. Anyway, the user
# can override the default with the --enable/--disable switch.
AC_DEFUN([AM_MAINTAINER_MODE],
[m4_case(m4_default([$1], [disable]),
[enable], [m4_define([am_maintainer_other], [disable])],
[disable], [m4_define([am_maintainer_other], [enable])],
[m4_define([am_maintainer_other], [enable])
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
AC_ARG_ENABLE([maintainer-mode],
[AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
am_maintainer_other[ make rules and dependencies not useful
(and sometimes confusing) to the casual installer])],
[USE_MAINTAINER_MODE=$enableval],
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST([MAINT])dnl
]
)
# Check to see how 'make' treats includes. -*- Autoconf -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1046,7 +1010,7 @@ rm -f confinc confmf
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997-2017 Free Software Foundation, Inc. # Copyright (C) 1997-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1085,7 +1049,7 @@ fi
# Helper functions for option handling. -*- Autoconf -*- # Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1114,7 +1078,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION], AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1161,7 +1125,7 @@ AC_LANG_POP([C])])
# For backward compatibility. # For backward compatibility.
AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1180,7 +1144,7 @@ AC_DEFUN([AM_RUN_LOG],
# Check to make sure that the build environment is sane. -*- Autoconf -*- # Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996-2017 Free Software Foundation, Inc. # Copyright (C) 1996-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1261,7 +1225,7 @@ AC_CONFIG_COMMANDS_PRE(
rm -f conftest.file rm -f conftest.file
]) ])
# Copyright (C) 2009-2017 Free Software Foundation, Inc. # Copyright (C) 2009-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1321,7 +1285,7 @@ AC_SUBST([AM_BACKSLASH])dnl
_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
]) ])
# Copyright (C) 2001-2017 Free Software Foundation, Inc. # Copyright (C) 2001-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1349,7 +1313,7 @@ fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])]) AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006-2017 Free Software Foundation, Inc. # Copyright (C) 2006-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -1368,7 +1332,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*- # Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004-2017 Free Software Foundation, Inc. # Copyright (C) 2004-2014 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,

679
config.guess vendored

File diff suppressed because it is too large Load Diff

View File

@ -7,18 +7,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1 #define HAVE_INTTYPES_H 1
/* Define to 1 if you have the <lauxlib.h> header file. */
/* #undef HAVE_LAUXLIB_H */
/* Define to 1 if you have the <luaconf.h> header file. */
/* #undef HAVE_LUACONF_H */
/* Define to 1 if you have the <lualib.h> header file. */
/* #undef HAVE_LUALIB_H */
/* Define to 1 if you have the <lua.h> header file. */
/* #undef HAVE_LUA_H */
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */ to 0 otherwise. */
#define HAVE_MALLOC 1 #define HAVE_MALLOC 1
@ -69,7 +57,7 @@
#define PACKAGE_NAME "bson_c_lib" #define PACKAGE_NAME "bson_c_lib"
/* Define to the full name and version of this package. */ /* Define to the full name and version of this package. */
#define PACKAGE_STRING "bson_c_lib 1.2.4" #define PACKAGE_STRING "bson_c_lib 1.1.0"
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "bson_c_lib" #define PACKAGE_TARNAME "bson_c_lib"
@ -78,13 +66,13 @@
#define PACKAGE_URL "" #define PACKAGE_URL ""
/* Define to the version of this package. */ /* Define to the version of this package. */
#define PACKAGE_VERSION "1.2.4" #define PACKAGE_VERSION "1.1.0"
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1 #define STDC_HEADERS 1
/* Version number of package */ /* Version number of package */
#define VERSION "1.2.4" #define VERSION "1.1.0"
/* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>, /* Define for Solaris 2.5.1 so the uint64_t typedef from <sys/synch.h>,
<pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the <pthread.h>, or <semaphore.h> is not used. If the typedef were allowed, the

View File

@ -6,18 +6,6 @@
/* Define to 1 if you have the <inttypes.h> header file. */ /* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H #undef HAVE_INTTYPES_H
/* Define to 1 if you have the <lauxlib.h> header file. */
#undef HAVE_LAUXLIB_H
/* Define to 1 if you have the <luaconf.h> header file. */
#undef HAVE_LUACONF_H
/* Define to 1 if you have the <lualib.h> header file. */
#undef HAVE_LUALIB_H
/* Define to 1 if you have the <lua.h> header file. */
#undef HAVE_LUA_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */ to 0 otherwise. */
#undef HAVE_MALLOC #undef HAVE_MALLOC

284
config.sub vendored
View File

@ -1,8 +1,8 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script. # Configuration validation subroutine script.
# Copyright 1992-2018 Free Software Foundation, Inc. # Copyright 1992-2015 Free Software Foundation, Inc.
timestamp='2018-02-22' timestamp='2015-08-20'
# This file is free software; you can redistribute it and/or modify it # This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by # under the terms of the GNU General Public License as published by
@ -15,7 +15,7 @@ timestamp='2018-02-22'
# General Public License for more details. # General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, see <https://www.gnu.org/licenses/>. # along with this program; if not, see <http://www.gnu.org/licenses/>.
# #
# As a special exception to the GNU General Public License, if you # As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a # distribute this file as part of a program that contains a
@ -33,7 +33,7 @@ timestamp='2018-02-22'
# Otherwise, we print the canonical config type on stdout and succeed. # Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from: # You can get the latest version of this script from:
# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# This file is supposed to be the same for all GNU packages # This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases # and recognize all the CPU types, system types and aliases
@ -53,11 +53,12 @@ timestamp='2018-02-22'
me=`echo "$0" | sed -e 's,.*/,,'` me=`echo "$0" | sed -e 's,.*/,,'`
usage="\ usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Canonicalize a configuration name. Canonicalize a configuration name.
Options: Operation modes:
-h, --help print this help, then exit -h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit -t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit -v, --version print version number, then exit
@ -67,7 +68,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\ version="\
GNU config.sub ($timestamp) GNU config.sub ($timestamp)
Copyright 1992-2018 Free Software Foundation, Inc. Copyright 1992-2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -94,7 +95,7 @@ while test $# -gt 0 ; do
*local*) *local*)
# First pass through any local machine types. # First pass through any local machine types.
echo "$1" echo $1
exit ;; exit ;;
* ) * )
@ -112,24 +113,24 @@ esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \ kopensolaris*-gnu* | \
storm-chaos* | os2-emx* | rtmk-nova*) storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
android-linux) android-linux)
os=-linux-android os=-linux-android
basic_machine=`echo "$1" | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;; ;;
*) *)
basic_machine=`echo "$1" | sed 's/-[^-]*$//'` basic_machine=`echo $1 | sed 's/-[^-]*$//'`
if [ "$basic_machine" != "$1" ] if [ $basic_machine != $1 ]
then os=`echo "$1" | sed 's/.*-/-/'` then os=`echo $1 | sed 's/.*-/-/'`
else os=; fi else os=; fi
;; ;;
esac esac
@ -178,44 +179,44 @@ case $os in
;; ;;
-sco6) -sco6)
os=-sco5v6 os=-sco5v6
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco5) -sco5)
os=-sco3.2v5 os=-sco3.2v5
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco4) -sco4)
os=-sco3.2v4 os=-sco3.2v4
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco3.2.[4-9]*) -sco3.2.[4-9]*)
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco3.2v[4-9]*) -sco3.2v[4-9]*)
# Don't forget version if it is 3.2v4 or newer. # Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco5v6*) -sco5v6*)
# Don't forget version if it is 3.2v4 or newer. # Don't forget version if it is 3.2v4 or newer.
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-sco*) -sco*)
os=-sco3.2v2 os=-sco3.2v2
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-udk*) -udk*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-isc) -isc)
os=-isc2.2 os=-isc2.2
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-clix*) -clix*)
basic_machine=clipper-intergraph basic_machine=clipper-intergraph
;; ;;
-isc*) -isc*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
;; ;;
-lynx*178) -lynx*178)
os=-lynxos178 os=-lynxos178
@ -227,7 +228,10 @@ case $os in
os=-lynxos os=-lynxos
;; ;;
-ptx*) -ptx*)
basic_machine=`echo "$1" | sed -e 's/86-.*/86-sequent/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
;;
-windowsnt*)
os=`echo $os | sed -e 's/windowsnt/winnt/'`
;; ;;
-psos*) -psos*)
os=-psos os=-psos
@ -260,7 +264,7 @@ case $basic_machine in
| fido | fr30 | frv | ft32 \ | fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \ | hexagon \
| i370 | i860 | i960 | ia16 | ia64 \ | i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \ | ip2k | iq2000 \
| k1om \ | k1om \
| le32 | le64 \ | le32 | le64 \
@ -296,9 +300,8 @@ case $basic_machine in
| nios | nios2 | nios2eb | nios2el \ | nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \ | ns16k | ns32k \
| open8 | or1k | or1knd | or32 \ | open8 | or1k | or1knd | or32 \
| pdp10 | pj | pjl \ | pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \ | powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \ | pyramid \
| riscv32 | riscv64 \ | riscv32 | riscv64 \
| rl78 | rx \ | rl78 | rx \
@ -312,7 +315,7 @@ case $basic_machine in
| ubicom32 \ | ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \ | visium \
| wasm32 \ | we32k \
| x86 | xc16x | xstormy16 | xtensa \ | x86 | xc16x | xstormy16 | xtensa \
| z8k | z80) | z8k | z80)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
@ -333,7 +336,7 @@ case $basic_machine in
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
os=-none os=-none
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65) m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;; ;;
ms1) ms1)
basic_machine=mt-unknown basic_machine=mt-unknown
@ -362,7 +365,7 @@ case $basic_machine in
;; ;;
# Object if more than one company name word. # Object if more than one company name word.
*-*-*) *-*-*)
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1 exit 1
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
@ -385,7 +388,7 @@ case $basic_machine in
| h8300-* | h8500-* \ | h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \ | hexagon-* \
| i*86-* | i860-* | i960-* | ia16-* | ia64-* \ | i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \ | ip2k-* | iq2000-* \
| k1om-* \ | k1om-* \
| le32-* | le64-* \ | le32-* | le64-* \
@ -426,7 +429,6 @@ case $basic_machine in
| orion-* \ | orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \ | pyramid-* \
| riscv32-* | riscv64-* \ | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \ | rl78-* | romp-* | rs6000-* | rx-* \
@ -443,7 +445,6 @@ case $basic_machine in
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \ | vax-* \
| visium-* \ | visium-* \
| wasm32-* \
| we32k-* \ | we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \ | xstormy16-* | xtensa*-* \
@ -457,7 +458,7 @@ case $basic_machine in
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
386bsd) 386bsd)
basic_machine=i386-pc basic_machine=i386-unknown
os=-bsd os=-bsd
;; ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
@ -491,7 +492,7 @@ case $basic_machine in
basic_machine=x86_64-pc basic_machine=x86_64-pc
;; ;;
amd64-*) amd64-*)
basic_machine=x86_64-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
amdahl) amdahl)
basic_machine=580-amdahl basic_machine=580-amdahl
@ -520,7 +521,7 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
os=-aros os=-aros
;; ;;
asmjs) asmjs)
basic_machine=asmjs-unknown basic_machine=asmjs-unknown
;; ;;
aux) aux)
@ -536,7 +537,7 @@ case $basic_machine in
os=-linux os=-linux
;; ;;
blackfin-*) blackfin-*)
basic_machine=bfin-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
bluegene*) bluegene*)
@ -544,13 +545,13 @@ case $basic_machine in
os=-cnk os=-cnk
;; ;;
c54x-*) c54x-*)
basic_machine=tic54x-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
c55x-*) c55x-*)
basic_machine=tic55x-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
c6x-*) c6x-*)
basic_machine=tic6x-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
c90) c90)
basic_machine=c90-cray basic_machine=c90-cray
@ -639,18 +640,10 @@ case $basic_machine in
basic_machine=rs6000-bull basic_machine=rs6000-bull
os=-bosx os=-bosx
;; ;;
dpx2*) dpx2* | dpx2*-bull)
basic_machine=m68k-bull basic_machine=m68k-bull
os=-sysv3 os=-sysv3
;; ;;
e500v[12])
basic_machine=powerpc-unknown
os=$os"spe"
;;
e500v[12]-*)
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'`
os=$os"spe"
;;
ebmon29k) ebmon29k)
basic_machine=a29k-amd basic_machine=a29k-amd
os=-ebmon os=-ebmon
@ -740,6 +733,9 @@ case $basic_machine in
hp9k8[0-9][0-9] | hp8[0-9][0-9]) hp9k8[0-9][0-9] | hp8[0-9][0-9])
basic_machine=hppa1.0-hp basic_machine=hppa1.0-hp
;; ;;
hppa-next)
os=-nextstep3
;;
hppaosf) hppaosf)
basic_machine=hppa1.1-hp basic_machine=hppa1.1-hp
os=-osf os=-osf
@ -752,26 +748,26 @@ case $basic_machine in
basic_machine=i370-ibm basic_machine=i370-ibm
;; ;;
i*86v32) i*86v32)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv32 os=-sysv32
;; ;;
i*86v4*) i*86v4*)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv4 os=-sysv4
;; ;;
i*86v) i*86v)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-sysv os=-sysv
;; ;;
i*86sol2) i*86sol2)
basic_machine=`echo "$1" | sed -e 's/86.*/86-pc/'` basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
os=-solaris2 os=-solaris2
;; ;;
i386mach) i386mach)
basic_machine=i386-mach basic_machine=i386-mach
os=-mach os=-mach
;; ;;
vsta) i386-vsta | vsta)
basic_machine=i386-unknown basic_machine=i386-unknown
os=-vsta os=-vsta
;; ;;
@ -790,16 +786,19 @@ case $basic_machine in
os=-sysv os=-sysv
;; ;;
leon-*|leon[3-9]-*) leon-*|leon[3-9]-*)
basic_machine=sparc-`echo "$basic_machine" | sed 's/-.*//'` basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
;; ;;
m68knommu) m68knommu)
basic_machine=m68k-unknown basic_machine=m68k-unknown
os=-linux os=-linux
;; ;;
m68knommu-*) m68knommu-*)
basic_machine=m68k-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
m88k-omron*)
basic_machine=m88k-omron
;;
magnum | m3230) magnum | m3230)
basic_machine=mips-mips basic_machine=mips-mips
os=-sysv os=-sysv
@ -831,10 +830,10 @@ case $basic_machine in
os=-mint os=-mint
;; ;;
mips3*-*) mips3*-*)
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'` basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;; ;;
mips3*) mips3*)
basic_machine=`echo "$basic_machine" | sed -e 's/mips3/mips64/'`-unknown basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
;; ;;
monitor) monitor)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
@ -853,7 +852,7 @@ case $basic_machine in
os=-msdos os=-msdos
;; ;;
ms1-*) ms1-*)
basic_machine=`echo "$basic_machine" | sed -e 's/ms1-/mt-/'` basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
;; ;;
msys) msys)
basic_machine=i686-pc basic_machine=i686-pc
@ -895,7 +894,7 @@ case $basic_machine in
basic_machine=v70-nec basic_machine=v70-nec
os=-sysv os=-sysv
;; ;;
next | m*-next) next | m*-next )
basic_machine=m68k-next basic_machine=m68k-next
case $os in case $os in
-nextstep* ) -nextstep* )
@ -940,12 +939,6 @@ case $basic_machine in
nsr-tandem) nsr-tandem)
basic_machine=nsr-tandem basic_machine=nsr-tandem
;; ;;
nsv-tandem)
basic_machine=nsv-tandem
;;
nsx-tandem)
basic_machine=nsx-tandem
;;
op50n-* | op60c-*) op50n-* | op60c-*)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
@ -978,7 +971,7 @@ case $basic_machine in
os=-linux os=-linux
;; ;;
parisc-*) parisc-*)
basic_machine=hppa-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
os=-linux os=-linux
;; ;;
pbd) pbd)
@ -994,7 +987,7 @@ case $basic_machine in
basic_machine=i386-pc basic_machine=i386-pc
;; ;;
pc98-*) pc98-*)
basic_machine=i386-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentium | p5 | k5 | k6 | nexgen | viac3) pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc basic_machine=i586-pc
@ -1009,16 +1002,16 @@ case $basic_machine in
basic_machine=i786-pc basic_machine=i786-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-* | athlon-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
basic_machine=i686-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentium4-*) pentium4-*)
basic_machine=i786-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
@ -1028,23 +1021,23 @@ case $basic_machine in
ppc | ppcbe) basic_machine=powerpc-unknown ppc | ppcbe) basic_machine=powerpc-unknown
;; ;;
ppc-* | ppcbe-*) ppc-* | ppcbe-*)
basic_machine=powerpc-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppcle | powerpclittle) ppcle | powerpclittle | ppc-le | powerpc-little)
basic_machine=powerpcle-unknown basic_machine=powerpcle-unknown
;; ;;
ppcle-* | powerpclittle-*) ppcle-* | powerpclittle-*)
basic_machine=powerpcle-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64) basic_machine=powerpc64-unknown ppc64) basic_machine=powerpc64-unknown
;; ;;
ppc64-*) basic_machine=powerpc64-`echo "$basic_machine" | sed 's/^[^-]*-//'` ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ppc64le | powerpc64little) ppc64le | powerpc64little | ppc64-le | powerpc64-little)
basic_machine=powerpc64le-unknown basic_machine=powerpc64le-unknown
;; ;;
ppc64le-* | powerpc64little-*) ppc64le-* | powerpc64little-*)
basic_machine=powerpc64le-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
@ -1098,10 +1091,17 @@ case $basic_machine in
sequent) sequent)
basic_machine=i386-sequent basic_machine=i386-sequent
;; ;;
sh)
basic_machine=sh-hitachi
os=-hms
;;
sh5el) sh5el)
basic_machine=sh5le-unknown basic_machine=sh5le-unknown
;; ;;
simso-wrs) sh64)
basic_machine=sh64-unknown
;;
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs basic_machine=sparclite-wrs
os=-vxworks os=-vxworks
;; ;;
@ -1120,7 +1120,7 @@ case $basic_machine in
os=-sysv4 os=-sysv4
;; ;;
strongarm-* | thumb-*) strongarm-* | thumb-*)
basic_machine=arm-`echo "$basic_machine" | sed 's/^[^-]*-//'` basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
sun2) sun2)
basic_machine=m68000-sun basic_machine=m68000-sun
@ -1242,9 +1242,6 @@ case $basic_machine in
basic_machine=hppa1.1-winbond basic_machine=hppa1.1-winbond
os=-proelf os=-proelf
;; ;;
x64)
basic_machine=x86_64-pc
;;
xbox) xbox)
basic_machine=i686-pc basic_machine=i686-pc
os=-mingw32 os=-mingw32
@ -1253,12 +1250,20 @@ case $basic_machine in
basic_machine=xps100-honeywell basic_machine=xps100-honeywell
;; ;;
xscale-* | xscalee[bl]-*) xscale-* | xscalee[bl]-*)
basic_machine=`echo "$basic_machine" | sed 's/^xscale/arm/'` basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;; ;;
ymp) ymp)
basic_machine=ymp-cray basic_machine=ymp-cray
os=-unicos os=-unicos
;; ;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
;;
z80-*-coff)
basic_machine=z80-unknown
os=-sim
;;
none) none)
basic_machine=none-none basic_machine=none-none
os=-none os=-none
@ -1287,6 +1292,10 @@ case $basic_machine in
vax) vax)
basic_machine=vax-dec basic_machine=vax-dec
;; ;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11) pdp11)
basic_machine=pdp11-dec basic_machine=pdp11-dec
;; ;;
@ -1296,6 +1305,9 @@ case $basic_machine in
sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
basic_machine=sh-unknown basic_machine=sh-unknown
;; ;;
sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
basic_machine=sparc-sun
;;
cydra) cydra)
basic_machine=cydra-cydrome basic_machine=cydra-cydrome
;; ;;
@ -1315,7 +1327,7 @@ case $basic_machine in
# Make sure to match an already-canonicalized machine name. # Make sure to match an already-canonicalized machine name.
;; ;;
*) *)
echo Invalid configuration \`"$1"\': machine \`"$basic_machine"\' not recognized 1>&2 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1 exit 1
;; ;;
esac esac
@ -1323,10 +1335,10 @@ esac
# Here we canonicalize certain aliases for manufacturers. # Here we canonicalize certain aliases for manufacturers.
case $basic_machine in case $basic_machine in
*-digital*) *-digital*)
basic_machine=`echo "$basic_machine" | sed 's/digital.*/dec/'` basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
;; ;;
*-commodore*) *-commodore*)
basic_machine=`echo "$basic_machine" | sed 's/commodore.*/cbm/'` basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
;; ;;
*) *)
;; ;;
@ -1337,8 +1349,8 @@ esac
if [ x"$os" != x"" ] if [ x"$os" != x"" ]
then then
case $os in case $os in
# First match some system type aliases that might get confused # First match some system type aliases
# with valid system types. # that might get confused with valid system types.
# -solaris* is a basic system type, with this one exception. # -solaris* is a basic system type, with this one exception.
-auroraux) -auroraux)
os=-auroraux os=-auroraux
@ -1349,19 +1361,18 @@ case $os in
-solaris) -solaris)
os=-solaris2 os=-solaris2
;; ;;
-svr4*)
os=-sysv4
;;
-unixware*) -unixware*)
os=-sysv4.2uw os=-sysv4.2uw
;; ;;
-gnu/linux*) -gnu/linux*)
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
;; ;;
# es1800 is here to avoid being matched by es* (a different OS) # First accept the basic system types.
-es1800*)
os=-ose
;;
# Now accept the basic system types.
# The portable systems comes first. # The portable systems comes first.
# Each alternative MUST end in a * to match a version number. # Each alternative MUST END IN A *, to match a version number.
# -sysv* is not here because it comes later, after sysvr4. # -sysv* is not here because it comes later, after sysvr4.
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
| -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
@ -1371,26 +1382,24 @@ case $os in
| -aos* | -aros* | -cloudabi* | -sortix* \ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -knetbsd* | -mirbsd* | -netbsd* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ | -bitrig* | -openbsd* | -solidbsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \ | -chorusos* | -chorusrdb* | -cegcc* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -windiss* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox* | -bme* \
| -midnightbsd*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*) -qnx*)
@ -1407,12 +1416,12 @@ case $os in
-nto*) -nto*)
os=`echo $os | sed -e 's|nto|nto-qnx|'` os=`echo $os | sed -e 's|nto|nto-qnx|'`
;; ;;
-sim | -xray | -os68k* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
;; ;;
-mac*) -mac*)
os=`echo "$os" | sed -e 's|mac|macos|'` os=`echo $os | sed -e 's|mac|macos|'`
;; ;;
-linux-dietlibc) -linux-dietlibc)
os=-linux-dietlibc os=-linux-dietlibc
@ -1421,10 +1430,10 @@ case $os in
os=`echo $os | sed -e 's|linux|linux-gnu|'` os=`echo $os | sed -e 's|linux|linux-gnu|'`
;; ;;
-sunos5*) -sunos5*)
os=`echo "$os" | sed -e 's|sunos5|solaris2|'` os=`echo $os | sed -e 's|sunos5|solaris2|'`
;; ;;
-sunos6*) -sunos6*)
os=`echo "$os" | sed -e 's|sunos6|solaris3|'` os=`echo $os | sed -e 's|sunos6|solaris3|'`
;; ;;
-opened*) -opened*)
os=-openedition os=-openedition
@ -1435,6 +1444,12 @@ case $os in
-wince*) -wince*)
os=-wince os=-wince
;; ;;
-osfrose*)
os=-osfrose
;;
-osf*)
os=-osf
;;
-utek*) -utek*)
os=-bsd os=-bsd
;; ;;
@ -1459,7 +1474,7 @@ case $os in
-nova*) -nova*)
os=-rtmk-nova os=-rtmk-nova
;; ;;
-ns2) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*) -nsk*)
@ -1481,7 +1496,7 @@ case $os in
-oss*) -oss*)
os=-sysv3 os=-sysv3
;; ;;
-svr4*) -svr4)
os=-sysv4 os=-sysv4
;; ;;
-svr3) -svr3)
@ -1496,38 +1511,32 @@ case $os in
-ose*) -ose*)
os=-ose os=-ose
;; ;;
-es1800*)
os=-ose
;;
-xenix)
os=-xenix
;;
-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;; ;;
-aros*)
os=-aros
;;
-zvmoe) -zvmoe)
os=-zvmoe os=-zvmoe
;; ;;
-dicos*) -dicos*)
os=-dicos os=-dicos
;; ;;
-pikeos*)
# Until real need of OS specific support for
# particular features comes up, bare metal
# configurations are quite functional.
case $basic_machine in
arm*)
os=-eabi
;;
*)
os=-elf
;;
esac
;;
-nacl*) -nacl*)
;; ;;
-ios)
;;
-none) -none)
;; ;;
*) *)
# Get rid of the `-' at the beginning of $os. # Get rid of the `-' at the beginning of $os.
os=`echo $os | sed 's/[^-]*-//'` os=`echo $os | sed 's/[^-]*-//'`
echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
exit 1 exit 1
;; ;;
esac esac
@ -1617,12 +1626,12 @@ case $basic_machine in
sparc-* | *-sun) sparc-* | *-sun)
os=-sunos4.1.1 os=-sunos4.1.1
;; ;;
pru-*)
os=-elf
;;
*-be) *-be)
os=-beos os=-beos
;; ;;
*-haiku)
os=-haiku
;;
*-ibm) *-ibm)
os=-aix os=-aix
;; ;;
@ -1662,7 +1671,7 @@ case $basic_machine in
m88k-omron*) m88k-omron*)
os=-luna os=-luna
;; ;;
*-next) *-next )
os=-nextstep os=-nextstep
;; ;;
*-sequent) *-sequent)
@ -1677,6 +1686,9 @@ case $basic_machine in
i370-*) i370-*)
os=-mvs os=-mvs
;; ;;
*-next)
os=-nextstep3
;;
*-gould) *-gould)
os=-sysv os=-sysv
;; ;;
@ -1786,15 +1798,15 @@ case $basic_machine in
vendor=stratus vendor=stratus
;; ;;
esac esac
basic_machine=`echo "$basic_machine" | sed "s/unknown/$vendor/"` basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;; ;;
esac esac
echo "$basic_machine$os" echo $basic_machine$os
exit exit
# Local variables: # Local variables:
# eval: (add-hook 'write-file-functions 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='" # time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d" # time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'" # time-stamp-end: "'"

2866
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -2,15 +2,12 @@
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69]) AC_PREREQ([2.69])
AC_INIT(bson_c_lib, 1.2.5, jacob@livio.io) AC_INIT(bson_c_lib, 1.1.0, jacob@livio.io)
AM_INIT_AUTOMAKE([subdir-objects foreign -Wall]) AM_INIT_AUTOMAKE
AM_MAINTAINER_MODE
AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_MACRO_DIRS([m4])
LT_INIT LT_INIT
AC_CONFIG_SRCDIR([examples/sample.c]) AC_CONFIG_SRCDIR([examples/sample.c])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_FILES([libbson.pc])
AC_OUTPUT
# Checks for programs. # Checks for programs.
AC_PROG_CC AC_PROG_CC
@ -56,13 +53,6 @@ AM_CONDITIONAL(
[BUILD_LUA], [BUILD_LUA],
[test x$with_lua = xyes]) [test x$with_lua = xyes])
AM_COND_IF(
[BUILD_LUA],
[AX_PROG_LUA([5.1], [5.4])])
AM_COND_IF(
[BUILD_LUA],
[AX_LUA_HEADERS])
AC_ARG_WITH( AC_ARG_WITH(
[tests], [tests],
[AS_HELP_STRING( [AS_HELP_STRING(

View File

@ -1,9 +1,9 @@
#! /bin/sh #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects # depcomp - compile a program generating dependencies as side-effects
scriptversion=2016-01-11.22; # UTC scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2017 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -786,6 +786,6 @@ exit 0
# eval: (add-hook 'write-file-hooks 'time-stamp) # eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion=" # time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0" # time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC" # time-stamp-end: "; # UTC"
# End: # End:

View File

@ -1,12 +0,0 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: libbson
Description: Library for parsing to and from BSON format.
URL: https://github.com/smartdevicelink/bson_c_lib
Version: @VERSION@
Requires:
Libs: -L${libdir} -lbson -lemhashmap
Cflags: -I${includedir} -I${includedir}/emhashmap

View File

@ -31,7 +31,7 @@
PROGRAM=libtool PROGRAM=libtool
PACKAGE=libtool PACKAGE=libtool
VERSION="2.4.6 Debian-2.4.6-2" VERSION="2.4.6 Debian-2.4.6-0.1"
package_revision=2.4.6 package_revision=2.4.6
@ -2068,7 +2068,7 @@ include the following information:
compiler: $LTCC compiler: $LTCC
compiler flags: $LTCFLAGS compiler flags: $LTCFLAGS
linker: $LD (gnu? $with_gnu_ld) linker: $LD (gnu? $with_gnu_ld)
version: $progname $scriptversion Debian-2.4.6-2 version: $progname (GNU libtool) 2.4.6
automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q` automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q` autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`

View File

@ -1,8 +1,5 @@
ACLOCAL_AMFLAGS = -I m4 --install AM_CFLAGS = -Wall
AM_LDFLAGS = -export-symbols-regex '^luaopen_' -module -avoid-version lib_LTLIBRARIES = libluabson.la
libluabson_la_SOURCES = bson_lua_wrapper.c
luaexec_LTLIBRARIES = bson4lua.la libluabson_la_LIBADD = ../src/libbson.la
bson4lua_la_SOURCES = bson_lua_wrapper.c
bson4lua_la_LIBADD = ../src/libbson.la
bson4lua_la_CFLAGS = -I../src/

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -128,18 +128,15 @@ am__uninstall_files_from_dir = { \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \ $(am__cd) "$$dir" && rm -f $$files; }; \
} }
am__installdirs = "$(DESTDIR)$(luaexecdir)" am__installdirs = "$(DESTDIR)$(libdir)"
LTLIBRARIES = $(luaexec_LTLIBRARIES) LTLIBRARIES = $(lib_LTLIBRARIES)
bson4lua_la_DEPENDENCIES = ../src/libbson.la libluabson_la_DEPENDENCIES = ../src/libbson.la
am_bson4lua_la_OBJECTS = bson4lua_la-bson_lua_wrapper.lo am_libluabson_la_OBJECTS = bson_lua_wrapper.lo
bson4lua_la_OBJECTS = $(am_bson4lua_la_OBJECTS) libluabson_la_OBJECTS = $(am_libluabson_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@) AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent am__v_lt_0 = --silent
am__v_lt_1 = am__v_lt_1 =
bson4lua_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(bson4lua_la_CFLAGS) \
$(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_P = $(am__v_P_@AM_V@) AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false am__v_P_0 = false
@ -174,8 +171,8 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 = am__v_CCLD_1 =
SOURCES = $(bson4lua_la_SOURCES) SOURCES = $(libluabson_la_SOURCES)
DIST_SOURCES = $(bson4lua_la_SOURCES) DIST_SOURCES = $(libluabson_la_SOURCES)
am__can_run_installinfo = \ am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \ case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \ n|no|NO) false;; \
@ -244,14 +241,6 @@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LUA = @LUA@
LUA_EXEC_PREFIX = @LUA_EXEC_PREFIX@
LUA_INCLUDE = @LUA_INCLUDE@
LUA_PLATFORM = @LUA_PLATFORM@
LUA_PREFIX = @LUA_PREFIX@
LUA_SHORT_VERSION = @LUA_SHORT_VERSION@
LUA_VERSION = @LUA_VERSION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -315,14 +304,10 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
luadir = @luadir@
luaexecdir = @luaexecdir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@ pdfdir = @pdfdir@
pkgluadir = @pkgluadir@
pkgluaexecdir = @pkgluaexecdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
@ -335,17 +320,15 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4 --install AM_CFLAGS = -Wall
AM_LDFLAGS = -export-symbols-regex '^luaopen_' -module -avoid-version lib_LTLIBRARIES = libluabson.la
luaexec_LTLIBRARIES = bson4lua.la libluabson_la_SOURCES = bson_lua_wrapper.c
bson4lua_la_SOURCES = bson_lua_wrapper.c libluabson_la_LIBADD = ../src/libbson.la
bson4lua_la_LIBADD = ../src/libbson.la
bson4lua_la_CFLAGS = -I../src/
all: all-am all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .lo .o .obj .SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -354,9 +337,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lua/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lua/Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign lua/Makefile $(AUTOMAKE) --gnu lua/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
@ -369,39 +352,39 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-luaexecLTLIBRARIES: $(luaexec_LTLIBRARIES) install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL) @$(NORMAL_INSTALL)
@list='$(luaexec_LTLIBRARIES)'; test -n "$(luaexecdir)" || list=; \ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
list2=; for p in $$list; do \ list2=; for p in $$list; do \
if test -f $$p; then \ if test -f $$p; then \
list2="$$list2 $$p"; \ list2="$$list2 $$p"; \
else :; fi; \ else :; fi; \
done; \ done; \
test -z "$$list2" || { \ test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(luaexecdir)'"; \ echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(luaexecdir)" || exit 1; \ $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(luaexecdir)'"; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(luaexecdir)"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
} }
uninstall-luaexecLTLIBRARIES: uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL) @$(NORMAL_UNINSTALL)
@list='$(luaexec_LTLIBRARIES)'; test -n "$(luaexecdir)" || list=; \ @list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
for p in $$list; do \ for p in $$list; do \
$(am__strip_dir) \ $(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(luaexecdir)/$$f'"; \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(luaexecdir)/$$f"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
done done
clean-luaexecLTLIBRARIES: clean-libLTLIBRARIES:
-test -z "$(luaexec_LTLIBRARIES)" || rm -f $(luaexec_LTLIBRARIES) -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
@list='$(luaexec_LTLIBRARIES)'; \ @list='$(lib_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \ locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \ sort -u`; \
@ -410,8 +393,8 @@ clean-luaexecLTLIBRARIES:
rm -f $${locs}; \ rm -f $${locs}; \
} }
bson4lua.la: $(bson4lua_la_OBJECTS) $(bson4lua_la_DEPENDENCIES) $(EXTRA_bson4lua_la_DEPENDENCIES) libluabson.la: $(libluabson_la_OBJECTS) $(libluabson_la_DEPENDENCIES) $(EXTRA_libluabson_la_DEPENDENCIES)
$(AM_V_CCLD)$(bson4lua_la_LINK) -rpath $(luaexecdir) $(bson4lua_la_OBJECTS) $(bson4lua_la_LIBADD) $(LIBS) $(AM_V_CCLD)$(LINK) -rpath $(libdir) $(libluabson_la_OBJECTS) $(libluabson_la_LIBADD) $(LIBS)
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
@ -419,39 +402,29 @@ mostlyclean-compile:
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson4lua_la-bson_lua_wrapper.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_lua_wrapper.Plo@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj: .c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo: .c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
bson4lua_la-bson_lua_wrapper.lo: bson_lua_wrapper.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson4lua_la_CFLAGS) $(CFLAGS) -MT bson4lua_la-bson_lua_wrapper.lo -MD -MP -MF $(DEPDIR)/bson4lua_la-bson_lua_wrapper.Tpo -c -o bson4lua_la-bson_lua_wrapper.lo `test -f 'bson_lua_wrapper.c' || echo '$(srcdir)/'`bson_lua_wrapper.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bson4lua_la-bson_lua_wrapper.Tpo $(DEPDIR)/bson4lua_la-bson_lua_wrapper.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bson_lua_wrapper.c' object='bson4lua_la-bson_lua_wrapper.lo' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson4lua_la_CFLAGS) $(CFLAGS) -c -o bson4lua_la-bson_lua_wrapper.lo `test -f 'bson_lua_wrapper.c' || echo '$(srcdir)/'`bson_lua_wrapper.c
mostlyclean-libtool: mostlyclean-libtool:
-rm -f *.lo -rm -f *.lo
@ -544,7 +517,7 @@ check-am: all-am
check: check-am check: check-am
all-am: Makefile $(LTLIBRARIES) all-am: Makefile $(LTLIBRARIES)
installdirs: installdirs:
for dir in "$(DESTDIR)$(luaexecdir)"; do \ for dir in "$(DESTDIR)$(libdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done done
install: install-am install: install-am
@ -579,7 +552,7 @@ maintainer-clean-generic:
@echo "it deletes files that may require special tools to rebuild." @echo "it deletes files that may require special tools to rebuild."
clean: clean-am clean: clean-am
clean-am: clean-generic clean-libtool clean-luaexecLTLIBRARIES \ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
mostlyclean-am mostlyclean-am
distclean: distclean-am distclean: distclean-am
@ -606,7 +579,7 @@ install-dvi: install-dvi-am
install-dvi-am: install-dvi-am:
install-exec-am: install-luaexecLTLIBRARIES install-exec-am: install-libLTLIBRARIES
install-html: install-html-am install-html: install-html-am
@ -646,24 +619,23 @@ ps: ps-am
ps-am: ps-am:
uninstall-am: uninstall-luaexecLTLIBRARIES uninstall-am: uninstall-libLTLIBRARIES
.MAKE: install-am install-strip .MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-luaexecLTLIBRARIES cscopelist-am ctags \ clean-libLTLIBRARIES clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \ ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \ distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \ html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \ install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \ install-exec-am install-html install-html-am install-info \
install-info-am install-luaexecLTLIBRARIES install-man \ install-info-am install-libLTLIBRARIES install-man install-pdf \
install-pdf install-pdf-am install-ps install-ps-am \ install-pdf-am install-ps install-ps-am install-strip \
install-strip installcheck installcheck-am installdirs \ installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean maintainer-clean-generic mostlyclean \ maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ tags tags-am uninstall uninstall-am uninstall-libLTLIBRARIES
uninstall-luaexecLTLIBRARIES
.PRECIOUS: Makefile .PRECIOUS: Makefile

1
m4/libtool.m4 vendored
View File

@ -728,6 +728,7 @@ _LT_CONFIG_SAVE_COMMANDS([
cat <<_LT_EOF >> "$cfgfile" cat <<_LT_EOF >> "$cfgfile"
#! $SHELL #! $SHELL
# Generated automatically by $as_me ($PACKAGE) $VERSION # Generated automatically by $as_me ($PACKAGE) $VERSION
# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
# NOTE: Changes made to this file will be lost: look at ltmain.sh. # NOTE: Changes made to this file will be lost: look at ltmain.sh.
# Provide generalized library-building support services. # Provide generalized library-building support services.

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -286,14 +286,6 @@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LUA = @LUA@
LUA_EXEC_PREFIX = @LUA_EXEC_PREFIX@
LUA_INCLUDE = @LUA_INCLUDE@
LUA_PLATFORM = @LUA_PLATFORM@
LUA_PREFIX = @LUA_PREFIX@
LUA_SHORT_VERSION = @LUA_SHORT_VERSION@
LUA_VERSION = @LUA_VERSION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -357,14 +349,10 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
luadir = @luadir@
luaexecdir = @luaexecdir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@ pdfdir = @pdfdir@
pkgluadir = @pkgluadir@
pkgluaexecdir = @pkgluaexecdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
@ -387,7 +375,7 @@ all: all-recursive
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .lo .o .obj .SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -396,9 +384,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/Makefile $(AUTOMAKE) --gnu src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
@ -411,9 +399,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -466,25 +454,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util.Plo@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj: .c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo: .c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<

View File

@ -52,7 +52,7 @@ uint8_t *bson_array_to_bytes(BsonArray *array) {
for (i = 0; i < array->count; i++) { for (i = 0; i < array->count; i++) {
BsonElement *element = array->elements[i]; BsonElement *element = array->elements[i];
bytes[position++] = (uint8_t)element->type; bytes[position++] = element->type;
uint8_t *keyBytes = index_to_key(i); uint8_t *keyBytes = index_to_key(i);
memcpy(&bytes[position], keyBytes, digits(i)); memcpy(&bytes[position], keyBytes, digits(i));
@ -144,10 +144,7 @@ BsonArray bson_array_from_bytes(uint8_t *data) {
int32_t size = read_int32_le(&p); int32_t size = read_int32_le(&p);
BsonArray array; BsonArray array;
size_t bytes = bson_array_from_bytes_len(&array, data, (size_t)size); bson_array_from_bytes_len(&array, data, size);
if (bytes <= 0) {
bson_array_initialize(&array, 10);
}
return array; return array;
} }
@ -240,7 +237,7 @@ size_t bson_array_from_bytes_len(BsonArray *output, const uint8_t *data, size_t
bson_array_add_string(&array, stringVal); bson_array_add_string(&array, stringVal);
free(stringVal); free(stringVal);
current += bufferLength; current += bufferLength;
remainBytes -= (size_t)bufferLength; remainBytes -= bufferLength;
} else { } else {
parseError = true; parseError = true;
} }
@ -288,7 +285,7 @@ size_t bson_array_from_bytes_len(BsonArray *output, const uint8_t *data, size_t
} }
} }
if (parseError || dataSize - remainBytes == 0) { if (parseError) {
bson_array_deinitialize(&array); bson_array_deinitialize(&array);
return 0; return 0;
} }

View File

@ -72,7 +72,7 @@ uint8_t *bson_object_to_bytes(BsonObject *obj) {
while (current != NULL) { while (current != NULL) {
BsonElement *element = (BsonElement *)current->value; BsonElement *element = (BsonElement *)current->value;
bytes[position++] = (uint8_t)element->type; bytes[position++] = element->type;
uint8_t *keyBytes = string_to_byte_array(current->key); uint8_t *keyBytes = string_to_byte_array(current->key);
memcpy(&bytes[position], keyBytes, strlen(current->key)); memcpy(&bytes[position], keyBytes, strlen(current->key));
@ -165,10 +165,7 @@ BsonObject bson_object_from_bytes(uint8_t *data) {
int32_t size = read_int32_le(&p); int32_t size = read_int32_le(&p);
BsonObject obj; BsonObject obj;
size_t bytes = bson_object_from_bytes_len(&obj, data, (size_t)size); bson_object_from_bytes_len(&obj, data, size);
if (bytes <= 0) {
bson_object_initialize_default(&obj);
}
return obj; return obj;
} }
@ -261,7 +258,7 @@ size_t bson_object_from_bytes_len(BsonObject *output, const uint8_t *data, size_
bson_object_put_string(&obj, key, stringVal); bson_object_put_string(&obj, key, stringVal);
free(stringVal); free(stringVal);
current += bufferLength; current += bufferLength;
remainBytes -= (size_t)bufferLength; remainBytes -= bufferLength;
} else { } else {
parseError = true; parseError = true;
} }
@ -309,7 +306,7 @@ size_t bson_object_from_bytes_len(BsonObject *output, const uint8_t *data, size_
} }
} }
if (parseError || dataSize - remainBytes == 0) { if (parseError) {
bson_object_deinitialize(&obj); bson_object_deinitialize(&obj);
return 0; return 0;
} }

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -244,14 +244,6 @@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LUA = @LUA@
LUA_EXEC_PREFIX = @LUA_EXEC_PREFIX@
LUA_INCLUDE = @LUA_INCLUDE@
LUA_PLATFORM = @LUA_PLATFORM@
LUA_PREFIX = @LUA_PREFIX@
LUA_SHORT_VERSION = @LUA_SHORT_VERSION@
LUA_VERSION = @LUA_VERSION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -315,14 +307,10 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
luadir = @luadir@
luaexecdir = @luaexecdir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@ pdfdir = @pdfdir@
pkgluadir = @pkgluadir@
pkgluaexecdir = @pkgluaexecdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
@ -344,7 +332,7 @@ all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .lo .o .obj .SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -353,9 +341,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/emhashmap/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/emhashmap/Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/emhashmap/Makefile $(AUTOMAKE) --gnu src/emhashmap/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
@ -368,9 +356,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -421,25 +409,22 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emhashmap.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/emhashmap.Plo@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj: .c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo: .c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<

View File

@ -1,7 +1,7 @@
TESTS = bson_util_test bson_object_test TESTS = bson_util_test bson_object_test
check_PROGRAMS = bson_util_test bson_object_test check_PROGRAMS = bson_util_test bson_object_test
bson_util_test_SOURCES = bson_util_test.c ../src/bson_util.c bson_util_test_SOURCES = bson_util_test.c $(top_builddir)/src/bson_util.c
bson_util_test_CFLAGS = -Wall -I../src @CHECK_CFLAGS@ bson_util_test_CFLAGS = -Wall -I../src @CHECK_CFLAGS@
bson_util_test_LDADD = @CHECK_LIBS@ bson_util_test_LDADD = @CHECK_LIBS@

View File

@ -1,7 +1,7 @@
# Makefile.in generated by automake 1.15.1 from Makefile.am. # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@ # @configure_input@
# Copyright (C) 1994-2017 Free Software Foundation, Inc. # Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
@ -114,9 +114,8 @@ bson_object_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
$(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \ $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
$(bson_object_test_CFLAGS) $(CFLAGS) \ $(bson_object_test_CFLAGS) $(CFLAGS) \
$(bson_object_test_LDFLAGS) $(LDFLAGS) -o $@ $(bson_object_test_LDFLAGS) $(LDFLAGS) -o $@
am__dirstamp = $(am__leading_dot)dirstamp
am_bson_util_test_OBJECTS = bson_util_test-bson_util_test.$(OBJEXT) \ am_bson_util_test_OBJECTS = bson_util_test-bson_util_test.$(OBJEXT) \
../src/bson_util_test-bson_util.$(OBJEXT) bson_util_test-bson_util.$(OBJEXT)
bson_util_test_OBJECTS = $(am_bson_util_test_OBJECTS) bson_util_test_OBJECTS = $(am_bson_util_test_OBJECTS)
bson_util_test_DEPENDENCIES = bson_util_test_DEPENDENCIES =
bson_util_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \ bson_util_test_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC \
@ -432,14 +431,6 @@ LIPO = @LIPO@
LN_S = @LN_S@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@ LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
LUA = @LUA@
LUA_EXEC_PREFIX = @LUA_EXEC_PREFIX@
LUA_INCLUDE = @LUA_INCLUDE@
LUA_PLATFORM = @LUA_PLATFORM@
LUA_PREFIX = @LUA_PREFIX@
LUA_SHORT_VERSION = @LUA_SHORT_VERSION@
LUA_VERSION = @LUA_VERSION@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@ MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@ MKDIR_P = @MKDIR_P@
@ -503,14 +494,10 @@ libdir = @libdir@
libexecdir = @libexecdir@ libexecdir = @libexecdir@
localedir = @localedir@ localedir = @localedir@
localstatedir = @localstatedir@ localstatedir = @localstatedir@
luadir = @luadir@
luaexecdir = @luaexecdir@
mandir = @mandir@ mandir = @mandir@
mkdir_p = @mkdir_p@ mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@ oldincludedir = @oldincludedir@
pdfdir = @pdfdir@ pdfdir = @pdfdir@
pkgluadir = @pkgluadir@
pkgluaexecdir = @pkgluaexecdir@
prefix = @prefix@ prefix = @prefix@
program_transform_name = @program_transform_name@ program_transform_name = @program_transform_name@
psdir = @psdir@ psdir = @psdir@
@ -523,7 +510,7 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@ top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@ top_srcdir = @top_srcdir@
bson_util_test_SOURCES = bson_util_test.c ../src/bson_util.c bson_util_test_SOURCES = bson_util_test.c $(top_builddir)/src/bson_util.c
bson_util_test_CFLAGS = -Wall -I../src @CHECK_CFLAGS@ bson_util_test_CFLAGS = -Wall -I../src @CHECK_CFLAGS@
bson_util_test_LDADD = @CHECK_LIBS@ bson_util_test_LDADD = @CHECK_LIBS@
bson_object_test_SOURCES = bson_object_test.c bson_object_test_SOURCES = bson_object_test.c
@ -534,7 +521,7 @@ all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs .SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -543,9 +530,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__confi
exit 1;; \ exit 1;; \
esac; \ esac; \
done; \ done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
$(am__cd) $(top_srcdir) && \ $(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign test/Makefile $(AUTOMAKE) --gnu test/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \ @case '$?' in \
*config.status*) \ *config.status*) \
@ -558,9 +545,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -576,14 +563,6 @@ clean-checkPROGRAMS:
bson_object_test$(EXEEXT): $(bson_object_test_OBJECTS) $(bson_object_test_DEPENDENCIES) $(EXTRA_bson_object_test_DEPENDENCIES) bson_object_test$(EXEEXT): $(bson_object_test_OBJECTS) $(bson_object_test_DEPENDENCIES) $(EXTRA_bson_object_test_DEPENDENCIES)
@rm -f bson_object_test$(EXEEXT) @rm -f bson_object_test$(EXEEXT)
$(AM_V_CCLD)$(bson_object_test_LINK) $(bson_object_test_OBJECTS) $(bson_object_test_LDADD) $(LIBS) $(AM_V_CCLD)$(bson_object_test_LINK) $(bson_object_test_OBJECTS) $(bson_object_test_LDADD) $(LIBS)
../src/$(am__dirstamp):
@$(MKDIR_P) ../src
@: > ../src/$(am__dirstamp)
../src/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) ../src/$(DEPDIR)
@: > ../src/$(DEPDIR)/$(am__dirstamp)
../src/bson_util_test-bson_util.$(OBJEXT): ../src/$(am__dirstamp) \
../src/$(DEPDIR)/$(am__dirstamp)
bson_util_test$(EXEEXT): $(bson_util_test_OBJECTS) $(bson_util_test_DEPENDENCIES) $(EXTRA_bson_util_test_DEPENDENCIES) bson_util_test$(EXEEXT): $(bson_util_test_OBJECTS) $(bson_util_test_DEPENDENCIES) $(EXTRA_bson_util_test_DEPENDENCIES)
@rm -f bson_util_test$(EXEEXT) @rm -f bson_util_test$(EXEEXT)
@ -591,35 +570,31 @@ bson_util_test$(EXEEXT): $(bson_util_test_OBJECTS) $(bson_util_test_DEPENDENCIES
mostlyclean-compile: mostlyclean-compile:
-rm -f *.$(OBJEXT) -rm -f *.$(OBJEXT)
-rm -f ../src/*.$(OBJEXT)
distclean-compile: distclean-compile:
-rm -f *.tab.c -rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@../src/$(DEPDIR)/bson_util_test-bson_util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_object_test-bson_object_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_object_test-bson_object_test.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util_test-bson_util.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util_test-bson_util_test.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bson_util_test-bson_util_test.Po@am__quote@
.c.o: .c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj: .c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo: .c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
@ -652,19 +627,19 @@ bson_util_test-bson_util_test.obj: bson_util_test.c
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o bson_util_test-bson_util_test.obj `if test -f 'bson_util_test.c'; then $(CYGPATH_W) 'bson_util_test.c'; else $(CYGPATH_W) '$(srcdir)/bson_util_test.c'; fi` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o bson_util_test-bson_util_test.obj `if test -f 'bson_util_test.c'; then $(CYGPATH_W) 'bson_util_test.c'; else $(CYGPATH_W) '$(srcdir)/bson_util_test.c'; fi`
../src/bson_util_test-bson_util.o: ../src/bson_util.c bson_util_test-bson_util.o: $(top_builddir)/src/bson_util.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -MT ../src/bson_util_test-bson_util.o -MD -MP -MF ../src/$(DEPDIR)/bson_util_test-bson_util.Tpo -c -o ../src/bson_util_test-bson_util.o `test -f '../src/bson_util.c' || echo '$(srcdir)/'`../src/bson_util.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -MT bson_util_test-bson_util.o -MD -MP -MF $(DEPDIR)/bson_util_test-bson_util.Tpo -c -o bson_util_test-bson_util.o `test -f '$(top_builddir)/src/bson_util.c' || echo '$(srcdir)/'`$(top_builddir)/src/bson_util.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../src/$(DEPDIR)/bson_util_test-bson_util.Tpo ../src/$(DEPDIR)/bson_util_test-bson_util.Po @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bson_util_test-bson_util.Tpo $(DEPDIR)/bson_util_test-bson_util.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../src/bson_util.c' object='../src/bson_util_test-bson_util.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/src/bson_util.c' object='bson_util_test-bson_util.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o ../src/bson_util_test-bson_util.o `test -f '../src/bson_util.c' || echo '$(srcdir)/'`../src/bson_util.c @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o bson_util_test-bson_util.o `test -f '$(top_builddir)/src/bson_util.c' || echo '$(srcdir)/'`$(top_builddir)/src/bson_util.c
../src/bson_util_test-bson_util.obj: ../src/bson_util.c bson_util_test-bson_util.obj: $(top_builddir)/src/bson_util.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -MT ../src/bson_util_test-bson_util.obj -MD -MP -MF ../src/$(DEPDIR)/bson_util_test-bson_util.Tpo -c -o ../src/bson_util_test-bson_util.obj `if test -f '../src/bson_util.c'; then $(CYGPATH_W) '../src/bson_util.c'; else $(CYGPATH_W) '$(srcdir)/../src/bson_util.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -MT bson_util_test-bson_util.obj -MD -MP -MF $(DEPDIR)/bson_util_test-bson_util.Tpo -c -o bson_util_test-bson_util.obj `if test -f '$(top_builddir)/src/bson_util.c'; then $(CYGPATH_W) '$(top_builddir)/src/bson_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/bson_util.c'; fi`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) ../src/$(DEPDIR)/bson_util_test-bson_util.Tpo ../src/$(DEPDIR)/bson_util_test-bson_util.Po @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/bson_util_test-bson_util.Tpo $(DEPDIR)/bson_util_test-bson_util.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='../src/bson_util.c' object='../src/bson_util_test-bson_util.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$(top_builddir)/src/bson_util.c' object='bson_util_test-bson_util.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o ../src/bson_util_test-bson_util.obj `if test -f '../src/bson_util.c'; then $(CYGPATH_W) '../src/bson_util.c'; else $(CYGPATH_W) '$(srcdir)/../src/bson_util.c'; fi` @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(bson_util_test_CFLAGS) $(CFLAGS) -c -o bson_util_test-bson_util.obj `if test -f '$(top_builddir)/src/bson_util.c'; then $(CYGPATH_W) '$(top_builddir)/src/bson_util.c'; else $(CYGPATH_W) '$(srcdir)/$(top_builddir)/src/bson_util.c'; fi`
mostlyclean-libtool: mostlyclean-libtool:
-rm -f *.lo -rm -f *.lo
@ -959,8 +934,6 @@ clean-generic:
distclean-generic: distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
-rm -f ../src/$(DEPDIR)/$(am__dirstamp)
-rm -f ../src/$(am__dirstamp)
maintainer-clean-generic: maintainer-clean-generic:
@echo "This command is intended for maintainers to use" @echo "This command is intended for maintainers to use"
@ -971,7 +944,7 @@ clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
mostlyclean-am mostlyclean-am
distclean: distclean-am distclean: distclean-am
-rm -rf ../src/$(DEPDIR) ./$(DEPDIR) -rm -rf ./$(DEPDIR)
-rm -f Makefile -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \ distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags distclean-tags
@ -1017,7 +990,7 @@ install-ps-am:
installcheck-am: installcheck-am:
maintainer-clean: maintainer-clean-am maintainer-clean: maintainer-clean-am
-rm -rf ../src/$(DEPDIR) ./$(DEPDIR) -rm -rf ./$(DEPDIR)
-rm -f Makefile -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic maintainer-clean-am: distclean-am maintainer-clean-generic

View File

@ -145,16 +145,11 @@ START_TEST(bson_object_from_bytes_corrupted_key)
} }
memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted)); memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted));
// Test normal method
BsonObject output; BsonObject output;
size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted)); size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted));
// Test deprecated method
BsonObject deprecated_output = bson_object_from_bytes(buf);
free(buf); free(buf);
ck_assert_uint_eq(ret, 0); ck_assert_uint_eq(ret, 0);
ck_assert_uint_eq(bson_object_size(&deprecated_output), 5);
} }
END_TEST END_TEST
@ -176,16 +171,11 @@ START_TEST(bson_object_from_bytes_corrupted_tag_length)
} }
memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted)); memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted));
// Test normal method
BsonObject output; BsonObject output;
size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted)); size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted));
// Test deprecated method
BsonObject deprecated_output = bson_object_from_bytes(buf);
free(buf); free(buf);
ck_assert_uint_eq(ret, 0); ck_assert_uint_eq(ret, 0);
ck_assert_uint_eq(bson_object_size(&deprecated_output), 5);
} }
END_TEST END_TEST
@ -207,16 +197,11 @@ START_TEST(bson_object_from_bytes_corrupted_string)
} }
memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted)); memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted));
// Test normal method
BsonObject output; BsonObject output;
size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted)); size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted));
// Test deprecated method
BsonObject deprecated_output = bson_object_from_bytes(buf);
free(buf); free(buf);
ck_assert_uint_eq(ret, 0); ck_assert_uint_eq(ret, 0);
ck_assert_uint_eq(bson_object_size(&deprecated_output), 5);
} }
END_TEST END_TEST
@ -238,16 +223,11 @@ START_TEST(bson_object_from_bytes_corrupted_integer)
} }
memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted)); memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted));
// Test normal method
BsonObject output; BsonObject output;
size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted)); size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted));
// Test deprecated method
BsonObject deprecated_output = bson_object_from_bytes(buf);
free(buf); free(buf);
ck_assert_uint_eq(ret, 0); ck_assert_uint_eq(ret, 0);
ck_assert_uint_eq(bson_object_size(&deprecated_output), 5);
} }
END_TEST END_TEST
@ -271,16 +251,11 @@ START_TEST(bson_object_from_bytes_corrupted_tag)
} }
memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted)); memcpy(buf, test_data_corrupted, sizeof(test_data_corrupted));
// Test normal method
BsonObject output; BsonObject output;
size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted)); size_t ret = bson_object_from_bytes_len(&output, buf, sizeof(test_data_corrupted));
// Test deprecated method
BsonObject deprecated_output = bson_object_from_bytes(buf);
free(buf); free(buf);
ck_assert_uint_eq(ret, 0); ck_assert_uint_eq(ret, 0);
ck_assert_uint_eq(bson_object_size(&deprecated_output), 5);
} }
END_TEST END_TEST