mirror of https://gitee.com/bigwinds/arangodb
109 lines
4.0 KiB
C
109 lines
4.0 KiB
C
////////////////////////////////////////////////////////////////////////////////
|
|
/// @brief js execution context
|
|
///
|
|
/// @file
|
|
///
|
|
/// DISCLAIMER
|
|
///
|
|
/// Copyright 2010-2012 triagens GmbH, Cologne, Germany
|
|
///
|
|
/// Licensed under the Apache License, Version 2.0 (the "License");
|
|
/// you may not use this file except in compliance with the License.
|
|
/// You may obtain a copy of the License at
|
|
///
|
|
/// http://www.apache.org/licenses/LICENSE-2.0
|
|
///
|
|
/// Unless required by applicable law or agreed to in writing, software
|
|
/// distributed under the License is distributed on an "AS IS" BASIS,
|
|
/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
/// See the License for the specific language governing permissions and
|
|
/// limitations under the License.
|
|
///
|
|
/// Copyright holder is triAGENS GmbH, Cologne, Germany
|
|
///
|
|
/// @author Dr. Frank Celler
|
|
/// @author Jan Steemann
|
|
/// @author Copyright 2012, triagens GmbH, Cologne, Germany
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef TRIAGENS_DURHAM_VOC_BASE_CONTEXT_H
|
|
#define TRIAGENS_DURHAM_VOC_BASE_CONTEXT_H 1
|
|
|
|
#include "VocBase/document-collection.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @addtogroup VocBase
|
|
/// @{
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// --SECTION-- EXECUTION CONTEXT
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// --SECTION-- public types
|
|
// -----------------------------------------------------------------------------
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @brief JavaScript execution context
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
typedef void* TRI_js_exec_context_t;
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @brief execution context of a query
|
|
///
|
|
/// In order to execute a query, you need an execution context. The results are
|
|
/// only valid as long as the context exists. After freeing the context you
|
|
/// should no longer access the result cursor or the result documents.
|
|
///
|
|
/// When creating an execution context, parts of clauses might use JavaScript.
|
|
/// A JavaScript execution context is created for these clauses.
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
typedef struct TRI_rc_context_s { // DEPRECATED
|
|
TRI_doc_collection_t* _primary;
|
|
|
|
TRI_js_exec_context_t _selectClause;
|
|
TRI_js_exec_context_t _whereClause;
|
|
TRI_js_exec_context_t _orderClause;
|
|
}
|
|
TRI_rc_context_t;
|
|
|
|
// -----------------------------------------------------------------------------
|
|
// --SECTION-- public functions
|
|
// -----------------------------------------------------------------------------
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @brief creates a new execution context
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
TRI_js_exec_context_t TRI_CreateExecutionContext (char const* script);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @brief frees an new execution context
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
void TRI_FreeExecutionContext (TRI_js_exec_context_t context);
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
/// @}
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|
|
|
|
// Local Variables:
|
|
// mode: outline-minor
|
|
// outline-regexp: "^\\(/// @brief\\|/// {@inheritDoc}\\|/// @addtogroup\\|// --SECTION--\\|/// @\\}\\)"
|
|
// End:
|
|
|
|
|