LCOV - code coverage report
Current view: top level - monetdb5/modules/mal - factories.c (source / functions) Hit Total Coverage
Test: coverage.info Lines: 9 20 45.0 %
Date: 2021-10-13 02:24:04 Functions: 2 7 28.6 %

          Line data    Source code
       1             : /*
       2             :  * This Source Code Form is subject to the terms of the Mozilla Public
       3             :  * License, v. 2.0.  If a copy of the MPL was not distributed with this
       4             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       5             :  *
       6             :  * Copyright 1997 - July 2008 CWI, August 2008 - 2021 MonetDB B.V.
       7             :  */
       8             : 
       9             : /*
      10             :  * (c) Martin Kersten
      11             :  * The factory infrastructure can be inspected and steered with
      12             :  * the commands provided here. to-be-completed-when-needed
      13             :  */
      14             : #include "monetdb_config.h"
      15             : #include "mal.h"
      16             : #include "mal_interpreter.h"
      17             : #include "mal_namespace.h"
      18             : #include "mal_exception.h"
      19             : 
      20             : static str
      21           0 : FCTgetPlants(bat *ret, bat *ret2)
      22             : {
      23             :         (void) ret;
      24             :         (void) ret2;
      25           0 :         throw(MAL, "factories.getPlants", SQLSTATE(0A000) PROGRAM_NYI);
      26             : }
      27             : 
      28             : static str
      29           0 : FCTgetCaller(int *ret)
      30             : {
      31             :         (void) ret;
      32           0 :         throw(MAL, "factories.getCaller", SQLSTATE(0A000) PROGRAM_NYI);
      33             : }
      34             : 
      35             : static str
      36           0 : FCTgetOwners(bat *ret)
      37             : {
      38             :         (void) ret;
      39           0 :         throw(MAL, "factories.getOwner", SQLSTATE(0A000) PROGRAM_NYI);
      40             : }
      41             : 
      42             : static str
      43           0 : FCTgetArrival(bat *ret)
      44             : {
      45             :         (void) ret;
      46           0 :         throw(MAL, "factories.getArrival", SQLSTATE(0A000) PROGRAM_NYI);
      47             : }
      48             : 
      49             : static str
      50           0 : FCTgetDeparture(bat *ret)
      51             : {
      52             :         (void) ret;
      53           0 :         throw(MAL, "factories.getDeparture", SQLSTATE(0A000) PROGRAM_NYI);
      54             : }
      55             : 
      56             : static str
      57           6 : FCTshutdown(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci)
      58             : {
      59           6 :         str mod = *getArgReference_str(stk, pci, 1);
      60           6 :         str fcn = *getArgReference_str(stk, pci, 2);
      61             :         Symbol s;
      62             :         (void) mb;
      63             : 
      64           6 :         s = findSymbol(cntxt->usermodule, putName(mod), putName(fcn));
      65           6 :         if (s == NULL)
      66           0 :                 throw(MAL, "factories.shutdown", SQLSTATE(HY002) RUNTIME_OBJECT_MISSING);
      67           6 :         shutdownFactory(cntxt,s->def);
      68           6 :         return MAL_SUCCEED;
      69             : }
      70             : 
      71             : #include "mel.h"
      72             : mel_func factories_init_funcs[] = {
      73             :  command("factories", "getPlants", FCTgetPlants, false, "Retrieve the names for all active factories.", args(2,2, batarg("mod",str),batarg("fcn",str))),
      74             :  command("factories", "getCaller", FCTgetCaller, false, "Retrieve the unique identity of the factory caller.", args(1,1, arg("",int))),
      75             :  command("factories", "getOwners", FCTgetOwners, false, "Retrieve the factory owners table.", args(1,1, batarg("",str))),
      76             :  command("factories", "getArrival", FCTgetArrival, false, "Retrieve the time stamp the last call was made.", args(1,1, batarg("",timestamp))),
      77             :  command("factories", "getDeparture", FCTgetDeparture, false, "Retrieve the time stamp the last answer was returned.", args(1,1, batarg("",timestamp))),
      78             :  pattern("factories", "shutdown", FCTshutdown, false, "Close a factory.", args(1,3, arg("",void),arg("m",str),arg("f",str))),
      79             :  { .imp=NULL }
      80             : };
      81             : #include "mal_import.h"
      82             : #ifdef _MSC_VER
      83             : #undef read
      84             : #pragma section(".CRT$XCU",read)
      85             : #endif
      86         259 : LIB_STARTUP_FUNC(init_factories_mal)
      87         259 : { mal_module("factories", NULL, factories_init_funcs); }

Generated by: LCOV version 1.14