Results 1 to 1 of 1
I am coding a simple shell to control a USB device. I am trying to use gperf to generate a perfect hash table to lookup command names. Problem is, I ...
- 11-19-2007 #1
gperf help on input file
I am coding a simple shell to control a USB device. I am trying to use gperf to generate a perfect hash table to lookup command names. Problem is, I was under the impression that it creates a hash table that points to an array of structs that you put in the input file, like this:
It's only creating an array of strings in the output code. Has anybody used this utility? I'm either missing something syntactically in the input file or a command-line switch.Code:%define lookup-function-name lookup %readonly-tables struct command { char *name; char *funcName; int optCount; }; %% batt, battery, 0 dl, download, 1 help, help, 0 info, getInfo, 0 ls, listFiles, 0 sn, setName, 0 ul, upload, 1 %%


Reply With Quote