diff options
author | Sam Gross <sgross@fb.com> | 2015-08-03 23:54:07 +0300 |
---|---|---|
committer | Sam Gross <colesbury@gmail.com> | 2015-08-04 00:15:20 +0300 |
commit | d21b760cf7d9cde8e9acef0bb9661a788eb23024 (patch) | |
tree | 4579772005daa0e4ba4fd9f0a7618d30befeeb7d | |
parent | 0b7a623c557fffc6dca390c4072e950184ef8207 (diff) |
Add Facebook LICENSE, PATENTS, and CONTRIBUTING files
-rw-r--r-- | CONTRIBUTING.md | 30 | ||||
-rw-r--r-- | LICENSE | 30 | ||||
-rw-r--r-- | PATENTS | 33 | ||||
-rw-r--r-- | README.md | 55 | ||||
-rw-r--r-- | call.c | 7 | ||||
-rw-r--r-- | call_arm.dasc | 7 | ||||
-rw-r--r-- | call_x64.h | 7 | ||||
-rw-r--r-- | call_x64win.h | 7 | ||||
-rw-r--r-- | call_x86.dasc | 7 | ||||
-rw-r--r-- | call_x86.h | 7 | ||||
-rw-r--r-- | ctype.c | 7 | ||||
-rw-r--r-- | ffi.c | 7 | ||||
-rw-r--r-- | ffi.h | 28 | ||||
-rw-r--r-- | luaffi-scm-1.rockspec | 6 | ||||
-rw-r--r-- | parser.c | 7 | ||||
-rw-r--r-- | test.c | 7 | ||||
-rw-r--r-- | test.lua | 9 |
17 files changed, 173 insertions, 88 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..3591e05 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,30 @@ +# Contributing to luaffifb +We want to make contributing to this project as easy and transparent as +possible. + +## Our Development Process +... (in particular how this is synced with internal changes to the project) + +## Pull Requests +We actively welcome your pull requests. +1. Fork the repo and create your branch from `master`. +2. If you've added code that should be tested, add tests +3. If you haven't already, complete the Contributor License Agreement ("CLA"). + +## Contributor License Agreement ("CLA") +In order to accept your pull request, we need you to submit a CLA. You only need +to do this once to work on any of Facebook's open source projects. + +Complete your CLA here: <https://code.facebook.com/cla> + +## Issues +We use GitHub issues to track public bugs. Please ensure your description is +clear and has sufficient instructions to be able to reproduce the issue. + +## Coding Style +* Use four spaces for indentation rather than tabs +* 80 character line length + +## License +By contributing to luaffifb, you agree that your contributions will be licensed +under its BSD license. @@ -0,0 +1,30 @@ +BSD License + +For luaffifb software + +Copyright (c) 2015, Facebook, Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the name Facebook nor the names of its contributors may be used to + endorse or promote products derived from this software without specific + prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. @@ -0,0 +1,33 @@ +Additional Grant of Patent Rights Version 2 + +"Software" means the ztorch software distributed by Facebook, Inc. + +Facebook, Inc. ("Facebook") hereby grants to each recipient of the Software +("you") a perpetual, worldwide, royalty-free, non-exclusive, irrevocable +(subject to the termination provision below) license under any Necessary +Claims, to make, have made, use, sell, offer to sell, import, and otherwise +transfer the Software. For avoidance of doubt, no license is granted under +Facebookâs rights in any patent claims that are infringed by (i) modifications +to the Software made by you or any third party or (ii) the Software in +combination with any software or other technology. + +The license granted hereunder will terminate, automatically and without notice, +if you (or any of your subsidiaries, corporate affiliates or agents) initiate +directly or indirectly, or take a direct financial interest in, any Patent +Assertion: (i) against Facebook or any of its subsidiaries or corporate +affiliates, (ii) against any party if such Patent Assertion arises in whole or +in part from any software, technology, product or service of Facebook or any of +its subsidiaries or corporate affiliates, or (iii) against any party relating +to the Software. Notwithstanding the foregoing, if Facebook or any of its +subsidiaries or corporate affiliates files a lawsuit alleging patent +infringement against you in the first instance, and you respond by filing a +patent infringement counterclaim in that lawsuit against that party that is +unrelated to the Software, the license granted hereunder will not terminate +under section (i) of this paragraph due to such counterclaim. + +A "Necessary Claim" is a claim of a patent owned by Facebook that is +necessarily infringed by the Software standing alone. + +A "Patent Assertion" is any lawsuit or other action alleging direct, indirect, +or contributory infringement or inducement to infringe any patent, including a +cross-claim or counterclaim. @@ -6,63 +6,26 @@ http://luajit.org/ext_ffi.html). It can parse C function declarations and struct definitions that have been directly copied out of C header files and
into lua source as a string.
-License
--------
-Copyright (c) 2011 James R. McKaskill.
-MIT same as Lua 5.1. See full license text in ffi.h.
+This is a fork of https://github.com/jmckaskill/luaffi
Source
------
-https://github.com/jmckaskill/luaffi
+https://github.com/facebook/luaffifb
Platforms
---------
Currently supported:
-- windows x86/x64
-- linux x86/x64
-- windows CE ARM little endian (ARMv4+)
+- Linux x86/x64
- OSX x86/x64
-Currently only dll builds are supported (ie no static).
-
-Runs with both Lua 5.1 and Lua 5.2 beta.
+Runs with both Lua 5.1 and Lua 5.2.
Build
-----
-
-On windows use msvcbuild.bat in a visual studio cmd prompt. Available targets are:
-- nothing or release: default release build
-- debug: debug build
-- test: build and run the test debug build
-- test-release: build and run the test release build
-- clean: cleanup object files
-
-Edit msvcbuild.bat if your lua exe, lib, lua include path, or lua dll name
-differ from c:\Lua5.1 and lua5.1.dll.
-
-The build script does not build for CE as this is non-trivial and very
-dependent on which CE profile (or even a custom one). Instead to build on CE,
-add generate_call_h.bat as a pre-build event and then build *.c with UNDER_CE
-defined plus whatever defines windows.h requires.
-
-On posix use make. Available targets are:
-- nothing or all: default release build
-- debug: debug build
-- test: build and run the test build
-- clean: cleanup object files
-- macosx: release build for Mac OSX
-
-Edit the Makefile if your lua exe differs from `lua5.1` or if you can't get
-the include and lib arguments from pkg-config.
+- Run `luarocks make`
Known Issues
------------
-- Has not been bullet proof tested
-- Casting is different from luajit. For the moment this follows C++
- - ffi.cast is equivalent to a C cast in C++ (T t = (T) f)
- - ffi.new and ctype() is equivalent to an implicit cast in C++ (T t = f)
- - since this follows C++ semantics void* does not cast to T* (an explicit
- cast using ffi.cast is required)
- Comparing a ctype pointer to nil doesn't work the same as luajit. This is
unfixable with the current metamethod semantics. Instead use ffi.C.NULL
- Constant expressions can't handle non integer intermediate values (eg
@@ -74,14 +37,6 @@ this upgrade to Lua 5.2 or use boxed numbers (uint64_t and uintptr_t). bitfields?). Note that "int s:8" is unsigned on unix x86/x64, but signed on
windows.
-Todo
-----
-See Github issues for the most up to date list.
-- Fix arm support - broken since the callback refactor
-- Vectors
-- C++ reference types
-- Subtracting one pointer from another
-- Variable sized members in unions (is this needed?)
How it works
------------
@@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #include "ffi.h" diff --git a/call_arm.dasc b/call_arm.dasc index 6145adc..97dffa8 100644 --- a/call_arm.dasc +++ b/call_arm.dasc @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ |.arch arm |.actionlist build_actionlist @@ -10,7 +10,12 @@ #endif /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ static const unsigned char build_actionlist[2016] = { diff --git a/call_x64win.h b/call_x64win.h index 9a7dc75..9d2b466 100644 --- a/call_x64win.h +++ b/call_x64win.h @@ -10,7 +10,12 @@ #endif /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ static const unsigned char build_actionlist[1959] = { diff --git a/call_x86.dasc b/call_x86.dasc index ca2414c..68f63cb 100644 --- a/call_x86.dasc +++ b/call_x86.dasc @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ |.if X64 |.arch x64 @@ -10,7 +10,12 @@ #endif /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ static const unsigned char build_actionlist[1800] = { @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #include "ffi.h" @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #include "ffi.h" #include <math.h> @@ -1,28 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. * - * Copyright (c) 2011 James R. McKaskill - * - * This software is licensed under the stock MIT license: - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - * - * ---------------------------------------------------------------------------- + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #pragma once diff --git a/luaffi-scm-1.rockspec b/luaffi-scm-1.rockspec index c3ee1c2..3d3955b 100644 --- a/luaffi-scm-1.rockspec +++ b/luaffi-scm-1.rockspec @@ -2,15 +2,15 @@ package = "luaffi" version = "scm-1" source = { - url = "git://github.com/jmckaskill/luaffi.git", + url = "https://github.com/facebook/luaffifb.git", } description = { summary = "FFI library for calling C functions from lua", detailed = [[ ]], - homepage = "https://github.com/jmckaskill/luaffi", - license = "MIT" + homepage = "https://github.com/facebook/luaffifb", + license = "BSD" } dependencies = { @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #include "ffi.h" @@ -1,5 +1,10 @@ /* vim: ts=4 sw=4 sts=4 et tw=78 - * Copyright (c) 2011 James R. McKaskill. See license in ffi.h + * Copyright (c) 2015-present, Facebook, Inc. All rights reserved. + * Copyright (c) 2011 James R. McKaskill. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. */ #include <stdio.h> #include <stdint.h> @@ -1,6 +1,11 @@ -- vim: ts=4 sw=4 sts=4 et tw=78 --- Copyright (c) 2011 James R. McKaskill. See license in ffi.h - +-- Copyright (c) 2015-present, Facebook, Inc. All rights reserved. +-- Copyright (c) 2011 James R. McKaskill. +-- +-- This source code is licensed under the BSD-style license found in the +-- LICENSE file in the root directory of this source tree. An additional grant +-- of patent rights can be found in the PATENTS file in the same directory. +-- io.stdout:setvbuf('no') local ffi = require 'ffi' local dlls = {} |