コード例 #1
0
/**
 * @brief Clear a connection manager.
 */
OpcUa_Void OpcUa_TcpListener_ConnectionManager_Clear(
    OpcUa_TcpListener_ConnectionManager* a_pConnectionManager)
{
    if (a_pConnectionManager == OpcUa_Null)
    {
        return;
    }

    /* be sure to delete all connections before! */
    OpcUa_List_Delete(&(a_pConnectionManager->Connections));
}
コード例 #2
0
ファイル: opcua_list.c プロジェクト: OPCFoundation/UA-AnsiC
/**
  @brief Creates a new empty list.

  Crashes if a_ppNewList is null
  @return OpcUa_Good on success

  @param a_ppNewList    [in/out]    Location of a pointer to the new list
*/
 OpcUa_StatusCode OpcUa_List_Create(OpcUa_List** a_ppNewList)
{
    OpcUa_List*         pNewList    = OpcUa_Null;
    OpcUa_StatusCode    uStatus     = OpcUa_Good;
    OpcUa_DeclareErrorTraceModule(OpcUa_Module_List);

    OpcUa_ReturnErrorIfArgumentNull(a_ppNewList);

    *a_ppNewList = OpcUa_Null;

    pNewList = (OpcUa_List*)OpcUa_Alloc(sizeof(OpcUa_List));
    OpcUa_ReturnErrorIfAllocFailed(pNewList);

    uStatus = OpcUa_List_Initialize(pNewList);
    if(OpcUa_IsBad(uStatus))
    {
        /* error during initialize -> Cleanup */
        OpcUa_List_Delete(&pNewList);
    }

    *a_ppNewList = pNewList;

    return uStatus;
}