Store links between a user-readable string and a constant. More...
Go to the source code of this file.
Functions | |
const char * | mutt_map_get_name (int val, const struct Mapping *map) |
Lookup a string for a constant. | |
int | mutt_map_get_value_n (const char *name, size_t len, const struct Mapping *map) |
Lookup the constant for a string. | |
int | mutt_map_get_value (const char *name, const struct Mapping *map) |
Lookup the constant for a string. | |
Store links between a user-readable string and a constant.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file mapping.c.
const char * mutt_map_get_name | ( | int | val, |
const struct Mapping * | map | ||
) |
Lookup a string for a constant.
val | ID to locate in map |
map | NULL-terminated map of strings and constants |
ptr | String matching ID |
NULL | Error, or ID not found |
Definition at line 42 of file mapping.c.
int mutt_map_get_value_n | ( | const char * | name, |
size_t | len, | ||
const struct Mapping * | map | ||
) |
Lookup the constant for a string.
name | String to locate in map |
len | Length of the name string (need not be null terminated) |
map | NULL-terminated map of strings and constants |
num | ID matching string |
-1 | Error, or string not found |
Definition at line 62 of file mapping.c.
int mutt_map_get_value | ( | const char * | name, |
const struct Mapping * | map | ||
) |
Lookup the constant for a string.
name | String to locate in map |
map | NULL-terminated map of strings and constants |
num | ID matching string |
-1 | Error, or string not found |
Definition at line 85 of file mapping.c.