SlotFactory_createEntry()

Create a new slot entry instance.

Synopsis:

#include <asr/slot-factory.h>
 
SlotFactory_Entry* SlotFactory_createEntry(SlotFactory *self, const char *terminal, const uint64_t *id)

Arguments:

self

A pointer to the slot factory whose slot entry buffer provides the slot entry to associate with the slot entry structure.

terminal

The terminal string to associate with the entry.

id

A pointer to a buffer containing a 64-bit entry ID to associate with the asr_slot_entry_t type associated with the returned Entry.

Library:

libasr

Description:

The SlotFactory_createEntry() function creates a new slot entry instance, associating it with an asr_slot_entry_t structure from the factory's buffer.

The SlotFactory_createEntry() function creates a new slot entry instance on the heap, copies the specified terminal into its word buffer, allocates a new asr_slot_entry_t structure from the factory, then associates the two structures. An optional entry ID, id, can be specified and is assigned to the newly allocated entry. If no ID is specified, one is assigned automatically.

Returns:

A new instance of the SlotFactory_Entry structure, created on the heap, that represents the specified terminal. The ownership of the memory returned by this function is transferred to the calling context, which must delete it using the SlotFactory_Entry_delete() function.