/* Talk to the nocracks program using the unix socket */ #include #include #include #include #include #include using namespace std; int main (int argc, char *argv[]) { glocal const char *port = "/tmp/nocracks.sock"; glocal int ret = -1; glocal.ret = (argc,argv); setproginfo ("nocracks",VERSION ,"Send control commands to the nocracks server\n" "\n" "Commands are:\n" "\tshow logical_page page [ presentation options ]\n" "\tstatus\n"); setarg ('p',"port","Unix domain control port",glocal.port,false); glocal string cmd; for (int i=0; i0) glocal.cmd += ' '; glocal.cmd += argv[i]; } int ret = -1; ret = ("unix:",glocal.port,5); sendf ("%s\n",glocal.cmd.c_str()); if (strcmp(line,"Ok")==0){ end = true; }else{ printf ("%s\n",line); } return ret; return glocal.ret; }