• About TV's server
  • New in version 3.10
  • About the source code
  • About protocols/plugins
  • TV's server API
  • Protocol Initialisation
  • Protocol binding
  • Protocol Listening and handling
  • Protocol data storage
  • Control panel
  • Multi column list
  • Time and date
  • Http protocol functions
  • Unimplemented and/or replaced functions
  • SavePluginData function

    The SaveData function will save data for plugin. This data can be restored by GetPluginData function.

    Syntax

    int __stdcall SavePluginData(
    __in ProtocolSession *psess,
    __in ListenSession *lsess,
    __in ClientSession *sess,
    __in char *name,
    __in char *data,
    __in int len,
    __in int flags
    );

    Parameters

    psess [in]lsess [in]sess [in]name [in]data [in]len [in]flags [in]
    ValueMeaning
    GDPD_IS_LIST
    0x1
    The name paramter identifies a MultiColumnList initialized by the SetControlPanelOptions. The data parameter should hold a pointer to a list or have enough space to receive a pointer to a list. See the Remark section for more information.
    GDPD_NO_COPY_LIST
    0x2
    GetPluginData should not make a copy of the list if it doesn't exist in the memory space of the Listensession or ClientSession. Setting this flag will cause the function GetPluginData to return the same pointer that exists in the ListenSession (from where the ClientSession was created) or ProtocolSession. This means that all changes made to the list will also have effect on the ListenSession or ProtocolSession from where the pointer originaly came from. This flag should be combinated with the GDPD_IS_LIST flag.
    GDPD_MEMORY_ONLY
    0x4
    The data should be saved in memory only, set this flag will cause the SavePluginData function not to store the data on disk. This flag has no effect on the function GetPluginData.
    GDPD_NAME_IS_INTEGER
    0x80
    The name paramter is not a pointer to a null-terminated string but an integer to identify the data.
    GDPD_RESET_DATA
    0x8
    The data, identified by name, should be deleted for the selected session. This will not delete the identified data for other sessions, nor will it delete the default data set by SetControlPanelOptions. This flag has no effect on the function GetPluginData.

    Return value

    If no error occurs the function returns True (one). If the function fails it will return False (zero).

    Remarks

    If flag GDPD_IS_LIST is set and the name parameter points to a list, initialized by the SetControlPanelOptions function, the SavePluginData function will save the changes made to a list to the harddrive. The data parameter should point to the pointer holding the list pointer returned by the GetPluginData function.

    If parameter sess and lsess are both zero, the data will be saved on protocol level.
    If parameter sess is zero lsess is not zero the data will be saved for the listen session and automatic applied on new client sessions.
    If parameter sess is not zero lsess is zero the data will be saved for the client session.
    If parameter sess and lsess are both not zero, the function result in an error.

    Requirements

    Should be exported by -
    Minimum supported API 1.00
    Header tvsserver_base
    .h