1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-30 11:29:01 +00:00

Move get/set_program_name from main.cc to nmap.cc.

This is for technical reasons; nmap-private-dev programs need to link
against objects files but they can't link against main.o because that
results in a duplicate definition of main.
This commit is contained in:
david
2011-06-15 18:12:33 +00:00
parent c32e8c5513
commit b0a49d2ad1
2 changed files with 12 additions and 12 deletions

13
nmap.cc
View File

@@ -138,12 +138,21 @@ extern char *optarg;
extern int optind;
extern NmapOps o; /* option structure */
/* argv[0] storage from main.cc. */
extern const char *get_program_name(void);
static bool target_needs_new_hostgroup(std::vector<Target *> &targets,
const Target *target);
static void display_nmap_version();
/* A mechanism to save argv[0] for code that requires that. */
static const char *program_name = NULL;
void set_program_name(const char *name) {
program_name = name;
}
static const char *get_program_name(void) {
return program_name;
}
/* parse the --scanflags argument. It can be a number >=0 or a string consisting of TCP flag names like "URGPSHFIN". Returns -1 if the argument is invalid. */
static int parse_scanflags(char *arg) {
int flagval = 0;