Changes between Version 3 and Version 4 of Registry2Notes
- Timestamp:
- Apr 5, 2009, 7:04:25 AM (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Registry2Notes
v3 v4 9 9 - Run a command against registry entries (implemented in entry.c) 10 10 - Commands are: 11 - create - entry_create()12 - delete - entry_delete()13 - open - entry_open()14 - close - entry_close()15 - search - entry_search()16 - exists - entry_exists()17 - imaged - entry_imaged()18 - intalled - entry_installed()19 - owner - entry_owner()11 - '''create''' - '''''entry_create'''''() 12 - '''delete''' - '''''entry_delete'''''() 13 - '''open''' - '''''entry_open'''''() 14 - '''close''' - '''''entry_close'''''() 15 - '''search''' - '''''entry_search'''''() 16 - '''exists''' - '''''entry_exists'''''() 17 - '''imaged''' - '''''entry_imaged'''''() 18 - '''intalled''' - '''''entry_installed'''''() 19 - '''owner''' - '''''entry_owner'''''() 20 20 21 21 - `${entry} cmd ?arg ...?` 22 22 - Commands specific to just one registry entry (usually gained from `registry::entry`) (implemented in entryobj.c) 23 23 - Commands are: 24 - name - entry_obj_prop()25 - portfile - entry_obj_prop()26 - url - entry_obj_prop()27 - location - entry_obj_prop()28 - epoch - entry_obj_prop()29 - version - entry_obj_prop()30 - revision - entry_obj_prop()31 - variants - entry_obj_prop()32 - default_variants - entry_obj_prop()33 - date - entry_obj_prop()34 - state - entry_obj_prop()35 - installtype - entry_obj_prop()36 - map - entry_obj_filemap()37 - unmap - entry_obj_filemap()38 - files - entry_obj_files()39 - imagefiles - entry_obj_imagefiles()40 - activate - entry_obj_activate()41 - deactivate - entry_obj_filemap()42 - dependents - entry_obj_dependents()43 - dependencies - entry_obj_dependencies()44 - depends - entry_obj_depends()24 - '''name''' - '''''entry_obj_prop'''''() 25 - '''portfile''' - '''''entry_obj_prop'''''() 26 - '''url''' - '''''entry_obj_prop'''''() 27 - '''location''' - '''''entry_obj_prop'''''() 28 - '''epoch''' - '''''entry_obj_prop'''''() 29 - '''version''' - '''''entry_obj_prop'''''() 30 - '''revision''' - '''''entry_obj_prop'''''() 31 - '''variants''' - '''''entry_obj_prop'''''() 32 - '''default_variants''' - '''''entry_obj_prop'''''() 33 - '''date''' - '''''entry_obj_prop'''''() 34 - '''state''' - '''''entry_obj_prop'''''() 35 - '''installtype''' - '''''entry_obj_prop'''''() 36 - '''map''' - '''''entry_obj_filemap'''''() 37 - '''unmap''' - '''''entry_obj_filemap'''''() 38 - '''files''' - '''''entry_obj_files'''''() 39 - '''imagefiles''' - '''''entry_obj_imagefiles'''''() 40 - '''activate''' - '''''entry_obj_activate'''''() 41 - '''deactivate''' - '''''entry_obj_filemap'''''() 42 - '''dependents''' - '''''entry_obj_dependents'''''() 43 - '''dependencies''' - '''''entry_obj_dependencies'''''() 44 - '''depends''' - '''''entry_obj_depends'''''() 45 45 46 46 - `item cmd ?arg ...?` 47 47 - Implemented in item.c 48 48 - Commands are: 49 - create - item_create()50 - search - item_search()51 - exists - item_exists()52 - 49 - '''create''' - '''''item_create'''''() 50 - '''search''' - '''''item_search'''''() 51 - '''exists''' - '''''item_exists'''''() 52 - others are commented-out (retain, release, name, url, path, worker, options, and variants) 53 53 54 54 - `${item} cmd ?arg ...?` 55 55 - Implemented in itemobj.c 56 56 - Commands are: 57 - retain - item_obj_retain()58 - release - item_obj_release()59 - key - item_obj_key()57 - '''retain''' - '''''item_obj_retain'''''() 58 - '''release''' - '''''item_obj_release'''''() 59 - '''key''' - '''''item_obj_key'''''() 60 60 61 61 - Top-level registry commands (implemented in registry.c): 62 - registry::open - registry_open()63 - registry::close - registry_close()64 - registry::read - registry_read()65 - registry::write - registry_write()66 - registry::entry - entry_cmd()62 - '''registry::open''' - '''''registry_open'''''() 63 - '''registry::close''' - '''''registry_close'''''() 64 - '''registry::read''' - '''''registry_read'''''() 65 - '''registry::write''' - '''''registry_write'''''() 66 - '''registry::entry''' - '''''entry_cmd'''''() 67 67 68 68 === C code files === #reg20_c_code 69 69 ==== entry.[ch] ==== #reg20_entry_c 70 - void delete_entry(ClientData clientData)70 - void '''''delete_entry'''''(ClientData clientData) 71 71 - to be used as the 'Tcl_CmdDeleteProc' for an entry object 72 - int entry_cmd(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])72 - int '''''entry_cmd'''''(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) 73 73 - implements "registry::entry cmd ?arg ...?" 74 74 75 75 ==== entryobj.[ch] ==== #reg20_entryobj_c 76 - int entry_obj_cmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])76 - int '''''entry_obj_cmd'''''(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) 77 77 - implements "${entry} cmd ?arg ...?" (procs for entry objects from "registry::entry") 78 78 … … 82 82 83 83 ==== item.[ch] ==== #reg20_item_c 84 - int item_cmd(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])84 - int '''''item_cmd'''''(ClientData clientData UNUSED, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) 85 85 - implements "item cmd ?arg ...?" 86 86 87 87 ==== itemobj.[ch] ==== #reg20_itemobj_c 88 - int item_obj_cmd(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[])88 - int '''''item_obj_cmd'''''(ClientData clientData, Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[]) 89 89 - implements "${item} cmd ?arg ...?" (procs for item objects from "item" 90 90 91 91 ==== registry.[ch] ==== #reg20_registry_c 92 - reg_registry* registry_for(Tcl_Interp* interp, int status)92 - reg_registry* '''''registry_for'''''(Tcl_Interp* interp, int status) 93 93 - Get the appropriate registry for the given Tcl interpreter 94 - int registry_failed(Tcl_Interp* interp, reg_error* errPtr)94 - int '''''registry_failed'''''(Tcl_Interp* interp, reg_error* errPtr) 95 95 - Sets a Tcl object result based on errPtr 96 - int Registry_Init(Tcl_Interp* interp)96 - int '''''Registry_Init'''''(Tcl_Interp* interp) 97 97 98 98 ==== util.[ch] ==== #reg20_util_c 99 - char* unique_name(Tcl_Interp* interp, char* prefix)99 - char* '''''unique_name'''''(Tcl_Interp* interp, char* prefix) 100 100 - Generate a unique proc name starting with the given prefix (eg, ''<prefix>123'', ''<prefix>124'', etc) 101 - int parse_flags(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[], int* start, option_spec options[], int* flags)101 - int '''''parse_flags'''''(Tcl_Interp* interp, int objc, Tcl_Obj* CONST objv[], int* start, option_spec options[], int* flags) 102 102 - Handle flags ('''-flag''') in Tcl command strings 103 - void* get_object(Tcl_Interp* interp, char* name, char* type, Tcl_ObjCmdProc* proc, reg_error* errPtr)103 - void* '''''get_object'''''(Tcl_Interp* interp, char* name, char* type, Tcl_ObjCmdProc* proc, reg_error* errPtr) 104 104 - Retrieves the object whose proc is named by the given name 105 - int set_object(Tcl_Interp* interp, char* name, void* value, char* type, Tcl_ObjCmdProc* proc, Tcl_CmdDeleteProc* deleteProc, reg_error* errPtr)105 - int '''''set_object'''''(Tcl_Interp* interp, char* name, void* value, char* type, Tcl_ObjCmdProc* proc, Tcl_CmdDeleteProc* deleteProc, reg_error* errPtr) 106 106 - Sets the object whose proc is named by the given name 107 - int set_entry(Tcl_Interp* interp, char* name, reg_entry* entry, reg_error* errPtr)107 - int '''''set_entry'''''(Tcl_Interp* interp, char* name, reg_entry* entry, reg_error* errPtr) 108 108 - Sets a given name to be an entry object 109 - void set_sqlite_result(Tcl_Interp* interp, sqlite3* db, const char* query)109 - void '''''set_sqlite_result'''''(Tcl_Interp* interp, sqlite3* db, const char* query) 110 110 - Reports a sqlite3 error to Tcl 111 - int all_objects(Tcl_Interp* interp, sqlite3* db, char* query, char* prefix, set_object_function* setter)111 - int '''''all_objects'''''(Tcl_Interp* interp, sqlite3* db, char* query, char* prefix, set_object_function* setter) 112 112 - Sets the result of the Tcl interpreter to all objects returned by a query 113 - const char* string_or_null(Tcl_Obj* obj)113 - const char* '''''string_or_null'''''(Tcl_Obj* obj) 114 114 - Return the `char *` for a Tcl object, or if it is a string with only NULL, return NULL 115 - int recast(void* userdata, cast_function* fn, free_function* del, void*** outv, void** inv, int inc, reg_error* errPtr)115 - int '''''recast'''''(void* userdata, cast_function* fn, free_function* del, void*** outv, void** inv, int inc, reg_error* errPtr) 116 116 - 117 - int entry_to_obj(Tcl_Interp* interp, Tcl_Obj** obj, reg_entry* entry, reg_error* errPtr)117 - int '''''entry_to_obj'''''(Tcl_Interp* interp, Tcl_Obj** obj, reg_entry* entry, reg_error* errPtr) 118 118 - Return Tcl string for a given entry object 119 - int list_entry_to_obj(Tcl_Interp* interp, Tcl_Obj*** objs, reg_entry** entries, int entry_count, reg_error* errPtr)119 - int '''''list_entry_to_obj'''''(Tcl_Interp* interp, Tcl_Obj*** objs, reg_entry** entries, int entry_count, reg_error* errPtr) 120 120 - Call entry_to_obj() for an array of entries 121 - void free_strings(void* userdata UNUSED, char** strings, int count)121 - void '''''free_strings'''''(void* userdata UNUSED, char** strings, int count) 122 122 - Defined in util.h but doesn't actually exist 123 - int list_obj_to_string(char*** strings, Tcl_Obj** objv, int objc, reg_error* errPtr)123 - int '''''list_obj_to_string'''''(char*** strings, Tcl_Obj** objv, int objc, reg_error* errPtr) 124 124 - Convert an array of Tcl objects to `char *` array 125 - int list_string_to_obj(Tcl_Obj*** objv, char** strings, int objc, reg_error* errPtr)125 - int '''''list_string_to_obj'''''(Tcl_Obj*** objv, char** strings, int objc, reg_error* errPtr) 126 126 - Convert an array of `char *` to Tcl object array 127 127 … … 133 133 === C code files === #creg_c_code 134 134 ==== entry.[ch] ==== #creg_entry_c 135 - reg_entry* '''''reg_entry_create'''''(reg_registry* reg, char* name, char* version, char* revision, char* variants, char* epoch, reg_error* errPtr) 136 - Creates a new entry in the ports registry 137 - reg_entry* '''''reg_entry_open'''''(reg_registry* reg, char* name, char* version, char* revision, char* variants, char* epoch, reg_error* errPtr) 138 - Opens an existing entry in the registry 139 - int '''''reg_entry_delete'''''(reg_entry* entry, reg_error* errPtr) 140 - Deletes an entry. After calling this, `reg_entry_free` needs to be called manually on the entry. Care should be taken to not free the entry if this deletion is rolled back 141 - void '''''reg_entry_free'''''(reg_entry* entry) 142 - Frees an entry 143 - int '''''reg_entry_search'''''(reg_registry* reg, char** keys, char** vals, int key_count, int strategy, reg_entry*** entries, reg_error* errPtr) 144 - Searches the registry for ports for which each key's value is equal to the given value. To find all ports, pass a key_count of 0 145 - int '''''reg_entry_imaged'''''(reg_registry* reg, const char* name, const char* version, const char* revision, const char* variants, reg_entry*** entries, reg_error* errPtr) 146 - Finds ports which are installed as an image, and/or those which are active in the filesystem. When the install mode is 'direct', this will be equivalent to `reg_entry_installed` 147 - int '''''reg_entry_installed'''''(reg_registry* reg, char* name, reg_entry*** entries, reg_error* errPtr) 148 - Finds ports which are active in the filesystem. These ports are able to meet dependencies, and properly own the files they map. 149 - int '''''reg_entry_owner'''''(reg_registry* reg, char* path, reg_entry** entry, reg_error* errPtr) 150 - Finds the owner of a given file. Only ports active in the filesystem will be returned 151 - int '''''reg_entry_propget'''''(reg_entry* entry, char* key, char** value, reg_error* errPtr) 152 - Gets a named property of an entry 153 - int '''''reg_entry_propset'''''(reg_entry* entry, char* key, char* value, reg_error* errPtr) 154 - Sets a named property of an entry 155 - int '''''reg_entry_map'''''(reg_entry* entry, char** files, int file_count, reg_error* errPtr) 156 - Maps files to the given port in the filemap. The list of files must not contain files that are already mapped to the given port 157 - int '''''reg_entry_unmap'''''(reg_entry* entry, char** files, int file_count, reg_error* errPtr) 158 - Unaps files from the given port in the filemap. The files must be owned by the given entry 159 - int '''''reg_entry_files'''''(reg_entry* entry, char*** files, reg_error* errPtr) 160 - Gets a list of files owned by the given port. These files are active in the filesystem and could be different from the port's imagefiles 161 - int '''''reg_entry_imagefiles'''''(reg_entry* entry, char*** files, reg_error* errPtr) 162 - Gets a list of files provided by the given port. These files are in the port image and do not necessarily correspond to active files on the filesystem 163 - int '''''reg_entry_activate'''''(reg_entry* entry, char** files, char** as_files, int file_count, reg_error* errPtr) 164 - Sets an entry's files as being active in the filesystem 165 - int '''''reg_entry_deactivate'''''(reg_entry* entry, char** files, int file_count, reg_error* errPtr) 166 - Deactivates files owned by a given entry 167 - int '''''reg_entry_dependents'''''(reg_entry* entry, reg_entry*** dependents, reg_error* errPtr) 168 - Gets a list of ports that depend on this one 169 - int '''''reg_entry_dependencies'''''(reg_entry* entry, reg_entry*** dependencies, reg_error* errPtr) 170 - Gets a list of ports that this one depends on 171 - int '''''reg_entry_depends'''''(reg_entry* entry, char* name, reg_error* errPtr) 172 - Sets the given port to depend on the named port 173 - int '''''reg_all_open_entries'''''(reg_registry* reg, reg_entry*** entries) 174 - Fetches a list of all open entries 135 175 136 176 ==== registry.[ch] ==== #creg_registry_c