TKE  3.6
Advanced code editor for programmers
api::plugin Namespace Reference

Functions

 save_variable interp pname index name value
 
 load_variable interp pname index name
 
 is_exposed interp pname name
 
 exec_exposed interp pname name args
 
 reload interp pname
 
 get_header_info interp pname attr
 

Function Documentation

§ exec_exposed()

api::plugin::exec_exposed   interp pname name args  

Executes the exposed procedure (if it exists) and returns the value returned by the procedure. If the procedure does not exist or there is an exception thrown by the procedure, a value of -1 will be returned to the calling method.

Definition at line 887 of file api.tcl.

887  proc exec_exposed {interp pname name args} {
888 
889  if {[plugins::is_exposed $name] && ![catch { plugins::execute_exposed $name {*}$args} retval]} {
890  return $retval
891  }
892 
893  return -1
894 
895  }

§ get_header_info()

api::plugin::get_header_info   interp pname attr  

Returns the value of the requested field from the header.tkedat file associated with the calling plugin.

The supported values for the 'attr' parameter are the following:

  • name
  • display_name
  • author
  • email
  • website
  • version
  • trust_required
  • description
  • category

Definition at line 920 of file api.tcl.

920  proc get_header_info {interp pname attr} {
921 
922  return [plugins::get_header_info $pname $attr]
923 
924  }

§ is_exposed()

api::plugin::is_exposed   interp pname name  

Returns a value of true if the given procedure has been exposed by another plugin. The value of "name" should be in the form of: <plugin_name>::<procedure_name>

Definition at line 876 of file api.tcl.

876  proc is_exposed {interp pname name} {
877 
878  return [plugins::is_exposed $name]
879 
880  }

§ load_variable()

api::plugin::load_variable   interp pname index name  

Retrieves the value of the named variable from non-corruptible memory (from a previous save_variable call.

Parameters
indexUnique value that is passed to the on_reload retrieve command.
nameName of the variable to get the value of. If the named variable could not be found), an empty string is returned.

Definition at line 866 of file api.tcl.

866  proc load_variable {interp pname index name} {
867 
868  return [plugins::restore_data $index $name]
869 
870  }

§ reload()

api::plugin::reload   interp pname  

Reloads the plugins. This is useful if the plugin changes its own code at runtime and needs to re-source itself.

Definition at line 900 of file api.tcl.

900  proc reload {interp pname} {
901 
903 
904  }

§ save_variable()

api::plugin::save_variable   interp pname index name value  

Saves the value of the given variable name to non-corruptible memory so that it can be later retrieved when the plugin is reloaded.

Parameters
indexUnique value that is passed to the on_reload save command.
nameName of the variable to store
valueVariable value to store

Definition at line 853 of file api.tcl.

853  proc save_variable {interp pname index name value} {
854 
855  plugins::save_data $index $name $value
856 
857  }