Changeset 883fedc in mainline for uspace/app/sbi/src/strtab.c
- Timestamp:
- 2010-04-23T23:09:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 37c9fc8
- Parents:
- 80badbe (diff), 6c39a907 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/sbi/src/strtab.c
r80badbe r883fedc 30 30 * 31 31 * Converts strings to more compact SID (string ID, integer) and back. 32 * The string table is not an object as there will never be a need for 32 * (The point is that this deduplicates the strings. Using SID might actually 33 * not be such a big win.) 34 * 35 * The string table is a singleton as there will never be a need for 33 36 * more than one. 37 * 38 * Current implementation uses a linked list and thus it is slow. 34 39 */ 35 40 … … 43 48 static list_t str_list; 44 49 50 /** Initialize string table. */ 45 51 void strtab_init(void) 46 52 { … … 48 54 } 49 55 56 /** Get SID of a string. 57 * 58 * Return SID of @a str. If @a str is not in the string table yet, 59 * it is added and thus a new SID is assigned. 60 * 61 * @param str String 62 * @return SID of @a str. 63 */ 50 64 sid_t strtab_get_sid(const char *str) 51 65 { … … 70 84 } 71 85 86 /** Get string with the given SID. 87 * 88 * Returns string that has SID @a sid. If no such string exists, this 89 * causes a fatal error in the interpreter. 90 * 91 * @param sid SID of the string. 92 * @return Pointer to the string. 93 */ 72 94 char *strtab_get_str(sid_t sid) 73 95 {
Note:
See TracChangeset
for help on using the changeset viewer.