[MacPorts] Registry2Notes added

MacPorts noreply at macports.org
Sat Mar 14 17:33:20 PDT 2009


Added page "Registry2Notes" by blb at macports.org from 75.163.161.111*
Page URL: <http://trac.macports.org/wiki/Registry2Notes>
Comment: Some notes about the registry2.0 code
Content:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
= Introduction =
Note that some source files have doxygen-style comments, so some docs can be created by running doxygen on them.

== Tcl commands created == #tcl_commands
 - `registry::entry cmd ?arg ...?`
  - Run a command against registry entries
 - `${entry} cmd ?arg ...?`
  - Commands specific to just one registry entry (usually gained from `registry::entry`)
 - `item cmd ?arg ...?`
 - `${item} cmd ?arg ...?`
 - `registry::open`
 - `registry::close`
 - `registry::read`
 - `registry::write`

== C code files == #c_code
=== entry.[ch] === #entry_c
 - void delete_entry(ClientData clientData)
  - to be used as the 'Tcl_CmdDeleteProc' for an entry object
 - int entry_cmd(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
  - implements "registry::entry cmd ?arg ...?"
  - commands are:
   - create - entry_create()
   - delete - entry_delete()
   - open - entry_open()
   - close - entry_close()
   - search - entry_search()
   - exists - entry_exists()
   - imaged - entry_imaged()
   - intalled - entry_installed()
   - owner - entry_owner()

=== entryobj.[ch] === #entryobj_c
 - int entry_obj_cmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
  - implements "${entry} cmd ?arg ...?" (procs for entry objects from "registry::entry")
  - commands are:
   - name - entry_obj_prop()
   -  portfile - entry_obj_prop()
   -  url - entry_obj_prop()
   -  location - entry_obj_prop()
   -  epoch - entry_obj_prop()
   -  version - entry_obj_prop()
   -  revision - entry_obj_prop()
   -  variants - entry_obj_prop()
   -  default_variants - entry_obj_prop()
   -  date - entry_obj_prop()
   -  state - entry_obj_prop()
   -  installtype - entry_obj_prop()
   -  map - entry_obj_filemap()
   -  unmap - entry_obj_filemap()
   -  files - entry_obj_files()
   -  imagefiles - entry_obj_imagefiles()
   -  activate - entry_obj_activate()
   -  deactivate - entry_obj_filemap()
   -  dependents - entry_obj_dependents()
   -  dependencies - entry_obj_dependencies()
   -  depends - entry_obj_depends()

=== graph.[ch] === #graph_c
=== graphobj.[ch] === #graphobj_c
 - Not completed, not built

=== item.[ch] === #item_c
 - int item_cmd(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
  - implements "item cmd ?arg ...?"
  - commands are:
   - create - item_create()
   -  search - item_search()
   -  exists - item_exists()
   -  others are commented-out (retain, release, name, url, path, worker, options, and variants)

=== itemobj.[ch] === #itemobj_c
 - int item_obj_cmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])
  - implements "${item} cmd ?arg ...?" (procs for item objects from "item"
  - commands are:
   - retain - item_obj_retain()
   - release - item_obj_release()
   - key - item_obj_key()

=== registry.[ch] === #registry_c
 - reg_registry* registry_for(Tcl_Interp* interp, int status)
  - Get the appropriate registry for the given Tcl interpreter
 - int registry_failed(Tcl_Interp* interp, reg_error* errPtr)
  - Sets a Tcl object result based on errPtr
 - int Registry_Init(Tcl_Interp* interp)
  - The Tcl entry point for registry2.0; creates several commands:
   - registry::open - registry_open()
   - registry::close - registry_close()
   - registry::read - registry_read()
   - registry::write - registry_write()
   - registry::entry - entry_cmd()

=== util.[ch] === #util_c
 - char* unique_name(Tcl_Interp* interp, char* prefix)
  - Generate a unique proc name starting with the given prefix (eg, ''<prefix>123'', ''<prefix>124'', etc)
 - int parse_flags(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[], int* start, option_spec options[], int* flags)
  - Handle flags ('''-flag''') in Tcl command strings
 - void* get_object(Tcl_Interp* interp, char* name, char* type, Tcl_ObjCmdProc* proc, reg_error* errPtr)
  - Retrieves the object whose proc is named by the given name
 - int set_object(Tcl_Interp* interp, char* name, void* value, char* type, Tcl_ObjCmdProc* proc, Tcl_CmdDeleteProc* deleteProc, reg_error* errPtr)
  - Sets the object whose proc is named by the given name
 - int set_entry(Tcl_Interp* interp, char* name, reg_entry* entry, reg_error* errPtr)
  - Sets a given name to be an entry object
 - void set_sqlite_result(Tcl_Interp* interp, sqlite3* db, const char* query)
  - Reports a sqlite3 error to Tcl
 - int all_objects(Tcl_Interp* interp, sqlite3* db, char* query, char* prefix, set_object_function* setter)
  - Sets the result of the Tcl interpreter to all objects returned by a query
 - const char* string_or_null(Tcl_Obj* obj)
  - Return the `char *` for a Tcl object, or if it is a string with only NULL, return NULL
 - int recast(void* userdata, cast_function* fn, free_function* del, void*** outv, void** inv, int inc, reg_error* errPtr)
  - 
 - int entry_to_obj(Tcl_Interp* interp, Tcl_Obj** obj, reg_entry* entry, reg_error* errPtr)
  - Return Tcl string for a given entry object
 - int list_entry_to_obj(Tcl_Interp* interp, Tcl_Obj*** objs, reg_entry** entries, int entry_count, reg_error* errPtr)
  - Call entry_to_obj() for an array of entries
 - void free_strings(void* userdata UNUSED, char** strings, int count)
  - Defined in util.h but doesn't actually exist
 - int list_obj_to_string(char*** strings, Tcl_Obj** objv, int objc, reg_error* errPtr)
  - Convert an array of Tcl objects to `char *` array
 - int list_string_to_obj(Tcl_Obj*** objv, char** strings, int objc, reg_error* errPtr)
  - Convert an array of `char *` to Tcl object array


-------8<------8<------8<------8<------8<------8<------8<------8<--------

* The IP shown here might not mean anything if the user or the server is
behind a proxy.

--
MacPorts <http://www.macports.org/>
Ports system for Mac OS

This is an automated message. Someone at http://www.macports.org/ added your email
address to be notified of changes on Registry2Notes. If it was not you, please
report to .


More information about the macports-changes mailing list