You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2012/06/12 17:51:37 UTC

[22/50] git commit: Add lapi.h

Add lapi.h


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/a33d0132
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/a33d0132
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/a33d0132

Branch: refs/heads/jpeach/lua
Commit: a33d013249b5361fb7e8ae5df0af1c8250e8f6c1
Parents: 279040c
Author: James Peach <jp...@apache.org>
Authored: Sat Apr 14 21:09:16 2012 -0700
Committer: James Peach <jp...@apache.org>
Committed: Tue Jun 12 08:48:35 2012 -0700

----------------------------------------------------------------------
 plugins/lua/lapi.cc |    9 +--------
 plugins/lua/lapi.h  |   30 ++++++++++++++++++++++++++++++
 plugins/lua/lua.cc  |   14 +-------------
 3 files changed, 32 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a33d0132/plugins/lua/lapi.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lapi.cc b/plugins/lua/lapi.cc
index e0848b5..457b327 100644
--- a/plugins/lua/lapi.cc
+++ b/plugins/lua/lapi.cc
@@ -18,14 +18,7 @@
 
 #include <ts/ts.h>
 #include <ts/remap.h>
-
-extern "C" {
-#include <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-}
-
-#include <unistd.h>
+#include "lapi.h"
 
 int
 LuaPushUrl(lua_State * lua, TSMBuffer buffer, TSMLoc url)

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a33d0132/plugins/lua/lapi.h
----------------------------------------------------------------------
diff --git a/plugins/lua/lapi.h b/plugins/lua/lapi.h
new file mode 100644
index 0000000..cbd3448
--- /dev/null
+++ b/plugins/lua/lapi.h
@@ -0,0 +1,30 @@
+/*
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you 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.
+*/
+
+extern "C" {
+#include <lua.h>
+#include <lualib.h>
+#include <lauxlib.h>
+}
+
+// Initialize the 'ts' module.
+int LuaApiInit(lua_State * lua);
+
+// Push a copy of the given URL.
+int LuaPushUrl(lua_State * lua, TSMBuffer buffer, TSMLoc url);
+

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/a33d0132/plugins/lua/lua.cc
----------------------------------------------------------------------
diff --git a/plugins/lua/lua.cc b/plugins/lua/lua.cc
index 3d63cfd..c48c328 100644
--- a/plugins/lua/lua.cc
+++ b/plugins/lua/lua.cc
@@ -18,20 +18,8 @@
 
 #include <ts/ts.h>
 #include <ts/remap.h>
-
-extern "C" {
-#include <lua.h>
-#include <lualib.h>
-#include <lauxlib.h>
-}
-
 #include <unistd.h>
-
-// Initialize the 'ts' module.
-extern int LuaApiInit(lua_State *);
-
-// Push a copy of the given URL.
-extern int LuaPushUrl(lua_State*, TSMBuffer, TSMLoc);
+#include "lapi.h"
 
 static void *
 LuaAllocate(void * ud, void * ptr, size_t osize, size_t nsize)