69int main(
int argc,
char* argv[]) {
70 char* filename =
nullptr;
75 setlocale(LC_ALL,
"");
80 option = getopt_long(argc, argv,
"hnv:V",
opts, NULL);
96 printf(
"%s %s\n",
_(
"sisinstall Version"), VERSION);
101 filename = argv[optind];
102 printf(
_(
"Installing sis file %s%s.\n"), filename, dryrun ?
_(
", not really") :
"");
104 fprintf(stderr,
"%s",
_(
"Missing SIS filename\n"));
108 if (-1 == stat(filename, &st)) {
111 off_t len = st.st_size;
113 printf(
_(
"File is %jd bytes long\n"),
static_cast<intmax_t
>(len));
115 uint8_t* buf =
new uint8_t[len];
116 int fd = open(filename, O_RDONLY);
120 if (-1 == read(fd, buf, len)) {
131 printf(
"%s",
_(
"Couldn't connect with the Psion\n"));
139 installer.
run(&sisFile, buf, len);
141 printf(
"%s",
_(
"Could not parse the sis file.\n"));
int main(int argc, char *argv[])
static void error(int line)
static struct option opts[]