Find Jobs
Hire Freelancers

C - v.simple Hash Table functions - init(), lookup(), and insert() ONLY...easy stuff.

$30-5000 USD

Completed
Posted about 20 years ago

$30-5000 USD

Paid on delivery
I need 3 very basic hash table functions - written in C and compiled using gcc: [login to view URL]() - to create a hash table [login to view URL]() - lookup item in the table and return a pointer to it if it's there, or a flag representing it's absence [login to view URL]() - insert item into table This is to be part of a lexical analysis program - the hash table holding the symbol table. i.e. when I have an identifier in the program I am analysing it will search the hash table for it's presence and insert it if absent. I don't need move, delete... functions, as identifiers only require one entry in a symbol table. The symbol table is for a subset of C so the identifiers are between 1 and 9 characters (inclusive, i.e. they can be 1 character, or up to 9), and can only include alphanumeric characters. Apart from that the hash table does not have to hold anything else - just the identifier itself. EXACT SPECS: =========== st_initialise() -> constructs and initialises the hash table (symbol table) accessed by a global variable. Initially contains an entry for every keyword in the language subset (eg. "while", WHILE) as a pair. Only include the while example - I'll add the others myself. token_t st_lookup(char *textname) -> looks up character string textname in symbol table & inserts it if not there. Returns associated token type (eg. WHILE if the lookup type is keyword, or IDENTIFIER if the lookup type is not a keyword like "while", but instead an identifier like "fred"). It then places a pointer to the symbol table entry in a global variable (this is finally going to be tokenvalue.p, but you can do it however you want - I'll change it later). st_entry *st_insert_string(char *textname, token_t tokentype) -> inserts a pair (textname, tokentype) into the hash table, and returns pointer to this entry. Any questions please let me know. This should be very straightforward and quick for you to do. A fast turn around time would be fantastic (eg. by tomorrow if possible). Please let me know how long this should take you when you bid. Thanks for reading. Cheers. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Exclusive and complete copyrights to all work purchased. (No GPL, GNU, 3rd party components, etc. unless all copyright ramifications are explained AND AGREED TO by the buyer on the site per the coder's Seller Legal Agreement). ## Platform C language - to be compiled using gcc.
Project ID: 3100958

About the project

10 proposals
Remote project
Active 20 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
See private message.
$2 USD in 3 days
4.5 (10 reviews)
4.1
4.1
10 freelancers are bidding on average $14 USD for this job
User Avatar
See private message.
$24.57 USD in 3 days
5.0 (160 reviews)
6.0
6.0
User Avatar
See private message.
$25.50 USD in 3 days
4.9 (62 reviews)
5.4
5.4
User Avatar
See private message.
$20.40 USD in 3 days
5.0 (52 reviews)
4.9
4.9
User Avatar
See private message.
$8.50 USD in 3 days
4.8 (21 reviews)
4.3
4.3
User Avatar
See private message.
$8.50 USD in 3 days
4.8 (32 reviews)
3.7
3.7
User Avatar
See private message.
$17 USD in 3 days
4.6 (46 reviews)
3.7
3.7
User Avatar
See private message.
$6.80 USD in 3 days
5.0 (3 reviews)
1.3
1.3
User Avatar
See private message.
$17 USD in 3 days
1.7 (3 reviews)
1.8
1.8
User Avatar
See private message.
$12.75 USD in 3 days
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED KINGDOM
United Kingdom
5.0
21
Member since Dec 11, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.