Function: AddMasterTitle(TitleName, IsPrefix)
Description: Creates a master title definition, or returns the existing definition found by a case-insensitive name match.
Parameters:
TitleName: string - Nonempty title name. The runtime title value keeps up to 255 bytes and a terminating null byte.IsPrefix: int8 - Nonzero for a prefix; zero for a suffix. Defaults to zero.
Returns: SInt32 - The master title database ID, or -1 when the name is invalid or the insert fails.
Ownership: Catalogue rows are owned values. A lookup or replacement cannot leave this call with a pointer to a deleted title. Local C++ preparation finishes before the Lua result is pushed. Database writes and memory publication remain separate operations.