Ejemplo n.º 1
0
void* fileXioRpc_Dclose(unsigned int* sbuff)
{
	int ret;
	struct fxio_close_packet *packet=(struct fxio_close_packet*)sbuff;

	#ifdef DEBUG
		printf("RPC Dclose Request\n");
	#endif
	ret=dclose(packet->fd);
	sbuff[0] = ret;
	return sbuff;
}
Ejemplo n.º 2
0
Archivo: main.c Proyecto: dbrooke/wsrdr
//! Set up device and execute command(s).
//
int main(int argc, char** argv) {
    // read in program arguments
    read_arguments(argc, argv);

#ifdef _DEBUG
    // DEBUG: list the options
    dump_options();
#endif // _DEBUG

    // help over-rides all. For options variable see cmdline.h
    if (options.showHelp) {
        printHelp();
        exit(0);
    }

    // open the device or its imposter (file), see dfile.h
    if (options.inputFromFile == 1) {
        dopen(cmdFilename);
    }
    else {
        dopen(":usb:");
    }

    // dump header can be executed with other commands
    if (options.dumpHeader == 1) {
        printHeader();
    }

    // now dispatch for processing
    if (options.dumpMemory == 1) {
        // hexdump device memory
        dumpmemory(memoryDumpStart, memoryDumpEnd, DumpWidth);
    }
    else if (options.writeMemoryToFile == 1) {
        // copy device memory to a file
        copymem(cmdFilename);
    }
    else if (options.printRecordsSince == 1) {
        // list records since given date & time
        listRecordsSince(dateSince);
    }
    else if (options.printRecords == 1) {
        // list specified records (0 = current, n = oldest)
        if (options.untilFirstRecord == 1) {
            endRecordNumber = getRecordsStored();
        }
        listRecords(startRecordNumber, endRecordNumber);
    }

    dclose();
}