#include <arpa/inet.h>
#include <errno.h>
#include <popt.h>
#include <resolv.h>
#include <net/if.h>
#include <newt.h>
#include <stdlib.h>
#include <string.h>
#ifdef __STANDALONE__
#include <netdb.h>
#include <libintl.h>
#include <locale.h>
#define _(String) gettext((String))
#define LOADER_BACK 2
#define LOADER_ERROR -1;
#include "net.h"
#else
# include "isys/dns.h"
#include "pump/pump.h"
#include "kickstart.h"
#include "lang.h"
#include "loader.h"
#include "log.h"
#include "net.h"
#include "windows.h"
#endif /* __STANDALONE__ */
struct intfconfig_s {
newtComponent ipEntry, nmEntry, gwEntry, nsEntry;
char * ip, * nm, * gw, * ns;
};
typedef int int32;
#ifdef __STANDALONE__
static FILE * logfile = NULL;
#define FL_TESTING(foo) 0
void logMessage(const char * s, ...) {
va_list args;
if (!logfile) return;
va_start(args, s);
fprintf(logfile, "* ");
vfprintf(logfile, s, args);
fprintf(logfile, "\n");
fflush(logfile);
va_end(args);
return;
}
/* yawn. This really should be in newt. */
void winStatus(int width, int height, char * title,
char * text, ...) {
newtComponent t, f;
char * buf = NULL;
int size = 0;
int i = 0;
va_list args;
va_start(args, text);
do {
size += 1000;
if (buf) free(buf);
buf = malloc(size);
i = vsnprintf(buf, size, text, args);
} while (i == size);
va_end(args);
newtCenteredWindow(width, height, title);
t = newtTextbox(1, 1, width - 2, height - 2, NEWT_TEXTBOX_WRAP);
|