Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 121f3b48 authored by Android (Google) Code Review's avatar Android (Google) Code Review
Browse files

Merge change 2341

* changes:
  Convert libacc into a shared library.
parents 940f7cc5 1cdef207
Loading
Loading
Loading
Loading

include/acc/acc.h

0 → 100644
+78 −0
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef ANDROID_ACC_ACC_H
#define ANDROID_ACC_ACC_H

#include <stdint.h>
#include <sys/types.h>

typedef char                        ACCchar;
typedef int32_t                     ACCint;
typedef uint32_t                    ACCuint;
typedef ssize_t                     ACCsizei;
typedef unsigned int                ACCenum;
typedef void                        ACCvoid;
typedef struct ACCscript            ACCscript;

#define ACC_NO_ERROR                0x0000
#define ACC_INVALID_ENUM            0x0500
#define ACC_INVALID_OPERATION       0x0502
#define ACC_INVALID_VALUE           0x0501
#define ACC_OUT_OF_MEMORY           0x0505

#define ACC_COMPILE_STATUS          0x8B81
#define ACC_INFO_LOG_LENGTH         0x8B84


// ----------------------------------------------------------------------------

#ifdef __cplusplus
extern "C" {
#endif

ACCscript* accCreateScript();

void accDeleteScript(ACCscript* script);

ACCenum accGetError( ACCscript* script );

void accScriptSource(ACCscript* script,
    ACCsizei count,
    const ACCchar** string,
    const ACCint* length);

void accCompileScript(ACCscript* script);

void accGetScriptiv(ACCscript* script,
    ACCenum pname,
    ACCint* params);

void accGetScriptInfoLog(ACCscript* script,
    ACCsizei maxLength,
    ACCsizei* length,
    ACCchar* infoLog);

void accGetScriptLabel(ACCscript* script, const ACCchar * name,
                       ACCvoid** address);

#ifdef __cplusplus
};
#endif

// ----------------------------------------------------------------------------

#endif
+11 −4
Original line number Diff line number Diff line
@@ -5,8 +5,15 @@ include $(CLEAR_VARS)
# Shared library
#

LOCAL_MODULE:= acc
LOCAL_SRC_FILES := acc.cpp disassem.cpp
LOCAL_MODULE_TAGS := tests
LOCAL_MODULE:= libacc
LOCAL_SRC_FILES := acc.cpp

include $(BUILD_EXECUTABLE)
ifeq ($(TARGET_ARCH),arm)
LOCAL_SRC_FILES += disassem.cpp
endif

LOCAL_SHARED_LIBRARIES := libdl

include $(BUILD_SHARED_LIBRARY)

include $(call all-makefiles-under,$(LOCAL_PATH))
 No newline at end of file

libacc/LICENSE

0 → 100644
+21 −0
Original line number Diff line number Diff line
 Obfuscated Tiny C Compiler

 Copyright (C) 2001-2003 Fabrice Bellard

 This software is provided 'as-is', without any express or implied
 warranty.  In no event will the authors be held liable for any damages
 arising from the use of this software.

 Permission is granted to anyone to use this software for any purpose,
 including commercial applications, and to alter it and redistribute it
 freely, subject to the following restrictions:

 1. The origin of this software must not be misrepresented; you must not
 claim that you wrote the original software. If you use this software
 in a product, an acknowledgment in the product and its documentation
 *is* required.
 2. Altered source versions must be plainly marked as such, and must not be
 misrepresented as being the original software.
 3. This notice may not be removed or altered from any source distribution.

+400 −178

File changed.

Preview size limit exceeded, changes collapsed.

libacc/testarm

deleted100755 → 0
+0 −4
Original line number Diff line number Diff line
#!/bin/sh
adb remount
adb push tests/returnval.c /system/bin/returnval.c
mm -j8 && adb sync && adb shell /system/bin/acc -S /system/bin/returnval.c
Loading