Subversion Repositories HelenOS

Rev

Rev 4743 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4743 Rev 4756
Line 75... Line 75...
75
     */
75
     */
76
    int             magic;
76
    int             magic;
77
};
77
};
78
 
78
 
79
/** Adds the value with the key to the map.
79
/** Adds the value with the key to the map.
80
 *  @param map The character string to integer map. Input/output parameter.
80
 *  @param[in,out] map The character string to integer map.
81
 *  @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
81
 *  @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
82
 *  @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
82
 *  @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
83
 *  @param value The integral value to be stored for the key character string. Input parameter.
83
 *  @param[in] value The integral value to be stored for the key character string.
84
 *  @returns EOK on success.
84
 *  @returns EOK on success.
85
 *  @returns EINVAL if the map is not valid.
85
 *  @returns EINVAL if the map is not valid.
86
 *  @returns EINVAL if the identifier parameter is NULL.
86
 *  @returns EINVAL if the identifier parameter is NULL.
87
 *  @returns EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero ('\\0') character.
87
 *  @returns EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero ('\\0') character.
88
 *  @returns EEXIST if the key character string is already used.
88
 *  @returns EEXIST if the key character string is already used.
89
 *  @returns Other error codes as defined for the char_map_add_item() function.
89
 *  @returns Other error codes as defined for the char_map_add_item() function.
90
 */
90
 */
91
int char_map_add( char_map_ref map, const char * identifier, size_t length, const int value );
91
int char_map_add( char_map_ref map, const char * identifier, size_t length, const int value );
92
 
92
 
93
/** Clears and destroys the map.
93
/** Clears and destroys the map.
94
 *  @param map The character string to integer map. Input/output parameter.
94
 *  @param[in,out] map The character string to integer map.
95
 */
95
 */
96
void    char_map_destroy( char_map_ref map );
96
void    char_map_destroy( char_map_ref map );
97
 
97
 
98
/** Excludes the value assigned to the key from the map.
98
/** Excludes the value assigned to the key from the map.
99
 *  The entry is cleared from the map.
99
 *  The entry is cleared from the map.
100
 *  @param map The character string to integer map. Input/output parameter.
100
 *  @param[in,out] map The character string to integer map.
101
 *  @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
101
 *  @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
102
 *  @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
102
 *  @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
103
 *  @returns The integral value assigned to the key character string.
103
 *  @returns The integral value assigned to the key character string.
104
 *  @returns CHAR_MAP_NULL if the key is not assigned a value.
104
 *  @returns CHAR_MAP_NULL if the key is not assigned a value.
105
 */
105
 */
106
int char_map_exclude( char_map_ref map, const char * identifier, size_t length );
106
int char_map_exclude( char_map_ref map, const char * identifier, size_t length );
107
 
107
 
108
/** Returns the value assigned to the key from the map.
108
/** Returns the value assigned to the key from the map.
109
 *  @param map The character string to integer map. Input parameter.
109
 *  @param[in] map The character string to integer map.
110
 *  @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
110
 *  @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
111
 *  @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
111
 *  @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
112
 *  @returns The integral value assigned to the key character string.
112
 *  @returns The integral value assigned to the key character string.
113
 *  @returns CHAR_MAP_NULL if the key is not assigned a value.
113
 *  @returns CHAR_MAP_NULL if the key is not assigned a value.
114
 */
114
 */
115
int char_map_find( const char_map_ref map, const char * identifier, size_t length );
115
int char_map_find( const char_map_ref map, const char * identifier, size_t length );
116
 
116
 
117
/** Initializes the map.
117
/** Initializes the map.
118
 *  @param map The character string to integer map. Input/output parameter.
118
 *  @param[in,out] map The character string to integer map.
119
 *  @returns EOK on success.
119
 *  @returns EOK on success.
120
 *  @returns EINVAL if the map parameter is NULL.
120
 *  @returns EINVAL if the map parameter is NULL.
121
 *  @returns ENOMEM if there is not enough memory left.
121
 *  @returns ENOMEM if there is not enough memory left.
122
 */
122
 */
123
int char_map_initialize( char_map_ref map );
123
int char_map_initialize( char_map_ref map );
124
 
124
 
125
/** Adds or updates the value with the key to the map.
125
/** Adds or updates the value with the key to the map.
126
 *  @param map The character string to integer map. Input/output parameter.
126
 *  @param[in,out] map The character string to integer map.
127
 *  @param identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found. Input parameter.
127
 *  @param[in] identifier The key zero ('\\0') terminated character string. The key character string is processed until the first terminating zero ('\\0') character after the given length is found.
128
 *  @param length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found. Input parameter.
128
 *  @param[in] length The key character string length. The parameter may be zero (0) which means that the string is processed until the terminating zero ('\\0') character is found.
129
 *  @param value The integral value to be stored for the key character string. Input parameter.
129
 *  @param[in] value The integral value to be stored for the key character string.
130
 *  @returns EOK on success.
130
 *  @returns EOK on success.
131
 *  @returns EINVAL if the map is not valid.
131
 *  @returns EINVAL if the map is not valid.
132
 *  @returns EINVAL if the identifier parameter is NULL.
132
 *  @returns EINVAL if the identifier parameter is NULL.
133
 *  @returns EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero ('\\0) character.
133
 *  @returns EINVAL if the length parameter zero (0) and the identifier parameter is an empty character string (the first character is the terminating zero ('\\0) character.
134
 *  @returns EEXIST if the key character string is already used.
134
 *  @returns EEXIST if the key character string is already used.