* This was originally designed for FSS (Featureless Settings Specification) but has been expanded to be used by the entire project.
*
* An FLL Identifier consists of two parts:
- * 1) A 64-byte long string representing a machine-name for the type.
+ * 1) A 64-byte long string representing a machine-name for the type, where the last byte (the 64th byte) must always be NULL.
* 2) A 16-bit digit representing 2^16 possible type classifications, which is representeed by 4 hexadecial 1-byte strings for text.
*
* For example "fss-1234" is a valid type such that:
* 1) name: "fss".
- * 2) type: "1234", (or 0x1 in binary.
+ * 2) type: "1234", (or 0x1 in binary).
*
* UTF-8 codes are available, but one must consider that 1 4-byte characte still takes up 4-bytes.
* Therefore for all 4-byte UTF-8 characters, there is a maximum of 16 characters available.
*
* The name must only be "word" characters (therefore "-" is not allowed).
*
+ * The f_fll_id_name_length_d defines the length of non-NULL characters and the f_fll_id_name_max_length_d must always be 1 byte longer than f_fll_id_name_length_d.
+ * This allows for the f_fll_id_t.name to be guaranteed to always be a NULL terminated when properly managed.
+ *
* Properties:
* - name: The string representing the name of the FLL Identifier (This is not a NULL terminated string).
* - type: The code representing the type of the Identifier.
* - used: A representation of how many bytes in name are in used (if 0, then there is no name, thus this can be seen as not a valid identifier).
*/
#ifndef _di_f_fll_id_t_
- #define f_fll_id_name_length_d 64
+ #define f_fll_id_name_length_d 63
+ #define f_fll_id_name_max_length_d (f_fll_id_name_length_d + 1)
typedef struct {
- char name[f_fll_id_name_length_d];
+ char name[f_fll_id_name_max_length_d];
uint16_t type;
uint8_t used;