Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
dict.c File Reference
Dict Object Type. More...
Go to the source code of this file.
Functions | |
PmReturn_t | dict_new (pPmObj_t *r_pdict) |
Allocates space for a new Dict. | |
PmReturn_t | dict_clear (pPmObj_t pdict) |
Clears the contents of a dict. | |
PmReturn_t | dict_setItem (pPmObj_t pdict, pPmObj_t pkey, pPmObj_t pval) |
Sets a value in the dict using the given key. | |
PmReturn_t | dict_getItem (pPmObj_t pdict, pPmObj_t pkey, pPmObj_t *r_pobj) |
Gets the value in the dict using the given key. | |
PmReturn_t | dict_delItem (pPmObj_t pdict, pPmObj_t pkey) |
Removes a key and value from the dict. | |
PmReturn_t | dict_print (pPmObj_t pdict) |
Prints out a dict. | |
PmReturn_t | dict_update (pPmObj_t pdestdict, pPmObj_t psourcedict) |
Updates the destination dict with the key,value pairs from the source dict. |
Detailed Description
Dict Object Type.
Dict object type operations.
Definition in file dict.c.
Function Documentation
PmReturn_t dict_clear | ( | pPmObj_t | pdict ) |
Clears the contents of a dict.
after this operation, the dict should in the same state as if it were just created using dict_new().
- Parameters:
-
pdict ptr to dict to clear.
- Returns:
- nothing
PmReturn_t dict_delItem | ( | pPmObj_t | pdict, |
pPmObj_t | pkey | ||
) |
PmReturn_t dict_getItem | ( | pPmObj_t | pdict, |
pPmObj_t | pkey, | ||
pPmObj_t * | r_pobj | ||
) |
PmReturn_t dict_new | ( | pPmObj_t * | r_pdict ) |
PmReturn_t dict_print | ( | pPmObj_t | pdict ) |
Prints out a dict.
Uses obj_print() to print elements.
- Parameters:
-
pobj Object to print.
- Returns:
- Return status
PmReturn_t dict_setItem | ( | pPmObj_t | pdict, |
pPmObj_t | pkey, | ||
pPmObj_t | pval | ||
) |
Sets a value in the dict using the given key.
If the dict already contains a matching key, the value is replaced; otherwise the new key,val pair is inserted at the front of the dict (for fast lookup). In the later case, the length of the dict is incremented.
- Parameters:
-
pdict ptr to dict in which (key,val) will go pkey ptr to key obj pval ptr to val obj
- Returns:
- Return status
PmReturn_t dict_update | ( | pPmObj_t | pdestdict, |
pPmObj_t | psourcedict | ||
) |
Generated on Tue Jul 12 2022 17:07:01 by
