nmc-utils  0.1.1
nmrun.c File Reference
#include <stdio.h>
#include <getopt.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <sys/select.h>
#include <string.h>
#include <sys/time.h>
#include <sys/types.h>
#include <termios.h>
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <stdint.h>
#include <errno.h>
#include <sys/epoll.h>
#include <easynmc.h>
Include dependency graph for nmrun.c:

Go to the source code of this file.

Macros

#define dbg(fmt,...)
#define err(fmt,...)
#define NUMEVENTS   3

Functions

void usage (char *nm)
void nonblock (int fd, int state)
void die ()
void handle_sigint (int sig)
int read_inbound (int fd)
int run_interactive_console (struct easynmc_handle *h)
int main (int argc, char **argv)

Variables

int g_debug = 1
int g_force = 0
int g_nostdio = 0
int g_detach = 0
int g_nosigint = 0
struct easynmc_handleg_handle = NULL

Macro Definition Documentation

#define dbg (   fmt,
  ... 
)
Value:
if (g_debug) { \
fprintf(stderr, "libeasynmc: " fmt, ##__VA_ARGS__); \
}

Definition at line 52 of file nmrun.c.

#define err (   fmt,
  ... 
)
Value:
if (g_debug) { \
fprintf(stderr, "libeasynmc: " fmt, ##__VA_ARGS__); \
}

Definition at line 56 of file nmrun.c.

#define NUMEVENTS   3

Definition at line 152 of file nmrun.c.

Referenced by run_interactive_console().

Function Documentation

void die ( )

Definition at line 133 of file nmrun.c.

References easynmc_stop_app(), g_nosigint, and nonblock().

Referenced by handle_sigint(), and run_interactive_console().

void handle_sigint ( int  sig)

Definition at line 146 of file nmrun.c.

References die().

Referenced by main().

void nonblock ( int  fd,
int  state 
)

Definition at line 107 of file nmrun.c.

Referenced by die(), main(), and run_interactive_console().

int read_inbound ( int  fd)

Definition at line 155 of file nmrun.c.

Referenced by run_interactive_console().

int run_interactive_console ( struct easynmc_handle h)
void usage ( char *  nm)

Definition at line 64 of file nmrun.c.

Variable Documentation

int g_debug = 1

Definition at line 42 of file nmrun.c.

int g_detach = 0

Definition at line 45 of file nmrun.c.

Referenced by main().

int g_force = 0

Definition at line 43 of file nmrun.c.

struct easynmc_handle* g_handle = NULL

Definition at line 48 of file nmrun.c.

int g_nosigint = 0

Definition at line 46 of file nmrun.c.

Referenced by die(), and main().

int g_nostdio = 0

Definition at line 44 of file nmrun.c.