# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0.  If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 1997 - July 2008 CWI, August 2008 - 2016 MonetDB B.V.

module inspect;

pattern getDefinition(mod:str,fcn:str) :bat[:str] 
address INSPECTgetDefinition
comment "Returns a string representation of a specific function.";

pattern getSignature(mod:str,fcn:str) :bat[:str] 
address INSPECTgetSignature
comment "Returns the function signature(s).";

pattern getAddress(mod:str,fcn:str) :bat[:str] 
address INSPECTgetAddress
comment "Returns the function signature(s).";

pattern getComment(mod:str,fcn:str) :bat[:str]
address INSPECTgetComment
comment "Returns the function help information.";

pattern getSource(mod:str,fcn:str):str
address INSPECTgetSource
comment "Return the original input for a function.";

pattern getKind():bat[:str]
address INSPECTgetkind
comment "Obtain the instruction kind.";
pattern getModule():bat[:str]
address INSPECTgetAllModules
comment "Obtain the function name.";
pattern getFunction():bat[:str]
address INSPECTgetAllFunctions
comment "Obtain the function name.";
pattern getSignatures():bat[:str]
address INSPECTgetAllSignatures
comment "Obtain the function signatures.";
pattern getAddresses():bat[:str]
address INSPECTgetAllAddresses
comment "Obtain the function address.";


pattern getSize():lng
address INSPECTgetSize
comment "Return the storage size for the current function (in bytes).";

pattern getSize(mod:str,fcn:str):lng
address INSPECTgetFunctionSize
comment "Return the storage size for a function (in bytes).";


pattern getType(v:any_1) :str 
address INSPECTtypeName
comment "Return the concrete type of a variable (expression).";

pattern equalType(l:any, r:any):bit
address INSPECTequalType
comment "Return true if both operands are of the same type";
command getAtomNames():bat[:str] 
address INSPECTatom_names
comment "Collect a BAT with the atom names.";
command getAtomSuper():bat[:str] 
address INSPECTatom_sup_names
comment "Collect a BAT with the atom names.";
command getAtomSizes():bat[:int] 
address INSPECTatom_sizes
comment "Collect a BAT with the atom sizes.";

command getEnvironment() (k:bat[:str], v:bat[:str])
address INSPECTgetEnvironment
comment "Collect the environment variables.";
command getEnvironment(k:str) :str
address INSPECTgetEnvironmentKey
comment "Get the value of an environemnt variable";
