1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Corrected many #includes for header files (where they are included).

Moved the includes for Lua headers to the .cc files so they are
not needlessly, repeatedly included.

Similarly, moved some standard headers to the .cc files and reorganized
includes to be uniform for all nse_* source files.

Fixed whitespace (removed tabs).
This commit is contained in:
batrick
2009-03-10 05:56:10 +00:00
parent c2fc8af1ba
commit 07cfc5aee4
18 changed files with 67 additions and 72 deletions

View File

@@ -41,12 +41,12 @@
#include <ctype.h>
#include <string.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <nbase.h>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include "nse_binlib.h"
static void badcode(lua_State *L, int c)

View File

@@ -8,6 +8,11 @@
* the most recent copy can be found at http://rrt.sc3d.org/Software/Lua/
**/
extern "C" {
#include "lauxlib.h"
#include "lua.h"
}
#include "nse_bit.h"
typedef long long Integer;

View File

@@ -3,12 +3,6 @@
#define BITLIBNAME "bit"
extern "C" {
#include "lauxlib.h"
#include "lua.h"
}
LUALIB_API int luaopen_bit(lua_State *L);
#endif

View File

@@ -1,3 +1,9 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include "nse_debug.h"
#include "output.h"

View File

@@ -1,12 +1,6 @@
#ifndef NSE_DEBUG
#define NSE_DEBUG
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
void value_dump(lua_State *L, int i, int depth_limit);
void stack_dump(lua_State *L);
void lua_state_dump(lua_State *L);

View File

@@ -1,3 +1,13 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include <vector>
#include <string>
#include <string.h>
#ifndef WIN32
#include "dirent.h"
#endif

View File

@@ -1,16 +1,6 @@
#ifndef NSE_FS
#define NSE_FS
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <vector>
#include <string>
#include <string.h>
int nse_check_extension (const char* ext, const char* path);
int nse_fetchfile(char *path, size_t path_len, const char *file);

View File

@@ -1,3 +1,14 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h" /* for libraries */
}
#include <vector>
#include <string>
#include <string.h>
#include "nse_init.h"
#include "nse_nmaplib.h"
#include "nse_macros.h"

View File

@@ -1,16 +1,6 @@
#ifndef NSE_INIT
#define NSE_INIT
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <vector>
#include <string>
#include <string.h>
// initialize the lua state
// opens the standard libraries and the nmap lua library
int init_lua(lua_State* L);

View File

@@ -1,3 +1,4 @@
#include "nse_main.h"
#include "nse_init.h"

View File

@@ -1,18 +1,17 @@
#ifndef NMAP_LUA_H
#define NMAP_LUA_H
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
#include <vector>
#include <list>
#include <string>
#include <string.h>
#include <iostream>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
class ScriptResult
{
private:

View File

@@ -1,3 +1,9 @@
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include <math.h>
#include "nmap.h"

View File

@@ -1,12 +1,6 @@
#ifndef NSE_NMAPLIB
#define NSE_NMAPLIB
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
class Target;
class Port;

View File

@@ -1,12 +1,8 @@
#include "nse_nsock.h"
#include "nse_macros.h"
#include "nse_debug.h"
#include "nsock.h"
#include "nmap_error.h"
/* #include "osscan.h" */
#include "NmapOps.h"
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include <stdio.h>
#include <stdlib.h>
@@ -14,6 +10,13 @@
#include <sstream>
#include <iomanip>
#include "nse_nsock.h"
#include "nse_macros.h"
#include "nse_debug.h"
#include "nsock.h"
#include "nmap_error.h"
#include "NmapOps.h"
#include "utils.h"
#include "tcpip.h"

View File

@@ -1,12 +1,6 @@
#ifndef NMAP_LUA_NSOCK_H
#define NMAP_LUA_NSOCK_H
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}
int luaopen_nsock(lua_State *);
int l_nsock_new(lua_State *);
int l_nsock_loop(int tout);

View File

@@ -18,9 +18,12 @@
#include <openssl/evp.h>
#include <openssl/err.h>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
#include "nse_openssl.h"
#include "lua.h"
#include "lauxlib.h"
typedef struct bignum_data {
BIGNUM * bn;

View File

@@ -3,11 +3,6 @@
#define OPENSSLLIBNAME "openssl"
extern "C" {
#include "lua.h"
#include "lauxlib.h"
}
LUALIB_API int luaopen_openssl(lua_State *L);
#endif

View File

@@ -8,8 +8,8 @@
#include <string.h>
extern "C" {
#include "lua.h"
#include "lauxlib.h"
#include "lua.h"
#include "lauxlib.h"
}
#include <locale.h>