tcladdressbook-commits Mailing List for TclAddressBook (Page 9)
Status: Alpha
Brought to you by:
bdesgraupes
You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(114) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(37) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(70) |
Sep
(3) |
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
|
Feb
|
Mar
(2) |
Apr
(9) |
May
|
Jun
(8) |
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2006 |
Jan
(5) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <bde...@us...> - 2003-12-28 07:50:08
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv4448/Source Modified Files: TclAddressBookUtils.h Log Message: [property type] / [search] for multivalues Index: TclAddressBookUtils.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TclAddressBookUtils.h 16 Dec 2003 07:37:18 -0000 1.7 +++ TclAddressBookUtils.h 28 Dec 2003 07:50:02 -0000 1.8 @@ -53,10 +53,17 @@ CONST84 char * inValue, ABPropertyType inPropType); -CFTypeRef TclAB_MultiValueFromTcl(Tcl_Interp *interp, +CFTypeRef TclAB_MakeValueRefFromTcl(Tcl_Interp *interp, CONST84 char * inValue, ABPropertyType inPropType); +Boolean TclAB_MakeSearchRefFromTcl(Tcl_Interp *interp, + CONST84 char * inValue, + ABPropertyType inPropType, + CFStringRef * outLabel, + CFStringRef * outKey, + CFTypeRef * outValue); + void TclAB_ResultListFromCFArray(Tcl_Interp *interp, Tcl_Obj *resultPtr, CFArrayRef allSubGroups, @@ -88,6 +95,12 @@ int inRecordType); int TclAB_PropertyRemove(Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[], + Tcl_Obj *resultPtr, + int inRecordType); + +int TclAB_PropertyType(Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr, |
|
From: <bde...@us...> - 2003-12-28 07:50:00
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv4423/Source
Modified Files:
TclAddressBookUtils.c
Log Message:
[property type] / [search] for multivalues
Index: TclAddressBookUtils.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- TclAddressBookUtils.c 22 Dec 2003 06:42:10 -0000 1.12
+++ TclAddressBookUtils.c 28 Dec 2003 07:49:56 -0000 1.13
@@ -1,7 +1,7 @@
/*
* File : "TclAddressBookUtils.c"
* Created: 2003-12-05 10:08:03
- * Last modification: 2003-12-22 07:38:03
+ * Last modification: 2003-12-28 07:45:12
* Author: Bernard Desgraupes
* e-mail: <bde...@ea...>
*
@@ -23,6 +23,30 @@
// Global variable for the macRoman Tcl_Encoding token
extern Tcl_Encoding gMacRomanEnc;
+static CONST char *theABPropertyNames[] = {
+ "Array", "Data", "Date", "Dictionary", "Integer", "Real", "String",
+ "MultiArray","MultiData", "MultiDate", "MultiDictionary",
+ "MultiInteger", "MultiReal", "MultiString", (char *) NULL
+};
+
+static ABPropertyType theABPropertyTypes[] = {
+ kABArrayProperty,
+ kABDataProperty,
+ kABDateProperty,
+ kABDictionaryProperty,
+ kABIntegerProperty,
+ kABRealProperty,
+ kABStringProperty,
+ kABMultiArrayProperty,
+ kABMultiDataProperty,
+ kABMultiDateProperty,
+ kABMultiDictionaryProperty,
+ kABMultiIntegerProperty,
+ kABMultiRealProperty,
+ kABMultiStringProperty,
+ NULL
+};
+
/*
*----------------------------------------------------------------------
*
@@ -110,10 +134,9 @@
SInt32 theSInt32;
unsigned int mvCount;
Tcl_DString ds;
- TextEncoding theEncoding = GetApplicationTextEncoding();
- if (CFStringGetCString(inProperty, thePropName, sizeof(thePropName), theEncoding)) {
+ if (CFStringGetCString(inProperty, thePropName, sizeof(thePropName), NULL)) {
if (inRecordType == rec_person) {
thePropType = ABTypeOfProperty(ab, kABPersonRecordType, inProperty);
@@ -128,7 +151,7 @@
case kABStringProperty:
// Get the entry for the string property
- if (CFStringGetCString(theValue, theStr, sizeof(theStr), theEncoding)) {
+ if (CFStringGetCString(theValue, theStr, sizeof(theStr), NULL)) {
TclAB_PutValueInResult(interp, thePropName, theStr, allValues);
}
CFRelease(theValue);
@@ -168,8 +191,8 @@
subValue = ABMultiValueCopyValueAtIndex(multiValue, j);
if (subLabel && subValue) {
localizedStr = ABCopyLocalizedPropertyOrLabel(subLabel);
- if ( CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), theEncoding)
- && CFStringGetCString(subValue, theSubStr, sizeof(theSubStr), theEncoding)) {
+ if ( CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), NULL)
+ && CFStringGetCString(subValue, theSubStr, sizeof(theSubStr), NULL)) {
Tcl_DStringStartSublist(&ds);
Tcl_DStringAppendElement(&ds, theLabelStr);
Tcl_DStringAppendElement(&ds, theSubStr);
@@ -196,7 +219,7 @@
subValue = ABMultiValueCopyValueAtIndex(multiValue, j);
if (subLabel && subValue) {
localizedStr = ABCopyLocalizedPropertyOrLabel(subLabel);
- if (CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), theEncoding)) {
+ if (CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), NULL)) {
Tcl_DStringStartSublist(&ds);
theAbsTime = CFDateGetAbsoluteTime(subValue);
// See comment in kABDateProperty case above
@@ -236,7 +259,7 @@
if (subLabel) {
localizedStr = ABCopyLocalizedPropertyOrLabel(subLabel);
CFRelease(subLabel);
- if (CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), theEncoding)) {
+ if (CFStringGetCString(localizedStr, theLabelStr, sizeof(theLabelStr), NULL)) {
// Get the dict
theDict = ABMultiValueCopyValueAtIndex(multiValue, j);
dictCount = CFDictionaryGetCount(theDict);
@@ -253,8 +276,8 @@
for (k = 0; k < dictCount; k++) {
if (theKeys[k] && theVals[k] ) {
// Make a two items list for each key/value pair
- if (CFStringGetCString(theKeys[k], theStr, sizeof(theStr), theEncoding)
- && CFStringGetCString(theVals[k], theSubStr, sizeof(theSubStr), theEncoding)) {
+ if (CFStringGetCString(theKeys[k], theStr, sizeof(theStr), NULL)
+ && CFStringGetCString(theVals[k], theSubStr, sizeof(theSubStr), NULL)) {
Tcl_DStringStartSublist(&ds);
Tcl_DStringAppendElement(&ds, theStr);
Tcl_DStringAppendElement(&ds, theSubStr);
@@ -355,13 +378,13 @@
TclAB_SetValue(Tcl_Interp *interp, ABRecordRef inRecord, CFStringRef inProperty,
CONST84 char * inValue, ABPropertyType inPropType)
{
- CFStringRef theValueRef = NULL;
+ CFTypeRef theValueRef = NULL;
int result = true;
// Remove the old value of the property
result = ABRecordRemoveValue(inRecord, inProperty);
// Create a CF reference for the new value
- theValueRef = TclAB_MultiValueFromTcl(interp, inValue, inPropType);
+ theValueRef = TclAB_MakeValueRefFromTcl(interp, inValue, inPropType);
if (theValueRef) {
result = ABRecordSetValue(inRecord, inProperty, theValueRef);
CFRelease(theValueRef);
@@ -373,7 +396,7 @@
/*
*----------------------------------------------------------------------
*
- * TclAB_MultiValueFromTcl --
+ * TclAB_MakeValueRefFromTcl --
*
* This function is invoked to build a CF object representing a value or
* multivalue from a Tcl variable or list.
@@ -387,19 +410,18 @@
*/
CFTypeRef
-TclAB_MultiValueFromTcl(Tcl_Interp *interp, CONST84 char * inValue, ABPropertyType inPropType)
+TclAB_MakeValueRefFromTcl(Tcl_Interp *interp, CONST84 char * inValue, ABPropertyType inPropType)
{
CFTypeRef theValue = NULL, subLabel, subValue;
ABMutableMultiValueRef multiValue;
int j, k, listLen, subListLen, length, result = true;
SInt32 theSInt32;
double theDouble;
- TextEncoding theEncoding = GetApplicationTextEncoding();
Tcl_Obj *elemPtr, *subElemPtr, *objPtr, *labelPtr, *dictPtr, *keyPtr, *valuePtr;
switch (inPropType) {
case kABStringProperty:
- theValue = CFStringCreateWithCString(NULL, inValue, theEncoding);
+ theValue = CFStringCreateWithCString(NULL, inValue, kCFStringEncodingUTF8);
return theValue;
@@ -437,7 +459,7 @@
// Make CFStrings out of the Tcl objects
switch (inPropType) {
case kABMultiStringProperty:
- subValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), theEncoding);
+ subValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), kCFStringEncodingUTF8);
break;
case kABMultiDateProperty:
@@ -453,7 +475,7 @@
break;
}
- subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), theEncoding);
+ subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), kCFStringEncodingUTF8);
// Add the value/label pair to the multivalue
if (subValue && subLabel) {
result = ABMultiValueAdd(multiValue, subValue, subLabel, NULL);
@@ -500,8 +522,8 @@
keyPtr = TclLindexList(interp, subElemPtr, Tcl_NewIntObj(0));
valuePtr = TclLindexList(interp, subElemPtr, Tcl_NewIntObj(1));
// Make CFStrings out of the Tcl objects
- theKeys[k] = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(keyPtr, &length), theEncoding);
- theVals[k] = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), theEncoding);
+ theKeys[k] = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(keyPtr, &length), kCFStringEncodingUTF8);
+ theVals[k] = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), kCFStringEncodingUTF8);
Tcl_DecrRefCount(subElemPtr);
Tcl_DecrRefCount(keyPtr);
Tcl_DecrRefCount(valuePtr);
@@ -510,7 +532,7 @@
// Create and populate a CFDictionary with the key/value pairs
theDict = CFDictionaryCreate(NULL, theKeys, theVals, subListLen, NULL, NULL);
if (theDict) {
- subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), theEncoding);
+ subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), kCFStringEncodingUTF8);
if (subLabel) {
result = ABMultiValueAdd(multiValue, theDict, subLabel, NULL);
CFRelease(subLabel);
@@ -637,7 +659,7 @@
int kind;
Boolean result = true;
- groupCFStr = CFStringCreateWithCString(NULL, inGroupUID, GetApplicationTextEncoding());
+ groupCFStr = CFStringCreateWithCString(NULL, inGroupUID, NULL);
// Find the record corresponding to the UID
*outGroupRef = ABCopyRecordForUniqueId(ab, groupCFStr);
CFRelease(groupCFStr);
@@ -698,7 +720,6 @@
CFArrayRef allItems;
int index, length;
ABAddressBookRef ab;
- TextEncoding theEncoding = GetApplicationTextEncoding();
Boolean lookingInGroup = false;
Boolean onlyID = false;
ABRecordRef inGroup;
@@ -789,7 +810,6 @@
char theName[256], theUID[256];
Tcl_Obj * objPtr;
int result, i;
- TextEncoding theEncoding = GetApplicationTextEncoding();
Tcl_ResetResult(interp);
if (!allElements) {
@@ -804,7 +824,7 @@
theGroup = (ABGroupRef) CFArrayGetValueAtIndex(allElements,i);
// Get the unique id for this record
uniqueId = ABRecordCopyUniqueId(theGroup);
- CFStringGetCString(uniqueId, theUID, sizeof(theUID), theEncoding);
+ CFStringGetCString(uniqueId, theUID, sizeof(theUID), NULL);
CFRelease(uniqueId);
if (onlyID) {
@@ -818,7 +838,7 @@
}
if (text) {
- if (CFStringGetCString(text, theName, sizeof(theName), theEncoding)) {
+ if (CFStringGetCString(text, theName, sizeof(theName), NULL)) {
Tcl_Obj * objs[2];
Tcl_DString ds;
@@ -858,7 +878,7 @@
* This function is invoked to process the [addressbook add group] and
* the [addressbook add person] Tcl commands.
* See the user documentation for details on what it does. It is used
- * either to add a new group or person record to the database.
+ * to add either a new group or a new person record to the database.
*
* Syntax:
* addressbook add (group | person) name ?-ingroup groupID?
@@ -887,7 +907,6 @@
int index, length, result;
CONST84 char * inGroupUID;
Boolean addingToGroup = false;
- TextEncoding theEncoding = GetApplicationTextEncoding();
static CONST char *addrecSwitches[] = {
"-ingroup", (char *) NULL
@@ -907,7 +926,7 @@
}
}
- nameRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[3], &length), theEncoding);
+ nameRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[3], &length), kCFStringEncodingUTF8);
if (!nameRef) {
Tcl_AppendStringsToObj(resultPtr, "CFStringCreateWithCString error", (char *) NULL);
return TCL_ERROR;
@@ -969,7 +988,7 @@
} else {
// Retrieve the UID for the newly created record
uniqueId = ABRecordCopyUniqueId(theRecord);
- CFStringGetCString(uniqueId, theUID, sizeof(theUID), theEncoding);
+ CFStringGetCString(uniqueId, theUID, sizeof(theUID), NULL);
CFRelease(uniqueId);
Tcl_AppendStringsToObj(resultPtr, theUID, (char *) NULL);
result = TCL_OK;
@@ -1015,32 +1034,8 @@
CFMutableDictionaryRef theDict;
int index, length, result;
int theInt;
- TextEncoding theEncoding = GetApplicationTextEncoding();
char * propName;
- static CONST char *typeSwitches[] = {
- "Array", "Data", "Date", "Dictionary", "Integer", "Real", "String",
- "MultiArray","MultiData", "MultiDate", "MultiDictionary",
- "MultiInteger", "MultiReal", "MultiString", (char *) NULL
- };
-
- static ABPropertyType propTypes[] = {
- kABArrayProperty,
- kABDataProperty,
- kABDateProperty,
- kABDictionaryProperty,
- kABIntegerProperty,
- kABRealProperty,
- kABStringProperty,
- kABMultiArrayProperty,
- kABMultiDataProperty,
- kABMultiDateProperty,
- kABMultiDictionaryProperty,
- kABMultiIntegerProperty,
- kABMultiRealProperty,
- kABMultiStringProperty
- };
-
Tcl_ResetResult(interp);
if (objc != 6) {
@@ -1051,7 +1046,7 @@
Tcl_IncrRefCount(objv[4]);
propName = Tcl_GetStringFromObj(objv[4], &length);
- if (Tcl_GetIndexFromObj(interp, objv[5], typeSwitches, "type", 0, &index) != TCL_OK) {
+ if (Tcl_GetIndexFromObj(interp, objv[5], theABPropertyNames, "type", 0, &index) != TCL_OK) {
return TCL_ERROR;
}
@@ -1062,8 +1057,8 @@
theDict = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
if (theDict) {
// Store the property/type pair in the CFDictionary
- theKey = CFStringCreateWithCString(NULL, propName, theEncoding);
- theInt = propTypes[index];
+ theKey = CFStringCreateWithCString(NULL, propName, kCFStringEncodingUTF8);
+ theInt = theABPropertyTypes[index];
theValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theInt);
if (theKey && theValue) {
CFDictionaryAddValue(theDict, theKey, theValue);
@@ -1139,7 +1134,7 @@
// Get the record at index i
theProperty = CFArrayGetValueAtIndex(theItems,i);
- if (theProperty && CFStringGetCString(theProperty, theName, sizeof(theName), GetApplicationTextEncoding())) {
+ if (theProperty && CFStringGetCString(theProperty, theName, sizeof(theName), NULL)) {
Tcl_DString ds;
Tcl_DStringInit(&ds);
@@ -1203,7 +1198,7 @@
Tcl_IncrRefCount(objv[4]);
propName = Tcl_GetStringFromObj(objv[4], &length);
- theProp = CFStringCreateWithCString(NULL, propName, GetApplicationTextEncoding());
+ theProp = CFStringCreateWithCString(NULL, propName, kCFStringEncodingUTF8);
if (theProp) {
// Get the address book
@@ -1234,4 +1229,220 @@
}
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclAB_PropertyType --
+ *
+ * This function is invoked to process the [addressbook property type]
+ * Tcl command.
+ * See the user documentation for details on what it does.
+ *
+ * Syntax:
+ * addressbook property type (-groups|-persons) propName
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclAB_PropertyType(
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[], /* Argument values. */
+ Tcl_Obj *resultPtr, /* Pointer to store the result. */
+ int inRecordType)
+{
+ ABAddressBookRef ab;
+ CFStringRef propertyRef;
+ ABPropertyType thePropType;
+ CONST84 char * propName;
+ int index, length;
+
+ Tcl_ResetResult(interp);
+
+ if (objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "type (-groups|-persons) propName");
+ return TCL_ERROR;
+ }
+
+ propName = Tcl_GetStringFromObj(objv[4], &length);
+
+ // Make CFString objects
+ propertyRef = CFStringCreateWithCString(NULL, propName, kCFStringEncodingUTF8);
+
+ // Get the address book
+ ab = ABGetSharedAddressBook();
+
+ // Get the type of the property
+ if (inRecordType == rec_person) {
+ thePropType = ABTypeOfProperty(ab, kABPersonRecordType, propertyRef);
+ } else {
+ thePropType = ABTypeOfProperty(ab, kABGroupRecordType, propertyRef);
+ }
+ CFRelease(propertyRef);
+
+ if (thePropType == kABErrorInProperty) {
+ Tcl_AppendStringsToObj(resultPtr, "Unknown property '", propName,
+ "' for ", inRecordType ? "Person":"Group" , " records", (char *) NULL);
+ return TCL_ERROR;
+ }
+
+ for (index = 0; theABPropertyTypes[index] != NULL; index++) {
+ if (theABPropertyTypes[index] == thePropType) {
+ break;
+ }
+ }
+ if (theABPropertyTypes[index] == NULL) {
+ Tcl_AppendStringsToObj(resultPtr, "Unknown", (char *) NULL);
+ return TCL_ERROR;
+ } else {
+ Tcl_AppendStringsToObj(resultPtr, theABPropertyNames[index], (char *) NULL);
+ }
+
+ return TCL_OK;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclAB_MakeSearchRefFromTcl --
+ *
+ * This function is invoked to build a CF object representing a value to
+ * search from a Tcl variable or list.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ *
+ *----------------------------------------------------------------------
+ */
+
+Boolean
+TclAB_MakeSearchRefFromTcl(Tcl_Interp *interp, CONST84 char * inValue, ABPropertyType inPropType,
+ CFStringRef * outLabel, CFStringRef * outKey, CFTypeRef * outValue)
+{
+ int listLen, subListLen, length, result = true;
+ SInt32 theSInt32;
+ double theDouble;
+ char * theStr;
+ Tcl_Obj *objPtr, *labelPtr, *dictPtr, *keyPtr, *valuePtr;
+
+ *outLabel = NULL;
+ *outKey = NULL;
+
+ switch (inPropType) {
+ case kABStringProperty:
+ case kABDateProperty:
+ case kABIntegerProperty:
+ case kABRealProperty:
+ *outValue = TclAB_MakeValueRefFromTcl(interp, inValue, inPropType);
+ return (*outValue != NULL);
+
+
+ case kABMultiStringProperty:
+ case kABMultiDateProperty:
+ case kABMultiIntegerProperty:
+ case kABMultiRealProperty:
+ // The value string should be a two-elements Tcl list representing a label/value pair
+ objPtr = Tcl_NewStringObj(inValue, strlen(inValue));
+ Tcl_IncrRefCount(objPtr);
+ Tcl_ListObjLength(interp, objPtr, &listLen);
+ // Parse the label/value pair.
+ if (listLen == 2) {
+ // TclLindexList increments the RefCount
+ labelPtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(0));
+ valuePtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(1));
+
+ // Make CFStrings out of the Tcl objects
+ switch (inPropType) {
+ case kABMultiStringProperty:
+ *outValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), kCFStringEncodingUTF8);
+ break;
+
+ case kABMultiDateProperty:
+ theDouble = atof(Tcl_GetStringFromObj(valuePtr, &length));
+ theDouble -= kCFAbsoluteTimeIntervalSince1970;
+ *outValue = CFDateCreate(NULL, theDouble);
+ break;
+
+ case kABMultiIntegerProperty:
+ case kABMultiRealProperty:
+ theSInt32 = atoi(Tcl_GetStringFromObj(valuePtr, &length));
+ *outValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theSInt32);
+ break;
+
+ }
+ theStr = Tcl_GetStringFromObj(labelPtr, &length);
+ if (length) {
+ *outLabel = CFStringCreateWithCString(NULL, theStr, kCFStringEncodingUTF8);
+ }
+ Tcl_DecrRefCount(labelPtr);
+ Tcl_DecrRefCount(valuePtr);
+ Tcl_DecrRefCount(objPtr);
+ return true;
+ } else {
+ // Malformed value
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Malformed value. Should be: {label value}", (char *) NULL);
+ return false;
+ }
+
+
+ case kABDictionaryProperty:
+ case kABMultiDictionaryProperty:
+ // The value string should be a two-elements Tcl list representing a label/dictionary pair
+ objPtr = Tcl_NewStringObj(inValue, strlen(inValue));
+ Tcl_IncrRefCount(objPtr);
+ Tcl_ListObjLength(interp, objPtr, &listLen);
+ // Parse the label/dictionary pair.
+ if (listLen == 2) {
+ // The dictionary itself should be a two-elements Tcl list
+ // representing a single key/value pair.
+ labelPtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(0));
+ dictPtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(1));
+ Tcl_ListObjLength(interp, dictPtr, &subListLen);
+ if (subListLen == 2) {
+ keyPtr = TclLindexList(interp, dictPtr, Tcl_NewIntObj(0));
+ valuePtr = TclLindexList(interp, dictPtr, Tcl_NewIntObj(1));
+ // Make CFStrings out of the Tcl objects
+ *outValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), kCFStringEncodingUTF8);
+ theStr = Tcl_GetStringFromObj(keyPtr, &length);
+ if (length) {
+ *outKey = CFStringCreateWithCString(NULL, theStr, kCFStringEncodingUTF8);
+ }
+ Tcl_DecrRefCount(keyPtr);
+ Tcl_DecrRefCount(valuePtr);
+ } else {
+ // Malformed value
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Malformed inner list. Should be: {key value}", (char *) NULL);
+ return false;
+ }
+ theStr = Tcl_GetStringFromObj(labelPtr, &length);
+ if (length) {
+ *outLabel = CFStringCreateWithCString(NULL, theStr, kCFStringEncodingUTF8);
+ }
+ Tcl_DecrRefCount(labelPtr);
+ Tcl_DecrRefCount(dictPtr);
+ Tcl_DecrRefCount(objPtr);
+ return true;
+ } else {
+ // Malformed value
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Malformed outer list. Should be: {label {key value}}", (char *) NULL);
+ return false;
+ }
+
+
+ case kABErrorInProperty:
+ default:
+ return false;
+ }
+}
+
|
|
From: <bde...@us...> - 2003-12-28 07:48:49
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv4271/Source Modified Files: TclAddressBook_version.h Log Message: Upped to 1.12 Index: TclAddressBook_version.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_version.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TclAddressBook_version.h 13 Dec 2003 17:30:58 -0000 1.5 +++ TclAddressBook_version.h 28 Dec 2003 07:48:46 -0000 1.6 @@ -1,12 +1,12 @@ // File: "TclAddressBook_version.h" // Created: 2003-09-24 07:28:22 -// Last modification: 2003-12-13 17:59:37 +// Last modification: 2003-12-16 11:34:35 // Author: Bernard Desgraupes // Description: version numbering for Tcladdressbook #define TCLADDRESSBOOK_MAJOR 1 #define TCLADDRESSBOOK_MINOR 0 -#define TCLADDRESSBOOK_SUBMINOR 10 +#define TCLADDRESSBOOK_SUBMINOR 12 #define TCLADDRESSBOOK_STAGE 'd' // 'd' for developStage // 'a' for alphaStage |
|
From: <bde...@us...> - 2003-12-28 07:48:25
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv4243/Help Modified Files: TclAddressBookHelp.html Log Message: [property type] and [search] doc Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TclAddressBookHelp.html 21 Dec 2003 14:36:03 -0000 1.10 +++ TclAddressBookHelp.html 28 Dec 2003 07:48:21 -0000 1.11 @@ -6,7 +6,7 @@ <BODY> <!-- :Title: TcladdressbookHelp --> <!-- :Project: addressbook extension for Tcl --><P><!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> -<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --><P><!-- :Modified: 2003-12-16 11:47:35 --><P><!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> +<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --><P><!-- :Modified: 2003-12-28 06:48:08 --><P><!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> <P> <A href="TclAB.html"> Home Page</A> | <A href="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This is a manual page for the Tcladdressbook extension for Tcl. This @@ -29,21 +29,22 @@ <UL><UL><LI><A HREF="#M14">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> <UL><UL><LI><A HREF="#M15">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M16">addressbook property names (-groups | -persons)</A></UL></UL> -<UL><UL><LI><A HREF="#M17">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> -<UL><UL><LI><A HREF="#M18">addressbook property remove (-groups | -persons) <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M19">addressbook record <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M20">addressbook save</A></UL></UL> -<UL><UL><LI><A HREF="#M21">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> -<UL><UL><LI><A HREF="#M22">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M23">addressbook type <I>recordID</I></A></UL></UL> -<LI><A HREF="#M24">INSTALLATION</A> -<LI><A HREF="#M25">VERSION HISTORY</A> -<LI><A HREF="#M26">REQUIREMENTS AND PORTABILITY</A> -<LI><A HREF="#M27">KNOW ISSUES</A> -<LI><A HREF="#M28">LICENSE AND DISCLAIMER</A> -<LI><A HREF="#M29">SOURCE CODE</A> -<LI><A HREF="#M30">SEE ALSO</A> -<LI><A HREF="#M31">KEYWORDS</A> +<UL><UL><LI><A HREF="#M17">addressbook property type (-groups | -persons) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M18">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> +<UL><UL><LI><A HREF="#M19">addressbook property remove (-groups | -persons) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M20">addressbook record <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M21">addressbook save</A></UL></UL> +<UL><UL><LI><A HREF="#M22">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> +<UL><UL><LI><A HREF="#M23">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M24">addressbook type <I>recordID</I></A></UL></UL> +<LI><A HREF="#M25">INSTALLATION</A> +<LI><A HREF="#M26">VERSION HISTORY</A> +<LI><A HREF="#M27">REQUIREMENTS AND PORTABILITY</A> +<LI><A HREF="#M28">KNOW ISSUES</A> +<LI><A HREF="#M29">LICENSE AND DISCLAIMER</A> +<LI><A HREF="#M30">SOURCE CODE</A> +<LI><A HREF="#M31">SEE ALSO</A> +<LI><A HREF="#M32">KEYWORDS</A> </UL><P><P><H2><A NAME="M1"></A> NAME</H2> addressbook - manipulate the Macintosh OSX Address Book database<P><H2><A NAME="M2"></A> SYNOPSIS</H2> <PRE> @@ -109,7 +110,11 @@ will be returned.<P><H4><A NAME="M16"></A> addressbook property names (-groups | -persons)</H4> This command returns a list of all the properties defined in the database for group or person records. New properties can be created or removed with -the <B>addressbook property add</B> and <B>addressbook property remove</B> commands.<P><H4><A NAME="M17"></A> addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> +the <B>addressbook property add</B> and <B>addressbook property remove</B> commands.<P><H4><A NAME="M17"></A> addressbook property type (-groups | -persons) <I>propName</I></H4> +This command returns the type of the property specified by the +<I>propName</I> argument. The returned type is one of the values +listed with the <B>addressbook property add</B> command below +or <I>Unknown</I>. <P><H4><A NAME="M18"></A> addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the <I>propName</I> argument: it must be unique. One can get the list of all the @@ -117,11 +122,11 @@ The type of the property is specified by the <I>propType</I> argument. This argument can have one of the following values: <I>Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, -MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M18"></A> addressbook property remove (-groups | -persons) <I>propName</I></H4> +MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M19"></A> addressbook property remove (-groups | -persons) <I>propName</I></H4> This command lets you remove a property from the database, either for person or for group records. The name of the property is specified in the <I>propName</I> argument. One can get the list of all the existing -properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M19"></A> addressbook record <I>recordID</I></H4> +properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M20"></A> addressbook record <I>recordID</I></H4> This command returns all the data available in the database concerning the record with unique ID <I>recordID</I>. The returned value takes the form of a keyed list: see the <B>addressbook record</B> command @@ -151,19 +156,17 @@ 00:00:00 CET 1970". <P> Note that keyed lists can be very easily manipulated with the <B>keylget</B> and <B>keylset</B> commands defined in the TclX -extension. One can also use the usual Tcl commands concerning lists.<P><H4><A NAME="M20"></A> addressbook save</H4> +extension. One can also use the usual Tcl commands concerning lists.<P><H4><A NAME="M21"></A> addressbook save</H4> This command lets you save the changes made in the database. Commands such as <B>addressbook set</B>, <B>addressbook create</B> or <B>addressbook delete</B> modify the data in memory: to make the changes definitive in the database, one must call explicitely the <B>addressbook save</B> command. To check whether there has been changes in the database, use the -<B>addressbook changed</B> command.<P><H4><A NAME="M21"></A> addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> +<B>addressbook changed</B> command.<P><H4><A NAME="M22"></A> addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> This command returns all the records corresponding to the criterion described by the last three arguments: <UL> - <LI> <I>property</I> is the name of the property whose value will be -compared to the <I>value</I> argument - <LI> <I>op</I> is an operator specifying the type of comparison. It can be + <LI> <I>property</I> is the name of the property you are searching on. <P> <LI> <I>op</I> is an operator specifying the type of comparison. It can be one of the following symbols: <PRE> ==, !=, <, <=, >, >=, ^= @@ -191,22 +194,38 @@ >= Contains Substring ^= Prefix Match </PRE> -The <TT><</TT> and <TT><=</TT> operators are not applicable and will both default to Equal.<P></UL><P> <LI> <I>value</I> is the value property you are searching<P></UL> -<P> The <I>-groups</I> or <I>-persons</I> arguments let you specify the +The <TT><</TT> and <TT><=</TT> operators are not applicable and will both default to Equal.<P></UL><P> <LI> <I>value</I> is the value you are searching for. In the case of +a simple property, <I>value</I> will be a simple string. In the case of a +MultiString, MultiInteger or MultiDate property, <I>value</I> will be a +two-elements list representing a label/value pair. In the case of a +MultiDictionary property, <I> value </I> will be a two-elements list +representing a label/dictionary pair, the dictionary itself being a +two-elements list representing a single key/value pair. For instance: +<PRE> + {Phone "01 02 03 04 05"} + {Home {City Paris}} +</PRE> +<P> One can specify an empty string for the label in order to perform the +search over all the possible labels. One can also specify an empty string for +the key in order to perform the search over all the possible keys in a dictionary. <P></UL> +<P> The <I>-groups</I> or <I>-persons</I> options let you specify the kind of records you want to search. If it is not specified, the default is <I>-person</I>. If the <I>-ids</I> option is specified, only IDs of the matching records are returned, rather than pairs made of the ID and the name. The <I>-nocase</I> argument concerns string comparisons and requires -that no distinction be made between uppercase and lowercase letters.<P><H4><A NAME="M22"></A> addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> +that no distinction be made between uppercase and lowercase letters. +<P> To get a list of all possible properties, use the <B>addressbook +property names</B> command. To know the type of a particular property, use +the <B>addressbook property type</B> command.<P><H4><A NAME="M23"></A> addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> This command lets you get or set the value of a particular property for the record with unique ID <I>recordID</I>. If the <I>value</I> argument is not specified, it returns the current value of the property specified in the <I>propertyName</I> argument. If <I>value</I> is specified, the property <I>propertyName</I> will be set to this value. See the <B>addressbook record</B> command for a description of the format used for the -various kinds of properties.<P><H4><A NAME="M23"></A> addressbook type <I>recordID</I></H4> +various kinds of properties.<P><H4><A NAME="M24"></A> addressbook type <I>recordID</I></H4> This command returns the type (ABPerson or ABGroup) of the record with -unique ID <I>recordID</I>.<P><H2><A NAME="M24"></A> INSTALLATION</H2> +unique ID <I>recordID</I>.<P><H2><A NAME="M25"></A> INSTALLATION</H2> The extension is made of two files: the dynamic library (called addressbook1.0.dylib in version 1.0) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are @@ -216,16 +235,16 @@ <B>auto_path</B> Tcl variable. If you use the extension within the AlphaX editor (version 8.0b11 or greater), you can also install it in the <I>Tclextensions</I> folder which is located at the same level as the -application. <P><H2><A NAME="M25"></A> VERSION HISTORY</H2> +application. <P><H2><A NAME="M26"></A> VERSION HISTORY</H2> <UL> - <LI> 1.0 - <P></UL><P><H2><A NAME="M26"></A> REQUIREMENTS AND PORTABILITY</H2> + <LI> 1.0 - - <P></UL><P><H2><A NAME="M27"></A> REQUIREMENTS AND PORTABILITY</H2> This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced -in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M27"></A> KNOW ISSUES</H2> +in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M28"></A> KNOW ISSUES</H2> Please e-mail any bug or problem you encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M28"></A> LICENSE AND DISCLAIMER</H2> +<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M29"></A> LICENSE AND DISCLAIMER</H2> This software is free software and distributed under the same licensing terms -as the Tcl language itself. See license.terms in the Tcl distribution.<P><P> © Copyright Bernard Desgraupes 2003<P><H2><A NAME="M29"></A> SOURCE CODE</H2> +as the Tcl language itself. See license.terms in the Tcl distribution.<P><P> © Copyright Bernard Desgraupes 2003<P><H2><A NAME="M30"></A> SOURCE CODE</H2> Tcladdressbook is an Open Source Project. Its source code is public and can be found on the SourceForge site at the following address: <A HREF="http://sourceforge.net/projects/tcladdressbook">http://sourceforge.net/projects/tcladdressbook</A><P><P> Tcladdressbook binary releases are available at @@ -233,9 +252,10 @@ page at <A HREF="http://webperso.easyconnect.fr/bdesgraupes/tcl.html">http://webperso.easyconnect.fr/bdesgraupes/tcl.html</A><P><P> The code is under CVS control. You can retrieve the latest stage of development using any CVS client. See instructions at: <A HREF="http://sourceforge.net/cvs/?group_id=96169">http://sourceforge.net/cvs/?group_id=96169</A><P><P> You can also browse the cvs repository online at -<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M30"></A> SEE ALSO</H2> -The Mk4Tcl extension.<P><H2><A NAME="M31"></A> KEYWORDS</H2> -Address book, data base<P><HR> -<P> Last updated 2003-12-21 15:32:30<P> +<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M31"></A> SEE ALSO</H2> +See the TclX extension for keyed lists. See the Mk4Tcl extension for +commands to open directly the database file.<P><H2><A NAME="M32"></A> KEYWORDS</H2> +Address book, data base.<P><HR> +<P> Last updated 2003-12-28 07:59:18<P> </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-28 07:48:18
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv4223/Help Modified Files: TclAddressBookHelp.aida Log Message: [property type] and [search] doc Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TclAddressBookHelp.aida 21 Dec 2003 14:35:56 -0000 1.7 +++ TclAddressBookHelp.aida 28 Dec 2003 07:48:14 -0000 1.8 @@ -5,7 +5,7 @@ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> !! !! :Created: 2003-11-26 14:30:03 -:Modified: 2003-12-16 11:47:35 +:Modified: 2003-12-28 06:48:08 !! !! :Keywords: Address book, data base :TclCmd: set currentversion [package require addressbook] @@ -123,6 +123,12 @@ for group or person records. New properties can be created or removed with the ((b addressbook property add b)) and ((b addressbook property remove b)) commands. +((s3 addressbook property type (-groups | -persons) ((i propName i)) +This command returns the type of the property specified by the +((i propName i)) argument. The returned type is one of the values +listed with the ((b addressbook property add b)) command below +or ((i Unknown i)). + ((s3 addressbook property add (-groups | -persons) ((i propName i)) ((i propType i)) This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the @@ -184,8 +190,8 @@ This command returns all the records corresponding to the criterion described by the last three arguments: ((lu -((li ((i property i)) is the name of the property whose value will be -compared to the ((i value i)) argument +((li ((i property i)) is the name of the property you are searching on. + ((li ((i op i)) is an operator specifying the type of comparison. It can be one of the following symbols: ((| @@ -219,15 +225,31 @@ The ((v < v)) and ((v <= v)) operators are not applicable and will both default to Equal. lu)) - -((li ((i value i)) is the value property you are searching +((li ((i value i)) is the value you are searching for. In the case of +a simple property, ((i value i)) will be a simple string. In the case of a +MultiString, MultiInteger or MultiDate property, ((i value i)) will be a +two-elements list representing a label/value pair. In the case of a +MultiDictionary property, ((i value i)) will be a two-elements list +representing a label/dictionary pair, the dictionary itself being a +two-elements list representing a single key/value pair. For instance: +((| + {Phone "01 02 03 04 05"} + {Home {City Paris}} +|)) +((nl One can specify an empty string for the label in order to perform the +search over all the possible labels. One can also specify an empty string for +the key in order to perform the search over all the possible keys in a dictionary. lu)) -((nl The ((i -groups i)) or ((i -persons i)) arguments let you specify the +((nl The ((i -groups i)) or ((i -persons i)) options let you specify the kind of records you want to search. If it is not specified, the default is ((i -person i)). If the ((i -ids i)) option is specified, only IDs of the matching records are returned, rather than pairs made of the ID and the name. The ((i -nocase i)) argument concerns string comparisons and requires that no distinction be made between uppercase and lowercase letters. +((nl To get a list of all possible properties, use the ((b addressbook +property names b)) command. To know the type of a particular property, use +the ((b addressbook property type b)) command. + ((s3 addressbook set ((i recordID propertyName i)) ?((i value i))? This command lets you get or set the value of a particular property for the @@ -258,7 +280,7 @@ ((s1 VERSION HISTORY ((lu -((li 1.0 - +((li 1.0 - - lu)) @@ -298,10 +320,11 @@ ((s1 SEE ALSO -The Mk4Tcl extension. +See the TclX extension for keyed lists. See the Mk4Tcl extension for +commands to open directly the database file. ((s1 KEYWORDS -Address book, data base +Address book, data base. ((- |
|
From: <bde...@us...> - 2003-12-28 07:48:11
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv4191/Help Modified Files: TclAddressBookHelp Log Message: [property type] and [search] doc Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TclAddressBookHelp 16 Dec 2003 07:37:48 -0000 1.8 +++ TclAddressBookHelp 28 Dec 2003 07:48:07 -0000 1.9 @@ -1,44 +1,50 @@ -Title: Tcladdressbook Help +Title: TcladdressbookHelp Project: addressbook extension for Tcl -Modified: 2003-12-16 08:35:45 +Modified: 2003-12-28 06:48:08 +TclCmd: set currentversion [package require addressbook] + +Images/TclAB_logo.gif (TclAB Logo) + Home Page | <http://sourceforge.net/projects/tcladdressbook> Project Page at SourceForge <TclAB.html> Abstract -This is a manual page for the Tcladdressbook extension for Tcl. +This is a manual page for the Tcladdressbook extension for Tcl. This +documents version 1.0d12. -1. NAME -2. SYNOPSIS -3. INTRODUCTION -4. SUBCOMMANDS - addressbook changed - addressbook count (-groups | -persons) ?-ingroup groupID? - addressbook create (group | person) name ?-ingroup groupID? - addressbook delete recordID ?-fromgroup groupID? - addressbook export personID - addressbook getme - addressbook groups ?-ids? ?-ingroup groupID? - addressbook image personID ?imageData? - addressbook import vCardData - addressbook parents ?-ids? recordID - addressbook persons ?-ids? ?-ingroup groupID? - addressbook property names (-groups | -persons) - addressbook property add (-groups | -persons) propName propType - addressbook property remove (-groups | -persons) propName - addressbook record recordID - addressbook save - addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value - addressbook set recordID propertyName ?value? - addressbook type recordID -5. INSTALLATION -6. VERSION HISTORY -7. REQUIREMENTS AND PORTABILITY -8. KNOW ISSUES -9. LICENSE AND DISCLAIMER -10. SOURCE CODE -11. SEE ALSO -12. KEYWORDS + 1. NAME + 2. SYNOPSIS + 3. INTRODUCTION + 4. SUBCOMMANDS + addressbook changed + addressbook count (-groups | -persons) ?-ingroup groupID? + addressbook create (group | person) name ?-ingroup groupID? + addressbook delete recordID ?-fromgroup groupID? + addressbook export personID + addressbook getme + addressbook groups ?-ids? ?-ingroup groupID? + addressbook image personID ?imageData? + addressbook import vCardData + addressbook parents ?-ids? recordID + addressbook persons ?-ids? ?-ingroup groupID? + addressbook property names (-groups | -persons) + addressbook property type (-groups | -persons) propName + addressbook property add (-groups | -persons) propName propType + addressbook property remove (-groups | -persons) propName + addressbook record recordID + addressbook save + addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value + addressbook set recordID propertyName ?value? + addressbook type recordID + 5. INSTALLATION + 6. VERSION HISTORY + 7. REQUIREMENTS AND PORTABILITY + 8. KNOW ISSUES + 9. LICENSE AND DISCLAIMER + 10. SOURCE CODE + 11. SEE ALSO + 12. KEYWORDS =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- @@ -144,6 +150,12 @@ for group or person records. New properties can be created or removed with the addressbook property add and addressbook property remove commands. + addressbook property type (-groups | -persons) propName +This command returns the type of the property specified by the +propName argument. The returned type is one of the values +listed with the addressbook property add command below +or Unknown. + addressbook property add (-groups | -persons) propName propType This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the @@ -205,8 +217,8 @@ This command returns all the records corresponding to the criterion described by the last three arguments: - property is the name of the property whose value will be -compared to the value argument + property is the name of the property you are searching on. + op is an operator specifying the type of comparison. It can be one of the following symbols: @@ -240,15 +252,31 @@ The < and <= operators are not applicable and will both default to Equal. + value is the value you are searching for. In the case of +a simple property, value will be a simple string. In the case of a +MultiString, MultiInteger or MultiDate property, value will be a +two-elements list representing a label/value pair. In the case of a +MultiDictionary property, value will be a two-elements list +representing a label/dictionary pair, the dictionary itself being a +two-elements list representing a single key/value pair. For instance: - value is the value property you are searching + {Phone "01 02 03 04 05"} + {Home {City Paris}} - The -groups or -persons arguments let you specify the + One can specify an empty string for the label in order to perform the +search over all the possible labels. One can also specify an empty string for +the key in order to perform the search over all the possible keys in a dictionary. + + The -groups or -persons options let you specify the kind of records you want to search. If it is not specified, the default is -person. If the -ids option is specified, only IDs of the matching records are returned, rather than pairs made of the ID and the name. The -nocase argument concerns string comparisons and requires that no distinction be made between uppercase and lowercase letters. + To get a list of all possible properties, use the addressbook +property names command. To know the type of a particular property, use +the addressbook property type command. + addressbook set recordID propertyName ?value? This command lets you get or set the value of a particular property for the @@ -279,7 +307,7 @@ 6. VERSION HISTORY - 1.0 - + 1.0 - - @@ -319,13 +347,15 @@ 11. SEE ALSO -The Mk4Tcl extension. +See the TclX extension for keyed lists. See the Mk4Tcl extension for +commands to open directly the database file. 12. KEYWORDS -Address book, data base - +Address book, data base. +---------------------------------------------------------------------- + Last updated 2003-12-28 08:01:30 |
|
From: <bde...@us...> - 2003-12-28 07:47:27
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv4106/Help Modified Files: TclAB_QuickStart.tcl Log Message: [search] examples Index: TclAB_QuickStart.tcl =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.tcl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TclAB_QuickStart.tcl 9 Dec 2003 09:09:35 -0000 1.2 +++ TclAB_QuickStart.tcl 28 Dec 2003 07:47:23 -0000 1.3 @@ -6,7 +6,7 @@ # Author: Bernard Desgraupes # e-mail: <bde...@ea...> # Web page of the Tcladdressbook extension: -# http://sourceforge.net/project/showfiles.php?group_id=96169 +# <http://sourceforge.net/projects/tcladdressbook> # # $Date$ # $Revision$ @@ -14,84 +14,281 @@ # Load the extension -package require addressbook - -# Count the existing groups and person records -addressbook count -groups -addressbook count -persons + package require addressbook +# Using the commands +# The [groups] command # List the groups (name and ID) -addressbook groups + + addressbook groups + # List the groups (only ID) -addressbook groups -ids + + addressbook groups -ids + +# List the subgroups of a specific group (name and ID) + + set groupid [lindex [addressbook groups -ids] 2] + addressbook groups -ingroup $groupid + +# List the subgroups of a specific group (only ID) + + addressbook groups -ids -ingroup $groupid + +# The [persons] command # List the person records (name and ID) -addressbook persons + + addressbook persons + # List the person records (only ID) -addressbook persons -ids + addressbook persons -ids -# Store the info about "me" in the array arr and display the results -# with the [parray] command -addressbook getme arr -parray arr -# Put the ID of the first record in the variable theid -set theid [lindex [addressbook persons -ids] 0] -# Store the info about this record in the array arrperson and display the -# results with the [parray] command -addressbook record $theid arrperson -parray arrperson +# The [count] command +# Count the existing groups and person records -# Put the ID of the first group in the variable theid -set theid [lindex [addressbook groups -ids] 0] -# Store the info about this group in the array arrgrp and display the -# results with the [parray] command -addressbook record $theid arrgrp -parray arrgrp + addressbook count -groups + addressbook count -persons + addressbook count -persons -ingroup [lindex [addressbook groups -ids] 0] -# Find the type of the object corresponding to the ID $theid (ABPerson or ABGroup) -addressbook type $theid + +# The [getme] command +# Store the info about "me" in the variable myrecord. + + set myrecord [addressbook getme] + +# The value of myrecord is a keyed list. One can use the usual Tcl list +# commands or the special keylist commands defined in the TclX extension +# like this: + + keylkeys myrecord + keylget myrecord Email.work + keylget myrecord Address.home.ZIP + clock format [keylget myrecord Birthday] + +# The [record] command +# Store the ID of the first record in the variable theid + + set theid [lindex [addressbook persons -ids] 0] + +# Store the info about this record in the variable "person". The syntax is +# the same as with the [getme] command. + + set person [addressbook record $theid] + keylkeys person + keylget person Email.work + keylget person Address.home.ZIP + clock format [keylget person Birthday] + + + +# Store the ID of the first group in the variable theid + + set theid [lindex [addressbook groups -ids] 0] + +# Store the info about this group in the variable grp + + set grp [addressbook record $theid] + keylkeys grp + keylget grp GroupName + clock format [keylget grp Modification] + + + +# The [type] command +# Find the type (ABPerson or ABGroup) of the object corresponding +# to the ID $theid + + addressbook type $theid + + + +# The [property names] command # Get the list of all existing properties for groups or persons -addressbook properties -groups -addressbook properties -persons + + addressbook property names -groups + addressbook property names -persons + +# The [remove] command # Remove the record corresponding to the ID $theid from the database -addressbook remove $theid + + addressbook delete $theid + # Check that there were changes (1 if yes, 0 if no) -addressbook changed + + addressbook changed + # Save the changes to make them permanent -addressbook save + + addressbook save # Remove the record corresponding to the ID $theid from a specific group: # it is removed as member of this subgroup but will be removed from the # database only if it does not belong to other groups. -set groupid [lindex [addressbook groups -ids] 0] -set theid [lindex [addressbook persons -ids] 0] -addressbook remove $theid -fromgroup $groupid + set groupid [lindex [addressbook groups -ids] 0] + set theid [lindex [addressbook persons -ids] 0] + addressbook delete $theid -fromgroup $groupid -# List the subgroups of a specific group (name and ID) -set theid [lindex [addressbook groups -ids] 2] -addressbook groups $theid -ingroup $groupid -# List the subgroups of a specific group (only ID) -addressbook groups $theid -ingroup $groupid -ids +# The [parents] command # List the parents of a person record (the various groups it belongs to). # One can also find the parents of a group with this command. -set theid [lindex [addressbook persons -ids] 0] -addressbook parents $theid + + set theid [lindex [addressbook persons -ids] 0] + addressbook parents $theid + # List the parents of a person record (only ID) -addressbook parents $theid -ids + + addressbook parents -ids $theid + + + +# The [create] command + (group|person) + +# The [property type] command +# Get the name of a particular property + + addressbook property type -groups UID + addressbook property type -persons Address + + +# The [property add] command +# Add a new property of type String called Instrument + + addressbook property add -persons Instrument String + + +# Add a new property of type Date called Meeting + + addressbook property add -groups Meeting Date + + +# The [property remove] command +# Remove the properties created above + + addressbook property remove -persons Instrument + addressbook property remove -groups Meeting + + + +# The [export] command +# Create a VCard corresponding to a particular record. + + set theid [lindex [addressbook persons -ids] 0] + +# The data returned is binary. You can store it in a file. + + set vcardData [addressbook export $theid] + + + +# The [import] command + + set fname [file join /Users bernardo someVcard.vcf] + set fid [open $fname r] + set vcard [read $fid] + close $fid + addressbook import $vcard + + + +# The [image] command + + set theid [lindex [addressbook persons -ids] 0] + set img [addressbook image $theid] + + + +# The [set] command + + set theid [lindex [addressbook persons -ids] 0] + addressbook set $theid First + + + + addressbook set $theid First Georgios + addressbook changed + addressbook save + + + + addressbook set $theid First Johann-Sebastian + +# Multi string value + addressbook set $theid Email {{Work wo...@ha...} {Concerts DD...@su...}} + addressbook set $theid Email {{Work op...@or...} {Concerts BW...@CA...}} + + +# Date value + addressbook set $theid Birthday [clock scan "1 Apr 1985"] + + +# Multi date value + addressbook set $theid ABDate + addressbook set $theid ABDate [list [list "birthday Franny" 621597600] [list "birthday Zooey" 816692400]] + + + +# Multi dictionary value + addressbook set $theid Address + addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}] ] ] + + + +# The [search] command + + addressbook search -persons -ids -nocase Last == "Bach" + addressbook search -persons -ids -nocase Last > "Ba" + + + + addressbook search -persons -nocase Modification >= 1070199949 + addressbook search -persons -nocase Modification < 1070199949 + + +# Multi string value. It searches one value at a time. + addressbook search -persons Phone == {Work "01 02 03 04 05"} + +# Empty label --> to search on all phones + addressbook search -persons Phone >= {"" "01 02 03 04 05"} + + +# Multi dict value. It searches one key in one dictionary at a time. + addressbook search -persons -nocase Address == {Home {ZIP 98765}} + addressbook search -persons -nocase Address >= {Home {ZIP 98}} + +# Empty label --> to search on all labels + addressbook search -persons -nocase Address >= {"" {City Paris}} + +# Empty key --> to search on all keys + addressbook search -persons -nocase Address >= {home {"" abc}} + +# Empty label and key --> to search on all labels and keys + addressbook search -persons -nocase Address >= {"" {"" abc}} + + + +# Using keyed lists + + package require tclx + + +# ---------------------------------------------------------------------- +# Last updated 2003-12-28 08:36:25 |
|
From: <bde...@us...> - 2003-12-28 07:47:21
|
Update of /cvsroot/tcladdressbook/Help
In directory sc8-pr-cvs1:/tmp/cvs-serv4087/Help
Modified Files:
TclAB_QuickStart.html
Log Message:
[search] examples
Index: TclAB_QuickStart.html
===================================================================
RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TclAB_QuickStart.html 21 Dec 2003 14:35:50 -0000 1.2
+++ TclAB_QuickStart.html 28 Dec 2003 07:47:18 -0000 1.3
@@ -35,14 +35,15 @@
<UL><LI><A HREF="#M9">The [remove] command</A></UL>
<UL><LI><A HREF="#M10">The [parents] command</A></UL>
<UL><LI><A HREF="#M11">The [create] command</A></UL>
-<UL><LI><A HREF="#M12">The [property add] command</A></UL>
-<UL><LI><A HREF="#M13">The [property remove] command</A></UL>
-<UL><LI><A HREF="#M14">The [export] command</A></UL>
-<UL><LI><A HREF="#M15">The [import] command</A></UL>
-<UL><LI><A HREF="#M16">The [image] command</A></UL>
-<UL><LI><A HREF="#M17">The [set] command</A></UL>
-<UL><LI><A HREF="#M18">The [search] command</A></UL>
-<LI><A HREF="#M19">Using keyed lists</A>
+<UL><LI><A HREF="#M12">The [property type] command</A></UL>
+<UL><LI><A HREF="#M13">The [property add] command</A></UL>
+<UL><LI><A HREF="#M14">The [property remove] command</A></UL>
+<UL><LI><A HREF="#M15">The [export] command</A></UL>
+<UL><LI><A HREF="#M16">The [import] command</A></UL>
+<UL><LI><A HREF="#M17">The [image] command</A></UL>
+<UL><LI><A HREF="#M18">The [set] command</A></UL>
+<UL><LI><A HREF="#M19">The [search] command</A></UL>
+<LI><A HREF="#M20">Using keyed lists</A>
</UL><P>Load the extension
<PRE>
package require addressbook
@@ -155,19 +156,24 @@
<PRE>
addressbook parents -ids $theid
</PRE><P><H3><A NAME="M11"></A> The [create] command</H3>
- (group|person)<P><H3><A NAME="M12"></A> The [property add] command</H3>
+ (group|person)<P><H3><A NAME="M12"></A> The [property type] command</H3>
+Get the name of a particular property
+<PRE>
+ addressbook property type -groups UID
+ addressbook property type -persons Address
+</PRE><P><H3><A NAME="M13"></A> The [property add] command</H3>
Add a new property of type String called Instrument
<PRE>
addressbook property add -persons Instrument String
</PRE><P>Add a new property of type Date called Meeting
<PRE>
addressbook property add -groups Meeting Date
-</PRE><P><H3><A NAME="M13"></A> The [property remove] command</H3>
+</PRE><P><H3><A NAME="M14"></A> The [property remove] command</H3>
Remove the properties created above
<PRE>
addressbook property remove -persons Instrument
addressbook property remove -groups Meeting
-</PRE><P><H3><A NAME="M14"></A> The [export] command</H3>
+</PRE><P><H3><A NAME="M15"></A> The [export] command</H3>
Create a VCard corresponding to a particular record.
<PRE>
set theid [lindex [addressbook persons -ids] 0]
@@ -175,40 +181,77 @@
The data returned is binary. You can store it in a file.
<PRE>
set vcardData [addressbook export $theid]
-</PRE><P><H3><A NAME="M15"></A> The [import] command</H3>
+</PRE><P><H3><A NAME="M16"></A> The [import] command</H3>
<PRE>
set fname [file join /Users bernardo someVcard.vcf]
set fid [open $fname r]
set vcard [read $fid]
close $fid
addressbook import $vcard
-</PRE><P><H3><A NAME="M16"></A> The [image] command</H3>
+</PRE><P><H3><A NAME="M17"></A> The [image] command</H3>
<PRE>
set theid [lindex [addressbook persons -ids] 0]
set img [addressbook image $theid]
-</PRE><P><H3><A NAME="M17"></A> The [set] command</H3>
-set theid [lindex [addressbook persons -ids] 0]
-addressbook set $theid First<P>addressbook set $theid First Georgios
-addressbook changed
-addressbook save<P>addressbook set $theid First Jean-Sebastien
-<!-- multi string value -->
-addressbook set $theid Email {{Travail wo...@cl...} {Concerts DD...@su...}}
-addressbook set $theid Email {{Travail op...@or...} {Concerts BW...@CA...}}<P><!-- date value -->
-addressbook set $theid Birthday [clock scan "1 Apr 1985"]<P><!-- multi date value -->
-addressbook set $theid ABDate
-addressbook set $theid ABDate [list [list "anniv droopy" 621507600] [list "anniv doudou" 816592400] [list "anniv zozo" 621597600] [list "anniv fifi" 816692400]]<P><!-- multi dictionary value -->
-addressbook set $theid Address
-addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75010} {Street "184, rue du Faubourg Saint-Denis"}] ] ]<P><H3><A NAME="M18"></A> The [search] command</H3>
+</PRE><P><H3><A NAME="M18"></A> The [set] command</H3>
<PRE>
- addressbook search -persons -ids -nocase Last == "bla"
+ set theid [lindex [addressbook persons -ids] 0]
+ addressbook set $theid First
+</PRE><P><PRE>
+ addressbook set $theid First Georgios
+ addressbook changed
+ addressbook save
+</PRE><P><PRE>
+ addressbook set $theid First Johann-Sebastian
+</PRE>
+<!-- Multi string value -->
+<PRE>
+ addressbook set $theid Email {{Work wo...@ha...} {Concerts DD...@su...}}
+ addressbook set $theid Email {{Work op...@or...} {Concerts BW...@CA...}}
+</PRE><P><!-- Date value -->
+<PRE>
+ addressbook set $theid Birthday [clock scan "1 Apr 1985"]
+</PRE><P><!-- Multi date value -->
+<PRE>
+ addressbook set $theid ABDate
+ addressbook set $theid ABDate [list [list "birthday Franny" 621597600] [list "birthday Zooey" 816692400]]
+</PRE><P><!-- Multi dictionary value -->
+<PRE>
+ addressbook set $theid Address
+ addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}] ] ]
+</PRE><P><H3><A NAME="M19"></A> The [search] command</H3>
+<PRE>
+ addressbook search -persons -ids -nocase Last == "Bach"
addressbook search -persons -ids -nocase Last > "Ba"
</PRE><P><PRE>
addressbook search -persons -nocase Modification >= 1070199949
addressbook search -persons -nocase Modification < 1070199949
-</PRE><P><H2><A NAME="M19"></A> Using keyed lists</H2>
+</PRE><P><!-- Multi string value. It searches one value at a time. -->
+<PRE>
+ addressbook search -persons Phone == {Work "01 02 03 04 05"}
+</PRE>
+<!-- Empty label --> to search on all phones -->
+<PRE>
+ addressbook search -persons Phone >= {"" "01 02 03 04 05"}
+</PRE><P><!-- Multi dict value. It searches one key in one dictionary at a time. -->
+<PRE>
+ addressbook search -persons -nocase Address == {Home {ZIP 98765}}
+ addressbook search -persons -nocase Address >= {Home {ZIP 98}}
+</PRE>
+<!-- Empty label --> to search on all labels -->
+<PRE>
+ addressbook search -persons -nocase Address >= {"" {City Paris}}
+</PRE>
+<!-- Empty key --> to search on all keys -->
+<PRE>
+ addressbook search -persons -nocase Address >= {home {"" abc}}
+</PRE>
+<!-- Empty label and key --> to search on all labels and keys -->
+<PRE>
+ addressbook search -persons -nocase Address >= {"" {"" abc}}
+</PRE><P><H2><A NAME="M20"></A> Using keyed lists</H2>
<PRE>
package require tclx
</PRE><P><HR>
-<P> Last updated 2003-12-21 15:28:42<P>
+<P> Last updated 2003-12-28 08:21:01<P>
</BODY>
</HTML>
|
|
From: <bde...@us...> - 2003-12-28 07:47:15
|
Update of /cvsroot/tcladdressbook/Help
In directory sc8-pr-cvs1:/tmp/cvs-serv4070/Help
Modified Files:
TclAB_QuickStart.aida
Log Message:
[search] examples
Index: TclAB_QuickStart.aida
===================================================================
RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- TclAB_QuickStart.aida 21 Dec 2003 14:35:44 -0000 1.2
+++ TclAB_QuickStart.aida 28 Dec 2003 07:47:12 -0000 1.3
@@ -175,6 +175,13 @@
((s2 The [create] command
(group|person)
+((s2 The [property type] command
+Get the name of a particular property
+((|
+ addressbook property type -groups UID
+ addressbook property type -persons Address
+|))
+
((s2 The [property add] command
Add a new property of type String called Instrument
((|
@@ -223,35 +230,48 @@
((s2 The [set] command
-set theid [lindex [addressbook persons -ids] 0]
-addressbook set $theid First
-
-addressbook set $theid First Georgios
-addressbook changed
-addressbook save
+((|
+ set theid [lindex [addressbook persons -ids] 0]
+ addressbook set $theid First
+|))
-addressbook set $theid First Jean-Sebastien
-!! multi string value
-addressbook set $theid Email {{Travail wo...@cl...} {Concerts DD...@su...}}
-addressbook set $theid Email {{Travail op...@or...} {Concerts BW...@CA...}}
+((|
+ addressbook set $theid First Georgios
+ addressbook changed
+ addressbook save
+|))
-!! date value
-addressbook set $theid Birthday [clock scan "1 Apr 1985"]
+((|
+ addressbook set $theid First Johann-Sebastian
+|))
+!! Multi string value
+((|
+ addressbook set $theid Email {{Work wo...@ha...} {Concerts DD...@su...}}
+ addressbook set $theid Email {{Work op...@or...} {Concerts BW...@CA...}}
+|))
-!! multi date value
-addressbook set $theid ABDate
-addressbook set $theid ABDate [list [list "anniv droopy" 621507600] [list "anniv doudou" 816592400] [list "anniv zozo" 621597600] [list "anniv fifi" 816692400]]
+!! Date value
+((|
+ addressbook set $theid Birthday [clock scan "1 Apr 1985"]
+|))
+!! Multi date value
+((|
+ addressbook set $theid ABDate
+ addressbook set $theid ABDate [list [list "birthday Franny" 621597600] [list "birthday Zooey" 816692400]]
+|))
-!! multi dictionary value
-addressbook set $theid Address
-addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75010} {Street "184, rue du Faubourg Saint-Denis"}] ] ]
+!! Multi dictionary value
+((|
+ addressbook set $theid Address
+ addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75001} {Street "1, avenue de l'Opéra"}] ] ]
+|))
((s2 The [search] command
((|
- addressbook search -persons -ids -nocase Last == "bla"
+ addressbook search -persons -ids -nocase Last == "Bach"
addressbook search -persons -ids -nocase Last > "Ba"
|))
@@ -259,6 +279,34 @@
addressbook search -persons -nocase Modification >= 1070199949
addressbook search -persons -nocase Modification < 1070199949
|))
+
+!! Multi string value. It searches one value at a time.
+((|
+ addressbook search -persons Phone == {Work "01 02 03 04 05"}
+|))
+!! Empty label --> to search on all phones
+((|
+ addressbook search -persons Phone >= {"" "01 02 03 04 05"}
+|))
+
+!! Multi dict value. It searches one key in one dictionary at a time.
+((|
+ addressbook search -persons -nocase Address == {Home {ZIP 98765}}
+ addressbook search -persons -nocase Address >= {Home {ZIP 98}}
+|))
+!! Empty label --> to search on all labels
+((|
+ addressbook search -persons -nocase Address >= {"" {City Paris}}
+|))
+!! Empty key --> to search on all keys
+((|
+ addressbook search -persons -nocase Address >= {home {"" abc}}
+|))
+!! Empty label and key --> to search on all labels and keys
+((|
+ addressbook search -persons -nocase Address >= {"" {"" abc}}
+|))
+
((s1 Using keyed lists
((|
|
|
From: <bde...@us...> - 2003-12-22 06:42:13
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv9308/Source
Modified Files:
TclAddressBookUtils.c
Log Message:
Conversions from macRoman to UTF
Index: TclAddressBookUtils.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- TclAddressBookUtils.c 16 Dec 2003 10:28:18 -0000 1.11
+++ TclAddressBookUtils.c 22 Dec 2003 06:42:10 -0000 1.12
@@ -1,7 +1,7 @@
/*
* File : "TclAddressBookUtils.c"
* Created: 2003-12-05 10:08:03
- * Last modification: 2003-12-13 21:25:43
+ * Last modification: 2003-12-22 07:38:03
* Author: Bernard Desgraupes
* e-mail: <bde...@ea...>
*
@@ -20,6 +20,8 @@
/* TclAddressBookUtils.h included in precompiled header */
// #include "TclAddressBookUtils.h"
+// Global variable for the macRoman Tcl_Encoding token
+extern Tcl_Encoding gMacRomanEnc;
/*
*----------------------------------------------------------------------
@@ -78,17 +80,17 @@
* resultPtr.
*
* Results:
- * None.
+ * Result is formatted as a keyed list. For instance:
+ * Multi dictionary
+ * { {label1 { {key11 value11} {key12 value12} {key13 value13} } } {label2 { {key21 value2} {key22 value22} {key23 value23} } } }
+ * Multi string / multi date
+ * {label1 value1} {label2 value2} {label3 value3}
*
* Side effects:
* Sets the array or the resultPtr.
*
*----------------------------------------------------------------------
*/
-// Multi dictionary
-// { {label1 { {key11 value11} {key12 value12} {key13 value13} } } {label2 { {key21 value2} {key22 value22} {key23 value23} } } }
-// Multi string / multi date
-// {label1 value1} {label2 value2} {label3 value3}
void
TclAB_GetValue(Tcl_Interp *interp, ABAddressBookRef ab,
@@ -295,7 +297,8 @@
*
* TclAB_PutValueInResult --
*
- * This function is invoked to
+ * This function is invoked to build two-elements sublists and
+ * store them in the result object.
*
* Results:
* None.
@@ -309,21 +312,30 @@
void
TclAB_PutValueInResult(Tcl_Interp *interp, char * inPropName, char * inStr, Boolean allValues)
{
+ // For UTF conversions
+ Tcl_DString ds;
+ Tcl_DStringInit(&ds);
+
if (allValues) {
int length;
+ char * theStr;
Tcl_Obj * listPtr;
Tcl_Obj * objs[2];
objs[0] = Tcl_NewStringObj(inPropName, strlen(inPropName));
objs[1] = Tcl_NewStringObj(inStr, strlen(inStr));
listPtr = Tcl_NewListObj(2, objs);
- Tcl_AppendElement(interp, Tcl_GetStringFromObj(listPtr, &length));
+ theStr = Tcl_GetStringFromObj(listPtr, &length);
+ Tcl_ExternalToUtfDString(gMacRomanEnc, theStr, length, &ds);
+ Tcl_AppendElement(interp, Tcl_DStringValue(&ds));
} else {
- Tcl_SetObjResult(interp, Tcl_NewStringObj(inStr, strlen(inStr)));
+ Tcl_ExternalToUtfDString(gMacRomanEnc, inStr, strlen(inStr), &ds);
+ Tcl_DStringResult(interp,&ds);
}
+ Tcl_DStringFree(&ds);
}
-
+
/*
*----------------------------------------------------------------------
*
@@ -807,9 +819,14 @@
if (text) {
if (CFStringGetCString(text, theName, sizeof(theName), theEncoding)) {
- Tcl_Obj *objs[2];
+ Tcl_Obj * objs[2];
+ Tcl_DString ds;
+
+ Tcl_DStringInit(&ds);
+ Tcl_ExternalToUtfDString(gMacRomanEnc, theName, strlen(theName), &ds);
objs[0] = Tcl_NewStringObj(theUID, strlen(theUID));
- objs[1] = Tcl_NewStringObj(theName, strlen(theName));
+ objs[1] = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
listPtr = Tcl_NewListObj(2, objs);
result = Tcl_ListObjAppendElement(interp, resultPtr, listPtr);
@@ -999,6 +1016,7 @@
int index, length, result;
int theInt;
TextEncoding theEncoding = GetApplicationTextEncoding();
+ char * propName;
static CONST char *typeSwitches[] = {
"Array", "Data", "Date", "Dictionary", "Integer", "Real", "String",
@@ -1031,6 +1049,7 @@
}
Tcl_IncrRefCount(objv[4]);
+ propName = Tcl_GetStringFromObj(objv[4], &length);
if (Tcl_GetIndexFromObj(interp, objv[5], typeSwitches, "type", 0, &index) != TCL_OK) {
return TCL_ERROR;
@@ -1041,26 +1060,30 @@
// Create a CFDictionary
theDict = CFDictionaryCreateMutable(NULL, 0, NULL, NULL);
- theKey = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[4], &length), theEncoding);
- // Populate the CFDictionary with the property/type pair
- theInt = propTypes[index];
- theValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theInt);
- CFDictionaryAddValue(theDict, theKey, theValue);
-
- // Add the property to the Address Book
- if ( !ABAddPropertiesAndTypes(ab, inRecordType ? kABPersonRecordType : kABGroupRecordType, theDict) ) {
- Tcl_AppendStringsToObj(resultPtr, "Couldn't add property '",
- Tcl_GetStringFromObj(objv[4], &length), "' to ",
- inRecordType ? "Person":"Group" , " records", (char *) NULL);
- result = TCL_ERROR;
- } else {
- result = TCL_OK;
- }
-
+ if (theDict) {
+ // Store the property/type pair in the CFDictionary
+ theKey = CFStringCreateWithCString(NULL, propName, theEncoding);
+ theInt = propTypes[index];
+ theValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theInt);
+ if (theKey && theValue) {
+ CFDictionaryAddValue(theDict, theKey, theValue);
+ // Add the property to the Address Book
+ if ( !ABAddPropertiesAndTypes(ab, inRecordType ? kABPersonRecordType : kABGroupRecordType, theDict) ) {
+ Tcl_AppendStringsToObj(resultPtr, "Couldn't add property '", propName, "' to ",
+ inRecordType ? "Person":"Group" , " records", (char *) NULL);
+ result = TCL_ERROR;
+ } else {
+ result = TCL_OK;
+ }
+ } else {
+ Tcl_AppendStringsToObj(resultPtr, "CFCreate error", (char *) NULL);
+ result = TCL_ERROR;
+ }
+ if (theKey) CFRelease(theKey);
+ if (theValue) CFRelease(theValue);
+ CFRelease(theDict);
+ }
Tcl_DecrRefCount(objv[4]);
- CFRelease(theKey);
- CFRelease(theValue);
- CFRelease(theDict);
return result;
}
@@ -1074,8 +1097,6 @@
* See the user documentation for details on what it does.
*
* Syntax:
- * addressbook property add (-groups|-persons) propName propType
- * addressbook property remove (-groups|-persons) propName
* addressbook property names (-groups|-persons)
*
* Results:
@@ -1119,7 +1140,12 @@
theProperty = CFArrayGetValueAtIndex(theItems,i);
if (theProperty && CFStringGetCString(theProperty, theName, sizeof(theName), GetApplicationTextEncoding())) {
- objPtr = Tcl_NewStringObj(theName, strlen(theName));
+ Tcl_DString ds;
+
+ Tcl_DStringInit(&ds);
+ Tcl_ExternalToUtfDString(gMacRomanEnc, theName, strlen(theName), &ds);
+ objPtr = Tcl_NewStringObj(Tcl_DStringValue(&ds), Tcl_DStringLength(&ds));
+ Tcl_DStringFree(&ds);
result = Tcl_ListObjAppendElement(interp, resultPtr, objPtr);
if (result != TCL_OK) {
Tcl_DecrRefCount(objPtr);
@@ -1167,8 +1193,8 @@
CFMutableArrayRef theArray;
int length, result;
char * propName;
-
- Tcl_ResetResult(interp);
+
+ Tcl_ResetResult(interp);
if (objc != 5) {
Tcl_WrongNumArgs(interp, 2, objv, "remove (-groups|-persons) propName");
@@ -1177,30 +1203,34 @@
Tcl_IncrRefCount(objv[4]);
propName = Tcl_GetStringFromObj(objv[4], &length);
+ theProp = CFStringCreateWithCString(NULL, propName, GetApplicationTextEncoding());
- // Get the address book
- ab = ABGetSharedAddressBook();
-
- // Create a CFArray
- theArray = CFArrayCreateMutable(NULL, 0, NULL);
- theProp = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[4], &length), GetApplicationTextEncoding());
- // Populate the CFArray with the property
- CFArrayAppendValue(theArray, theProp);
- CFRelease(theProp);
-
- // Add the property to the Address Book
- result = ABRemoveProperties(ab, inRecordType ? kABPersonRecordType : kABGroupRecordType, theArray);
- if ( !result ) {
- Tcl_AppendStringsToObj(resultPtr, "Couldn't remove property '",
- propName, "' for ", inRecordType ? "Person":"Group" , " records", (char *) NULL);
+ if (theProp) {
+ // Get the address book
+ ab = ABGetSharedAddressBook();
+
+ // Create a CFArray and store the property therein
+ theArray = CFArrayCreateMutable(NULL, 0, NULL);
+ CFArrayAppendValue(theArray, theProp);
+ CFRelease(theProp);
+
+ // Remove the property from the Address Book
+ result = ABRemoveProperties(ab, inRecordType ? kABPersonRecordType : kABGroupRecordType, theArray);
+ CFRelease(theArray);
+ if ( !result ) {
+ Tcl_AppendStringsToObj(resultPtr, "Couldn't remove property '", propName,
+ "' for ", inRecordType ? "Person":"Group" , " records", (char *) NULL);
+ result = TCL_ERROR;
+ } else {
+ result = TCL_OK;
+ }
+ } else {
+ Tcl_AppendStringsToObj(resultPtr, "CFStringCreateWithCString error", (char *) NULL);
result = TCL_ERROR;
- } else {
- result = TCL_OK;
- }
-
- Tcl_DecrRefCount(objv[4]);
- CFRelease(theArray);
- return result;
+ }
+
+ Tcl_DecrRefCount(objv[4]);
+ return result;
}
|
|
From: <bde...@us...> - 2003-12-22 06:41:55
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv9229/Source
Modified Files:
TclAddressBook.c
Log Message:
gMacRomanEnc global token
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- TclAddressBook.c 16 Dec 2003 07:37:05 -0000 1.21
+++ TclAddressBook.c 22 Dec 2003 06:41:48 -0000 1.22
@@ -52,6 +52,9 @@
int Addressbook_Init(Tcl_Interp *interp);
#pragma export off
+// Global variable for the macRoman Tcl_Encoding token
+Tcl_Encoding gMacRomanEnc;
+
/*
*----------------------------------------------------------------------
@@ -89,6 +92,14 @@
if (Tcl_PkgProvide(interp, "addressbook", vstr) != TCL_OK) {
return TCL_ERROR;
}
+
+ // Store a global token for the macRoman encoding. If NULL is returned,
+ // an error message is left by Tcl_GetEncoding in interp's result.
+ gMacRomanEnc = Tcl_GetEncoding(interp,"macRoman");
+ if (gMacRomanEnc == NULL) {
+ return TCL_ERROR;
+ }
+
return TCL_OK;
}
|
|
From: <bde...@us...> - 2003-12-21 14:36:06
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1707/Help Modified Files: TclAddressBookHelp.html Log Message: Subst tags Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- TclAddressBookHelp.html 16 Dec 2003 08:57:40 -0000 1.9 +++ TclAddressBookHelp.html 21 Dec 2003 14:36:03 -0000 1.10 @@ -1,22 +1,16 @@ <HTML> <HEAD> -<TITLE>Tcladdressbook Help</TITLE> +<TITLE>TcladdressbookHelp</TITLE> <META NAME=GENERATOR CONTENT="Aida Mode"> </HEAD> <BODY> -<!-- :Title: Tcladdressbook Help --> -<!-- :Project: addressbook extension for Tcl --> -<!-- :Version: $Revision$ --> -<!-- :CVSDate: $Date$ --> -<!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> -<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> -<!-- :Created: 2003-11-26 14:30:03 --> -<!-- :Modified: 2003-12-13 18:24:43 --> -<!-- :Keywords: Address book, data base --><P><!-- logo --> +<!-- :Title: TcladdressbookHelp --> +<!-- :Project: addressbook extension for Tcl --><P><!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> +<!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --><P><!-- :Modified: 2003-12-16 11:47:35 --><P><!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> -<P> <A href="http://sourceforge.net/projects/tcladdressbook"> Home Page at SourceForge</A> -<HR><BLOCKQUOTE><P><I> -This is a manual page for the Tcladdressbook extension for Tcl. +<P> <A href="TclAB.html"> Home Page</A> | <A href="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> +This is a manual page for the Tcladdressbook extension for Tcl. This +documents version 1.0d12. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">NAME</A> @@ -241,6 +235,7 @@ <A HREF="http://sourceforge.net/cvs/?group_id=96169">http://sourceforge.net/cvs/?group_id=96169</A><P><P> You can also browse the cvs repository online at <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M30"></A> SEE ALSO</H2> The Mk4Tcl extension.<P><H2><A NAME="M31"></A> KEYWORDS</H2> -Address book, data base<P> +Address book, data base<P><HR> +<P> Last updated 2003-12-21 15:32:30<P> </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-21 14:36:00
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1684/Help Modified Files: TclAddressBookHelp.aida Log Message: Subst tags Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- TclAddressBookHelp.aida 16 Dec 2003 08:57:34 -0000 1.6 +++ TclAddressBookHelp.aida 21 Dec 2003 14:35:56 -0000 1.7 @@ -1,12 +1,13 @@ -:Title: Tcladdressbook Help +:Title: TcladdressbookHelp :Project: addressbook extension for Tcl -!! :Version: $Revision$ -!! :CVSDate: $Date$ +!! !! :Version: $Revision$ +!! !! :CVSDate: $Date$ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> -!! :Created: 2003-11-26 14:30:03 -:Modified: 2003-12-13 18:24:43 -!! :Keywords: Address book, data base +!! !! :Created: 2003-11-26 14:30:03 +:Modified: 2003-12-16 11:47:35 +!! !! :Keywords: Address book, data base +:TclCmd: set currentversion [package require addressbook] !! logo @@ -15,7 +16,8 @@ ((nl ((lk TclAB.html )) Home Page lk)) | ((lk http://sourceforge.net/projects/tcladdressbook )) Project Page at SourceForge lk)) ((/ -This is a manual page for the Tcladdressbook extension for Tcl. +This is a manual page for the Tcladdressbook extension for Tcl. This +documents version ((s $currentversion s)). /)) ((toc @@ -302,7 +304,8 @@ Address book, data base - +((- +((nl Last updated ((s [ISOTime::ISODateAndTimeRelaxed] s)) |
|
From: <bde...@us...> - 2003-12-21 14:35:53
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1664/Help Modified Files: TclAB_QuickStart.html Log Message: Subst tags Index: TclAB_QuickStart.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.html,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TclAB_QuickStart.html 16 Dec 2003 08:57:16 -0000 1.1 +++ TclAB_QuickStart.html 21 Dec 2003 14:35:50 -0000 1.2 @@ -12,17 +12,16 @@ <!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> <!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> <!-- :Created: 2003-12-14 18:26:47 --> -<!-- :Modified: 2003-12-14 18:26:52 --> -<!-- :Keywords: Address book, data base --><P><!-- logo --> +<!-- :Modified: 2003-12-16 11:47:23 --> +<!-- :Keywords: Address book, data base --> +<!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> <P> <A href="TclAB.html"> Home Page</A> | <A href="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This file is a tutorial that demonstrates the [addressbook] command -defined by the Tcladdressbook extension for Tcl. +defined by the Tcladdressbook extension for Tcl. It +documents version 1.0d12. For a detailed and complete description of the syntax of each subcommand, -refer to the help file: -<UL> - <LI> <A href="TclAddressBookHelp"> text format</A> - <LI> <A href="TclAddressBookHelp.html"> HTML format</A><P></UL> +refer to the <A href="TclAddressBookHelp.html">help file</A>. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">Using the commands</A> @@ -209,6 +208,7 @@ </PRE><P><H2><A NAME="M19"></A> Using keyed lists</H2> <PRE> package require tclx -</PRE><P>Last modification $Date$ +</PRE><P><HR> +<P> Last updated 2003-12-21 15:28:42<P> </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-21 14:35:50
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1643/Help Modified Files: TclAB_QuickStart.aida Log Message: Subst tags Index: TclAB_QuickStart.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.aida,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TclAB_QuickStart.aida 16 Dec 2003 08:57:10 -0000 1.1 +++ TclAB_QuickStart.aida 21 Dec 2003 14:35:44 -0000 1.2 @@ -6,8 +6,9 @@ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> !! :Created: 2003-12-14 18:26:47 -:Modified: 2003-12-14 18:26:52 +:Modified: 2003-12-16 11:47:23 !! :Keywords: Address book, data base +:TclCmd: set currentversion [package require addressbook] !! logo @@ -18,13 +19,10 @@ ((/ This file is a tutorial that demonstrates the [addressbook] command -defined by the Tcladdressbook extension for Tcl. +defined by the Tcladdressbook extension for Tcl. It +documents version ((s $currentversion s)). For a detailed and complete description of the syntax of each subcommand, -refer to the help file: -((lu -((li ((lk TclAddressBookHelp )) text format lk)) -((li ((lk TclAddressBookHelp.html )) HTML format lk)) -lu)) +refer to the ((lk TclAddressBookHelp.html ))help file lk)). /)) ((toc @@ -267,4 +265,7 @@ package require tclx |)) -Last modification $Date$ \ No newline at end of file +((- +((nl Last updated ((s [ISOTime::ISODateAndTimeRelaxed] s)) + + |
|
From: <bde...@us...> - 2003-12-21 14:35:42
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1618/Help Modified Files: TclAB_Home.aida Log Message: Subst tags Index: TclAB_Home.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_Home.aida,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TclAB_Home.aida 15 Dec 2003 23:52:25 -0000 1.2 +++ TclAB_Home.aida 21 Dec 2003 14:35:39 -0000 1.3 @@ -6,9 +6,9 @@ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> !! :Created: 2003-12-14 18:26:47 -:Modified: 2003-12-14 18:26:52 +:Modified: 2003-12-16 11:47:56 !! :Keywords: Address book, data base - +:TclCmd: set currentversion [package require addressbook] !! logo ((im Images/TclAB_logo.gif @@ -47,15 +47,15 @@ Binary releases of Tcladdressbook are available on the SourceForge site in the ((lk http://sourceforge.net/project/showfiles.php?group_id=96169 )) download area lk)) of the project. - +((nl The latest version is ((b ((s $currentversion s)) b)). ((s1 Source code -Tcladdressbook is an open source project. Its code is made publicly +Tcladdressbook is an open source project. Its code is publicly available and can be found on the ((lk http://sourceforge.net/projects/tcladdressbook )) SourceForge site lk)). ((nl The code is under CVS control. You can retrieve the latest stage of development using any CVS client. -((lk http://sourceforge.net/cvs/?group_id=96169 )) See instructions. lk)) +((lk http://sourceforge.net/cvs/?group_id=96169 )) See instructions there. lk)) You can also ((lk http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook )) browse the cvs repository lk)) online. @@ -83,10 +83,11 @@ ((nl Please e-mail about any question you might encounter: <bde...@us...> +((nl Last updated ((s [ISOTime::ISODateAndTimeRelaxed] s)) !! logo SF !! ------- ((- -((nl Tcladdressbook is hosted by +((nl ((i Tcladdressbook is hosted by i)) ((lk http://sourceforge.net )) ((im http://sourceforge.net/sflogo.php?group_id=96169&type=4 SourceForge.net Logo im)) lk)) |
|
From: <bde...@us...> - 2003-12-21 14:35:37
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1591/Help Modified Files: TclAB.html Log Message: Subst tags Index: TclAB.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TclAB.html 15 Dec 2003 23:52:20 -0000 1.2 +++ TclAB.html 21 Dec 2003 14:35:33 -0000 1.3 @@ -12,10 +12,11 @@ <!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> <!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> <!-- :Created: 2003-12-14 18:26:47 --> -<!-- :Modified: 2003-12-14 18:26:52 --> -<!-- :Keywords: Address book, data base --><P><!-- logo --> +<!-- :Modified: 2003-12-16 11:47:56 --> +<!-- :Keywords: Address book, data base --> +<!-- :TclCmd: set currentversion [package require addressbook] --><P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P><P><HR><BLOCKQUOTE><P><I> - Welcome to the Home Page of the Tcladdressbook extension for Tcl. +Welcome to the Home Page of the Tcladdressbook extension for Tcl. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">Description</A> @@ -44,13 +45,14 @@ Jaguar) or greater of the system is required.<P><H2><A NAME="M3"></A> Download</H2> Binary releases of Tcladdressbook are available on the SourceForge site in the <A href="http://sourceforge.net/project/showfiles.php?group_id=96169"> download area</A> -of the project.<P><H2><A NAME="M4"></A> Source code</H2> -Tcladdressbook is an open source project. Its code is made publicly +of the project. +<P> The latest version is <B>1.0d12</B>.<P><H2><A NAME="M4"></A> Source code</H2> +Tcladdressbook is an open source project. Its code is publicly available and can be found on the <A href="http://sourceforge.net/projects/tcladdressbook"> SourceForge site</A>. <P> The code is under CVS control. You can retrieve the latest stage of development using any CVS client. -<A href="http://sourceforge.net/cvs/?group_id=96169"> See instructions.</A> +<A href="http://sourceforge.net/cvs/?group_id=96169"> See instructions there.</A> You can also <A href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook"> browse the cvs repository</A> online.<P><H2><A NAME="M5"></A> Help</H2> @@ -66,10 +68,11 @@ You can also address <A href="http://sourceforge.net/tracker/?atid=613885&group_id=96169&func=browse"> feature requests</A> and propose <A href="http://sourceforge.net/tracker/?atid=613884&group_id=96169&func=browse"> patches</A>.<P><P> Please e-mail about any question you might encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A><P><!-- logo SF --> +<A HREF="mailto:bde...@us...">bde...@us...</A><P><P> Last updated 2003-12-21 15:31:48 +<!-- logo SF --> <!-- ------- --> <HR> -<P> Tcladdressbook is hosted by +<P> <I>Tcladdressbook is hosted by</I> <A href="http://sourceforge.net"> <P><IMG SRC="http://sourceforge.net/sflogo.php?group_id=96169&type=4 " ALT="SourceForge.net Logo" ALIGN=bottom></P></A><P> </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-16 10:28:22
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv27828/Source
Modified Files:
TclAddressBookUtils.c
Log Message:
Inverted "if"
Index: TclAddressBookUtils.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- TclAddressBookUtils.c 16 Dec 2003 07:37:12 -0000 1.10
+++ TclAddressBookUtils.c 16 Dec 2003 10:28:18 -0000 1.11
@@ -249,7 +249,7 @@
CFDictionaryGetKeysAndValues(theDict, theKeys, theVals);
// Loop over all the entries
for (k = 0; k < dictCount; k++) {
- if (!theKeys[k] && !theVals[k] ) {
+ if (theKeys[k] && theVals[k] ) {
// Make a two items list for each key/value pair
if (CFStringGetCString(theKeys[k], theStr, sizeof(theStr), theEncoding)
&& CFStringGetCString(theVals[k], theSubStr, sizeof(theSubStr), theEncoding)) {
|
|
From: <bde...@us...> - 2003-12-16 08:57:43
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv13072/Help Modified Files: TclAddressBookHelp.html Log Message: Added logo Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TclAddressBookHelp.html 16 Dec 2003 07:38:00 -0000 1.8 +++ TclAddressBookHelp.html 16 Dec 2003 08:57:40 -0000 1.9 @@ -12,7 +12,10 @@ <!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> <!-- :Created: 2003-11-26 14:30:03 --> <!-- :Modified: 2003-12-13 18:24:43 --> -<!-- :Keywords: Address book, data base --><P><HR><BLOCKQUOTE><P><I> +<!-- :Keywords: Address book, data base --><P><!-- logo --> +<P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> +<P> <A href="http://sourceforge.net/projects/tcladdressbook"> Home Page at SourceForge</A> +<HR><BLOCKQUOTE><P><I> This is a manual page for the Tcladdressbook extension for Tcl. </I></P></BLOCKQUOTE><HR> <UL> |
|
From: <bde...@us...> - 2003-12-16 08:57:37
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv13046/Help Modified Files: TclAddressBookHelp.aida Log Message: Added logo Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TclAddressBookHelp.aida 16 Dec 2003 07:37:54 -0000 1.5 +++ TclAddressBookHelp.aida 16 Dec 2003 08:57:34 -0000 1.6 @@ -9,6 +9,11 @@ !! :Keywords: Address book, data base +!! logo +((im Images/TclAB_logo.gif +TclAB Logo im)) +((nl ((lk TclAB.html )) Home Page lk)) | ((lk http://sourceforge.net/projects/tcladdressbook )) Project Page at SourceForge lk)) + ((/ This is a manual page for the Tcladdressbook extension for Tcl. /)) |
|
From: <bde...@us...> - 2003-12-16 08:57:19
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv13008/Help Added Files: TclAB_QuickStart.html Log Message: First checkin --- NEW FILE: TclAB_QuickStart.html --- <HTML> <HEAD> <TITLE>TclAB_QuickStart</TITLE> <META NAME=GENERATOR CONTENT="Aida Mode"> </HEAD> <BODY> <!-- :Title: TclAB_QuickStart --> <!-- :Project: addressbook extension for Tcl --> <!-- :Version: $Revision: 1.1 $ --> <!-- :CVSDate: $Date: 2003/12/16 08:57:16 $ --> <!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> <!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> <!-- :Created: 2003-12-14 18:26:47 --> <!-- :Modified: 2003-12-14 18:26:52 --> <!-- :Keywords: Address book, data base --><P><!-- logo --> <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> <P> <A href="TclAB.html"> Home Page</A> | <A href="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This file is a tutorial that demonstrates the [addressbook] command defined by the Tcladdressbook extension for Tcl. For a detailed and complete description of the syntax of each subcommand, refer to the help file: <UL> <LI> <A href="TclAddressBookHelp"> text format</A> <LI> <A href="TclAddressBookHelp.html"> HTML format</A><P></UL> </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">Using the commands</A> <UL><LI><A HREF="#M2">The [groups] command</A></UL> <UL><LI><A HREF="#M3">The [persons] command</A></UL> <UL><LI><A HREF="#M4">The [count] command</A></UL> <UL><LI><A HREF="#M5">The [getme] command</A></UL> <UL><LI><A HREF="#M6">The [record] command</A></UL> <UL><LI><A HREF="#M7">The [type] command</A></UL> <UL><LI><A HREF="#M8">The [property names] command</A></UL> <UL><LI><A HREF="#M9">The [remove] command</A></UL> <UL><LI><A HREF="#M10">The [parents] command</A></UL> <UL><LI><A HREF="#M11">The [create] command</A></UL> <UL><LI><A HREF="#M12">The [property add] command</A></UL> <UL><LI><A HREF="#M13">The [property remove] command</A></UL> <UL><LI><A HREF="#M14">The [export] command</A></UL> <UL><LI><A HREF="#M15">The [import] command</A></UL> <UL><LI><A HREF="#M16">The [image] command</A></UL> <UL><LI><A HREF="#M17">The [set] command</A></UL> <UL><LI><A HREF="#M18">The [search] command</A></UL> <LI><A HREF="#M19">Using keyed lists</A> </UL><P>Load the extension <PRE> package require addressbook </PRE><P><H2><A NAME="M1"></A> Using the commands</H2> <H3><A NAME="M2"></A> The [groups] command</H3> List the groups (name and ID) <PRE> addressbook groups </PRE> List the groups (only ID) <PRE> addressbook groups -ids </PRE> List the subgroups of a specific group (name and ID) <PRE> set groupid [lindex [addressbook groups -ids] 2] addressbook groups -ingroup $groupid </PRE> List the subgroups of a specific group (only ID) <PRE> addressbook groups -ids -ingroup $groupid </PRE><P><H3><A NAME="M3"></A> The [persons] command</H3> List the person records (name and ID) <PRE> addressbook persons </PRE> List the person records (only ID) <PRE> addressbook persons -ids </PRE><P><H3><A NAME="M4"></A> The [count] command</H3> Count the existing groups and person records <PRE> addressbook count -groups addressbook count -persons addressbook count -persons -ingroup [lindex [addressbook groups -ids] 0] </PRE><P><H3><A NAME="M5"></A> The [getme] command</H3> Store the info about "me" in the variable myrecord. <PRE> set myrecord [addressbook getme] </PRE> The value of myrecord is a keyed list. One can use the usual Tcl list commands or the special keylist commands defined in the TclX extension like this: <PRE> keylkeys myrecord keylget myrecord Email.work keylget myrecord Address.home.ZIP clock format [keylget myrecord Birthday] </PRE><P><H3><A NAME="M6"></A> The [record] command</H3> Store the ID of the first record in the variable theid <PRE> set theid [lindex [addressbook persons -ids] 0] </PRE> Store the info about this record in the variable "person". The syntax is the same as with the [getme] command. <PRE> set person [addressbook record $theid] keylkeys person keylget person Email.work keylget person Address.home.ZIP clock format [keylget person Birthday] </PRE><P>Store the ID of the first group in the variable theid <PRE> set theid [lindex [addressbook groups -ids] 0] </PRE> Store the info about this group in the variable grp and display the results with the [parray] command <PRE> set grp [addressbook record $theid] keylkeys grp keylget grp GroupName clock format [keylget grp Modification] </PRE><P><H3><A NAME="M7"></A> The [type] command</H3> Find the type (ABPerson or ABGroup) of the object corresponding to the ID $theid <PRE> addressbook type $theid </PRE><P><H3><A NAME="M8"></A> The [property names] command</H3> Get the list of all existing properties for groups or persons <PRE> addressbook property names -groups addressbook property names -persons </PRE><P><H3><A NAME="M9"></A> The [remove] command</H3> Remove the record corresponding to the ID $theid from the database <PRE> addressbook delete $theid </PRE> Check that there were changes (1 if yes, 0 if no) <PRE> addressbook changed </PRE> Save the changes to make them permanent <PRE> addressbook save </PRE><P>Remove the record corresponding to the ID $theid from a specific group: it is removed as member of this subgroup but will be removed from the database only if it does not belong to other groups. <PRE> set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] addressbook delete $theid -fromgroup $groupid </PRE><P><H3><A NAME="M10"></A> The [parents] command</H3> List the parents of a person record (the various groups it belongs to). One can also find the parents of a group with this command. <PRE> set theid [lindex [addressbook persons -ids] 0] addressbook parents $theid </PRE> List the parents of a person record (only ID) <PRE> addressbook parents -ids $theid </PRE><P><H3><A NAME="M11"></A> The [create] command</H3> (group|person)<P><H3><A NAME="M12"></A> The [property add] command</H3> Add a new property of type String called Instrument <PRE> addressbook property add -persons Instrument String </PRE><P>Add a new property of type Date called Meeting <PRE> addressbook property add -groups Meeting Date </PRE><P><H3><A NAME="M13"></A> The [property remove] command</H3> Remove the properties created above <PRE> addressbook property remove -persons Instrument addressbook property remove -groups Meeting </PRE><P><H3><A NAME="M14"></A> The [export] command</H3> Create a VCard corresponding to a particular record. <PRE> set theid [lindex [addressbook persons -ids] 0] </PRE> The data returned is binary. You can store it in a file. <PRE> set vcardData [addressbook export $theid] </PRE><P><H3><A NAME="M15"></A> The [import] command</H3> <PRE> set fname [file join /Users bernardo someVcard.vcf] set fid [open $fname r] set vcard [read $fid] close $fid addressbook import $vcard </PRE><P><H3><A NAME="M16"></A> The [image] command</H3> <PRE> set theid [lindex [addressbook persons -ids] 0] set img [addressbook image $theid] </PRE><P><H3><A NAME="M17"></A> The [set] command</H3> set theid [lindex [addressbook persons -ids] 0] addressbook set $theid First<P>addressbook set $theid First Georgios addressbook changed addressbook save<P>addressbook set $theid First Jean-Sebastien <!-- multi string value --> addressbook set $theid Email {{Travail wo...@cl...} {Concerts DD...@su...}} addressbook set $theid Email {{Travail op...@or...} {Concerts BW...@CA...}}<P><!-- date value --> addressbook set $theid Birthday [clock scan "1 Apr 1985"]<P><!-- multi date value --> addressbook set $theid ABDate addressbook set $theid ABDate [list [list "anniv droopy" 621507600] [list "anniv doudou" 816592400] [list "anniv zozo" 621597600] [list "anniv fifi" 816692400]]<P><!-- multi dictionary value --> addressbook set $theid Address addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75010} {Street "184, rue du Faubourg Saint-Denis"}] ] ]<P><H3><A NAME="M18"></A> The [search] command</H3> <PRE> addressbook search -persons -ids -nocase Last == "bla" addressbook search -persons -ids -nocase Last > "Ba" </PRE><P><PRE> addressbook search -persons -nocase Modification >= 1070199949 addressbook search -persons -nocase Modification < 1070199949 </PRE><P><H2><A NAME="M19"></A> Using keyed lists</H2> <PRE> package require tclx </PRE><P>Last modification $Date: 2003/12/16 08:57:16 $ </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-16 08:57:13
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv12986/Help Added Files: TclAB_QuickStart.aida Log Message: First checkin --- NEW FILE: TclAB_QuickStart.aida --- :Title: TclAB_QuickStart :Project: addressbook extension for Tcl !! :Version: $Revision: 1.1 $ !! :CVSDate: $Date: 2003/12/16 08:57:10 $ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> !! :Created: 2003-12-14 18:26:47 :Modified: 2003-12-14 18:26:52 !! :Keywords: Address book, data base !! logo ((im Images/TclAB_logo.gif TclAB Logo im)) ((nl ((lk TclAB.html )) Home Page lk)) | ((lk http://sourceforge.net/projects/tcladdressbook )) Project Page at SourceForge lk)) ((/ This file is a tutorial that demonstrates the [addressbook] command defined by the Tcladdressbook extension for Tcl. For a detailed and complete description of the syntax of each subcommand, refer to the help file: ((lu ((li ((lk TclAddressBookHelp )) text format lk)) ((li ((lk TclAddressBookHelp.html )) HTML format lk)) lu)) /)) ((toc Load the extension ((| package require addressbook |)) ((s1 Using the commands ((s2 The [groups] command List the groups (name and ID) ((| addressbook groups |)) List the groups (only ID) ((| addressbook groups -ids |)) List the subgroups of a specific group (name and ID) ((| set groupid [lindex [addressbook groups -ids] 2] addressbook groups -ingroup $groupid |)) List the subgroups of a specific group (only ID) ((| addressbook groups -ids -ingroup $groupid |)) ((s2 The [persons] command List the person records (name and ID) ((| addressbook persons |)) List the person records (only ID) ((| addressbook persons -ids |)) ((s2 The [count] command Count the existing groups and person records ((| addressbook count -groups addressbook count -persons addressbook count -persons -ingroup [lindex [addressbook groups -ids] 0] |)) ((s2 The [getme] command Store the info about "me" in the variable myrecord. ((| set myrecord [addressbook getme] |)) The value of myrecord is a keyed list. One can use the usual Tcl list commands or the special keylist commands defined in the TclX extension like this: ((| keylkeys myrecord keylget myrecord Email.work keylget myrecord Address.home.ZIP clock format [keylget myrecord Birthday] |)) ((s2 The [record] command Store the ID of the first record in the variable theid ((| set theid [lindex [addressbook persons -ids] 0] |)) Store the info about this record in the variable "person". The syntax is the same as with the [getme] command. ((| set person [addressbook record $theid] keylkeys person keylget person Email.work keylget person Address.home.ZIP clock format [keylget person Birthday] |)) Store the ID of the first group in the variable theid ((| set theid [lindex [addressbook groups -ids] 0] |)) Store the info about this group in the variable grp and display the results with the [parray] command ((| set grp [addressbook record $theid] keylkeys grp keylget grp GroupName clock format [keylget grp Modification] |)) ((s2 The [type] command Find the type (ABPerson or ABGroup) of the object corresponding to the ID $theid ((| addressbook type $theid |)) ((s2 The [property names] command Get the list of all existing properties for groups or persons ((| addressbook property names -groups addressbook property names -persons |)) ((s2 The [remove] command Remove the record corresponding to the ID $theid from the database ((| addressbook delete $theid |)) Check that there were changes (1 if yes, 0 if no) ((| addressbook changed |)) Save the changes to make them permanent ((| addressbook save |)) Remove the record corresponding to the ID $theid from a specific group: it is removed as member of this subgroup but will be removed from the database only if it does not belong to other groups. ((| set groupid [lindex [addressbook groups -ids] 0] set theid [lindex [addressbook persons -ids] 0] addressbook delete $theid -fromgroup $groupid |)) ((s2 The [parents] command List the parents of a person record (the various groups it belongs to). One can also find the parents of a group with this command. ((| set theid [lindex [addressbook persons -ids] 0] addressbook parents $theid |)) List the parents of a person record (only ID) ((| addressbook parents -ids $theid |)) ((s2 The [create] command (group|person) ((s2 The [property add] command Add a new property of type String called Instrument ((| addressbook property add -persons Instrument String |)) Add a new property of type Date called Meeting ((| addressbook property add -groups Meeting Date |)) ((s2 The [property remove] command Remove the properties created above ((| addressbook property remove -persons Instrument addressbook property remove -groups Meeting |)) ((s2 The [export] command Create a VCard corresponding to a particular record. ((| set theid [lindex [addressbook persons -ids] 0] |)) The data returned is binary. You can store it in a file. ((| set vcardData [addressbook export $theid] |)) ((s2 The [import] command ((| set fname [file join /Users bernardo someVcard.vcf] set fid [open $fname r] set vcard [read $fid] close $fid addressbook import $vcard |)) ((s2 The [image] command ((| set theid [lindex [addressbook persons -ids] 0] set img [addressbook image $theid] |)) ((s2 The [set] command set theid [lindex [addressbook persons -ids] 0] addressbook set $theid First addressbook set $theid First Georgios addressbook changed addressbook save addressbook set $theid First Jean-Sebastien !! multi string value addressbook set $theid Email {{Travail wo...@cl...} {Concerts DD...@su...}} addressbook set $theid Email {{Travail op...@or...} {Concerts BW...@CA...}} !! date value addressbook set $theid Birthday [clock scan "1 Apr 1985"] !! multi date value addressbook set $theid ABDate addressbook set $theid ABDate [list [list "anniv droopy" 621507600] [list "anniv doudou" 816592400] [list "anniv zozo" 621597600] [list "anniv fifi" 816692400]] !! multi dictionary value addressbook set $theid Address addressbook set $theid Address [list [list Home [list {CountryCode fr} {City Paris} {Country France} {ZIP 75010} {Street "184, rue du Faubourg Saint-Denis"}] ] ] ((s2 The [search] command ((| addressbook search -persons -ids -nocase Last == "bla" addressbook search -persons -ids -nocase Last > "Ba" |)) ((| addressbook search -persons -nocase Modification >= 1070199949 addressbook search -persons -nocase Modification < 1070199949 |)) ((s1 Using keyed lists ((| package require tclx |)) Last modification $Date: 2003/12/16 08:57:10 $ |
|
From: <bde...@us...> - 2003-12-16 07:38:05
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1103/Help Modified Files: TclAddressBookHelp.html Log Message: Updated syntax for [getme] and [record] Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TclAddressBookHelp.html 13 Dec 2003 17:29:01 -0000 1.7 +++ TclAddressBookHelp.html 16 Dec 2003 07:38:00 -0000 1.8 @@ -11,11 +11,8 @@ <!-- :Author: Bernard Desgraupes <A HREF="mailto:bde...@ea...">bde...@ea...</A> --> <!-- :Homepage: <A HREF="http://webperso.easyconnect.fr/bdesgraupes/">http://webperso.easyconnect.fr/bdesgraupes/</A> --> <!-- :Created: 2003-11-26 14:30:03 --> -<!-- :Modified: 2003-12-11 08:18:03 --> -<!-- :Keywords: Address book, data base --> - - -<HR><BLOCKQUOTE><P><I> +<!-- :Modified: 2003-12-13 18:24:43 --> +<!-- :Keywords: Address book, data base --><P><HR><BLOCKQUOTE><P><I> This is a manual page for the Tcladdressbook extension for Tcl. </I></P></BLOCKQUOTE><HR> <UL> @@ -28,7 +25,7 @@ <UL><UL><LI><A HREF="#M7">addressbook create (group | person) <I>name</I> ?-ingroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M8">addressbook delete <I>recordID</I> ?-fromgroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M9">addressbook export <I>personID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M10">addressbook getme <I>varname</I></A></UL></UL> +<UL><UL><LI><A HREF="#M10">addressbook getme</A></UL></UL> <UL><UL><LI><A HREF="#M11">addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M12">addressbook image <I>personID</I> ?<I>imageData</I>?</A></UL></UL> <UL><UL><LI><A HREF="#M13">addressbook import <I>vCardData</I></A></UL></UL> @@ -37,7 +34,7 @@ <UL><UL><LI><A HREF="#M16">addressbook property names (-groups | -persons)</A></UL></UL> <UL><UL><LI><A HREF="#M17">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> <UL><UL><LI><A HREF="#M18">addressbook property remove (-groups | -persons) <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M19">addressbook record <I>recordID varname</I></A></UL></UL> +<UL><UL><LI><A HREF="#M19">addressbook record <I>recordID</I></A></UL></UL> <UL><UL><LI><A HREF="#M20">addressbook save</A></UL></UL> <UL><UL><LI><A HREF="#M21">addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></A></UL></UL> <UL><UL><LI><A HREF="#M22">addressbook set <I>recordID propertyName</I> ?<I>value</I>?</A></UL></UL> @@ -50,112 +47,72 @@ <LI><A HREF="#M29">SOURCE CODE</A> <LI><A HREF="#M30">SEE ALSO</A> <LI><A HREF="#M31">KEYWORDS</A> -</UL> - - - -<H2><A NAME="M1"></A> NAME</H2> -addressbook - manipulate the Macintosh OSX Address Book database - -<H2><A NAME="M2"></A> SYNOPSIS</H2> +</UL><P><P><H2><A NAME="M1"></A> NAME</H2> +addressbook - manipulate the Macintosh OSX Address Book database<P><H2><A NAME="M2"></A> SYNOPSIS</H2> <PRE> package require addressbook addressbook subcommand ?arg arg ...? -</PRE> - -<H2><A NAME="M3"></A> INTRODUCTION</H2> - -The argument <I>subcommand</I> indicates what operation to perform. Any +</PRE><P><H2><A NAME="M3"></A> INTRODUCTION</H2><P>The argument <I>subcommand</I> indicates what operation to perform. Any unique abbreviation for each subcommand is acceptable. The valid -subcommands are explained in the next sections. - - -<H2><A NAME="M4"></A> SUBCOMMANDS</H2> - -<H4><A NAME="M5"></A> addressbook changed</H4> +subcommands are explained in the next sections.<P><H2><A NAME="M4"></A> SUBCOMMANDS</H2><P><H4><A NAME="M5"></A> addressbook changed</H4> This command returns 1 if there has been changes made to the database, 0 otherwise. Changes are made in memory with commands such as <B>addressbook set</B>, <B>addressbook create</B>, <B>addressbook delete</B>. To make these changes permanent, one must call the <B>addressbook save</B> -command. - -<H4><A NAME="M6"></A> addressbook count (-groups | -persons) ?-ingroup <I>groupID</I>?</H4> +command. <P><H4><A NAME="M6"></A> addressbook count (-groups | -persons) ?-ingroup <I>groupID</I>?</H4> This command returns the count of existing groups or persons in the database. One can specify a particular group with the -ingroup option -to count only the subgroups or members in this group. - -<H4><A NAME="M7"></A> addressbook create (group | person) <I>name</I> ?-ingroup <I>groupID</I>?</H4> +to count only the subgroups or members in this group.<P><H4><A NAME="M7"></A> addressbook create (group | person) <I>name</I> ?-ingroup <I>groupID</I>?</H4> This command lets you create a new group or a new person record. The <I>name</I> argument is the name to give to the new group or the last name of the person for which a new record is created. With the <I>-ingroup</I> option one can make the newly created record a subgroup or a member of the particular group with unique ID <I>groupID</I>. If no error occurs, the -command returns the unique ID of the created record. - -<H4><A NAME="M8"></A> addressbook delete <I>recordID</I> ?-fromgroup <I>groupID</I>?</H4> +command returns the unique ID of the created record.<P><H4><A NAME="M8"></A> addressbook delete <I>recordID</I> ?-fromgroup <I>groupID</I>?</H4> This command removes the record with unique ID <I>recordID</I> from the database or from a particular subgroup specified by its unique ID with the <I>-fromgroup</I> option. Note that any changes made to the database won't -be definitive until you invoke the <B>addressbook save</B> command. - -<H4><A NAME="M9"></A> addressbook export <I>personID</I></H4> +be definitive until you invoke the <B>addressbook save</B> command.<P><H4><A NAME="M9"></A> addressbook export <I>personID</I></H4> This command lets you export the record with unique ID <I>personID</I> as a VCard. The result should be considered as binary data since it can -contain an image associated to the record. - -<H4><A NAME="M10"></A> addressbook getme <I>varname</I></H4> -This command retrieves all the data available in the database concerning -the logged-in user ("Me") and stores it in the variable specified by -the <I>varname</I> argument. The value of this variable takes the form of +contain an image associated to the record.<P><H4><A NAME="M10"></A> addressbook getme</H4> +This command returns all the data available in the database concerning +the logged-in user ("Me"). The returned value takes the form of a keyed list: see the <B>addressbook record</B> command for a description of this format. Keyed lists can be very easily manipulated with the -<B>keylget</B> and <B>keylset</B> commands defined in the TclX extension. - -<H4><A NAME="M11"></A> addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</H4> +<B>keylget</B> and <B>keylset</B> commands defined in the TclX extension.<P><H4><A NAME="M11"></A> addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</H4> This command returns a list of all the existing group records: if no option is specified, it is a list whose elements are sublists made of two elements. The first element is the unique ID associated with the group and the second is its name. If the <I>-ids</I> argument is specified, the returned list will contain only the unique IDs of the groups. If the <I>-ingroup</I> option is specified, only the subgroups contained in the group -with ID <I>groupID</I> will be returned. - -<H4><A NAME="M12"></A> addressbook image <I>personID</I> ?<I>imageData</I>?</H4> +with ID <I>groupID</I> will be returned.<P><H4><A NAME="M12"></A> addressbook image <I>personID</I> ?<I>imageData</I>?</H4> If no <I>imageData</I> argument is specified, this command returns the custom image associated with the record corresponding to the unique ID <I>personID</I>. The returned bytes are binary data. If no image exists, it raises an error. If an <I>imageData</I> argument is specified, it should contain valid binary data defining an image which will be associated the -record with unique ID <I>personID</I>. - -<H4><A NAME="M13"></A> addressbook import <I>vCardData</I></H4> +record with unique ID <I>personID</I>.<P><H4><A NAME="M13"></A> addressbook import <I>vCardData</I></H4> This command imports data in VCard format. The data specified by the <I>vCardData</I> argument must be valid data in VCard format: a new record is created in the database corresponding to the information contained in the -VCard. Note that the data can be binary if the VCard contains an image. - -<H4><A NAME="M14"></A> addressbook parents ?-ids? <I>recordID</I></H4> +VCard. Note that the data can be binary if the VCard contains an image.<P><H4><A NAME="M14"></A> addressbook parents ?-ids? <I>recordID</I></H4> This command returns a list of all the groups the record with unique ID <I>recordID</I> belongs to. The elements of this list are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the <I>-ids</I> option is specified, only IDs are -returned. - -<H4><A NAME="M15"></A> addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> +returned. <P><H4><A NAME="M15"></A> addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> This command returns a list of all the existing person records: if no option is specified, it is a list whose elements are sublists made of one or two items: the unique ID and, possibly, the name of the record if this field exists. If the <I>-ids</I> argument is specified, the returned list will contain only the unique IDs. If the <I>-ingroup</I> option is specified, only the members belonging to the group with ID <I>groupID</I> -will be returned. - -<H4><A NAME="M16"></A> addressbook property names (-groups | -persons)</H4> +will be returned.<P><H4><A NAME="M16"></A> addressbook property names (-groups | -persons)</H4> This command returns a list of all the properties defined in the database for group or person records. New properties can be created or removed with -the <B>addressbook property add</B> and <B>addressbook property remove</B> commands. - -<H4><A NAME="M17"></A> addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> +the <B>addressbook property add</B> and <B>addressbook property remove</B> commands.<P><H4><A NAME="M17"></A> addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> This command lets you add a new property to the database, either for person or for group records. The name of the new property is specified by the <I>propName</I> argument: it must be unique. One can get the list of all the @@ -163,22 +120,15 @@ The type of the property is specified by the <I>propType</I> argument. This argument can have one of the following values: <I>Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, -MultiDictionary, MultiInteger, MultiReal, MultiString.</I> - -<H4><A NAME="M18"></A> addressbook property remove (-groups | -persons) <I>propName</I></H4> +MultiDictionary, MultiInteger, MultiReal, MultiString.</I><P><H4><A NAME="M18"></A> addressbook property remove (-groups | -persons) <I>propName</I></H4> This command lets you remove a property from the database, either for person or for group records. The name of the property is specified in the <I>propName</I> argument. One can get the list of all the existing -properties with the <B>addressbook property names</B> command. - -<H4><A NAME="M19"></A> addressbook record <I>recordID varname</I></H4> -This command retrieves all the data available in the database concerning -the record with unique ID <I>recordID</I> and stores it in the variable -specified by the <I>varname</I> argument. The value of this variable +properties with the <B>addressbook property names</B> command.<P><H4><A NAME="M19"></A> addressbook record <I>recordID</I></H4> +This command returns all the data available in the database concerning +the record with unique ID <I>recordID</I>. The returned value takes the form of a keyed list: see the <B>addressbook record</B> command -for a description of this format. Keyed lists can be very easily manipulated -with the <B>keylget</B> and <B>keylset</B> commands defined in the TclX -extension. One can also use the usual Tcl commands concerning lists. +for a description of this format. <P> The format used for a particular value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have a multiple type: MultiString for fields like Email, Phone etc., MultiDate @@ -198,22 +148,19 @@ sublists: the first item is the key in the dictionary and the second one is the value associated with this key. For instance a person could have two addresses: each address will be returned as a Label/Dictionary pair; the -elements of the dictionary are pairs like {City Paris} or {CountryCode fr}. - -</UL> +elements of the dictionary are pairs like {City Paris} or {CountryCode fr}.<P></UL> <P> Dates are returned as values suitable for use with the <B>clock format</B> Tcl command. It is the number of seconds relative to "Thu Jan 01 00:00:00 CET 1970". - -<H4><A NAME="M20"></A> addressbook save</H4> +<P> Note that keyed lists can be very easily manipulated +with the <B>keylget</B> and <B>keylset</B> commands defined in the TclX +extension. One can also use the usual Tcl commands concerning lists.<P><H4><A NAME="M20"></A> addressbook save</H4> This command lets you save the changes made in the database. Commands such as <B>addressbook set</B>, <B>addressbook create</B> or <B>addressbook delete</B> modify the data in memory: to make the changes definitive in the database, one must call explicitely the <B>addressbook save</B> command. To check whether there has been changes in the database, use the -<B>addressbook changed</B> command. - -<H4><A NAME="M21"></A> addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> +<B>addressbook changed</B> command.<P><H4><A NAME="M21"></A> addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H4> This command returns all the records corresponding to the criterion described by the last three arguments: <UL> @@ -237,9 +184,7 @@ >= Greater Than or Equal ^= not applicable </PRE> -The <TT>^=</TT> operator is not applicable (and will default to Greater Than or Equal). - - <LI> For a string value, they correspond respectively to: +The <TT>^=</TT> operator is not applicable (and will default to Greater Than or Equal).<P> <LI> For a string value, they correspond respectively to: <PRE> == Equal != Not Equal @@ -249,36 +194,22 @@ >= Contains Substring ^= Prefix Match </PRE> -The <TT><</TT> and <TT><=</TT> operators are not applicable and will both default to Equal. - -</UL> - - - <LI> <I>value</I> is the value property you are searching - -</UL> +The <TT><</TT> and <TT><=</TT> operators are not applicable and will both default to Equal.<P></UL><P> <LI> <I>value</I> is the value property you are searching<P></UL> <P> The <I>-groups</I> or <I>-persons</I> arguments let you specify the kind of records you want to search. If it is not specified, the default is <I>-person</I>. If the <I>-ids</I> option is specified, only IDs of the matching records are returned, rather than pairs made of the ID and the name. The <I>-nocase</I> argument concerns string comparisons and requires -that no distinction be made between uppercase and lowercase letters. - -<H4><A NAME="M22"></A> addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> +that no distinction be made between uppercase and lowercase letters.<P><H4><A NAME="M22"></A> addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> This command lets you get or set the value of a particular property for the record with unique ID <I>recordID</I>. If the <I>value</I> argument is not specified, it returns the current value of the property specified in the <I>propertyName</I> argument. If <I>value</I> is specified, the property <I>propertyName</I> will be set to this value. See the <B>addressbook record</B> command for a description of the format used for the -various kinds of properties. - -<H4><A NAME="M23"></A> addressbook type <I>recordID</I></H4> +various kinds of properties.<P><H4><A NAME="M23"></A> addressbook type <I>recordID</I></H4> This command returns the type (ABPerson or ABGroup) of the record with -unique ID <I>recordID</I>. - - -<H2><A NAME="M24"></A> INSTALLATION</H2> +unique ID <I>recordID</I>.<P><H2><A NAME="M24"></A> INSTALLATION</H2> The extension is made of two files: the dynamic library (called addressbook1.0.dylib in version 1.0) and a file pkgIndex.tcl necessary for Tcl to be able to locate the extension upon request. Both files are @@ -288,63 +219,25 @@ <B>auto_path</B> Tcl variable. If you use the extension within the AlphaX editor (version 8.0b11 or greater), you can also install it in the <I>Tclextensions</I> folder which is located at the same level as the -application. - - -<H2><A NAME="M25"></A> VERSION HISTORY</H2> +application. <P><H2><A NAME="M25"></A> VERSION HISTORY</H2> <UL> - <LI> 1.0 - - -</UL> - - -<H2><A NAME="M26"></A> REQUIREMENTS AND PORTABILITY</H2> + <LI> 1.0 - <P></UL><P><H2><A NAME="M26"></A> REQUIREMENTS AND PORTABILITY</H2> This extension is only useful on Macintosh platforms. Version 10.2 or greater of the system is required: the AddressBook framework was introduced -in version 10.2 of the System (aka Jaguar). - - -<H2><A NAME="M27"></A> KNOW ISSUES</H2> +in version 10.2 of the System (aka Jaguar).<P><H2><A NAME="M27"></A> KNOW ISSUES</H2> Please e-mail any bug or problem you encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A> - - -<H2><A NAME="M28"></A> LICENSE AND DISCLAIMER</H2> +<A HREF="mailto:bde...@us...">bde...@us...</A><P><H2><A NAME="M28"></A> LICENSE AND DISCLAIMER</H2> This software is free software and distributed under the same licensing terms -as the Tcl language itself. See license.terms in the Tcl distribution. - -<P> © Copyright Bernard Desgraupes 2003 - - -<H2><A NAME="M29"></A> SOURCE CODE</H2> +as the Tcl language itself. See license.terms in the Tcl distribution.<P><P> © Copyright Bernard Desgraupes 2003<P><H2><A NAME="M29"></A> SOURCE CODE</H2> Tcladdressbook is an Open Source Project. Its source code is public and can be found on the SourceForge site at the following address: -<A HREF="http://sourceforge.net/projects/tcladdressbook">http://sourceforge.net/projects/tcladdressbook</A> - -<P> Tcladdressbook binary releases are available at +<A HREF="http://sourceforge.net/projects/tcladdressbook">http://sourceforge.net/projects/tcladdressbook</A><P><P> Tcladdressbook binary releases are available at <A HREF="http://sourceforge.net/project/showfiles.php?group_id=96169">http://sourceforge.net/project/showfiles.php?group_id=96169</A> or on my web -page at <A HREF="http://webperso.easyconnect.fr/bdesgraupes/tcl.html">http://webperso.easyconnect.fr/bdesgraupes/tcl.html</A> - -<P> The code is under CVS control. You can retrieve the latest stage of +page at <A HREF="http://webperso.easyconnect.fr/bdesgraupes/tcl.html">http://webperso.easyconnect.fr/bdesgraupes/tcl.html</A><P><P> The code is under CVS control. You can retrieve the latest stage of development using any CVS client. See instructions at: -<A HREF="http://sourceforge.net/cvs/?group_id=96169">http://sourceforge.net/cvs/?group_id=96169</A> - -<P> You can also browse the cvs repository online at -<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> - - -<H2><A NAME="M30"></A> SEE ALSO</H2> -The Mk4Tcl extension. - -<H2><A NAME="M31"></A> KEYWORDS</H2> -Address book, data base - - - - - - - - +<A HREF="http://sourceforge.net/cvs/?group_id=96169">http://sourceforge.net/cvs/?group_id=96169</A><P><P> You can also browse the cvs repository online at +<A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> <P><H2><A NAME="M30"></A> SEE ALSO</H2> +The Mk4Tcl extension.<P><H2><A NAME="M31"></A> KEYWORDS</H2> +Address book, data base<P> </BODY> </HTML> |
|
From: <bde...@us...> - 2003-12-16 07:37:57
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1078/Help Modified Files: TclAddressBookHelp.aida Log Message: Updated syntax for [getme] and [record] Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TclAddressBookHelp.aida 13 Dec 2003 17:28:55 -0000 1.4 +++ TclAddressBookHelp.aida 16 Dec 2003 07:37:54 -0000 1.5 @@ -5,7 +5,7 @@ !! :Author: Bernard Desgraupes <bde...@ea...> !! :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> !! :Created: 2003-11-26 14:30:03 -:Modified: 2003-12-11 08:18:03 +:Modified: 2003-12-13 18:24:43 !! :Keywords: Address book, data base @@ -65,10 +65,9 @@ a VCard. The result should be considered as binary data since it can contain an image associated to the record. -((s3 addressbook getme ((i varname i)) -This command retrieves all the data available in the database concerning -the logged-in user ("Me") and stores it in the variable specified by -the ((i varname i)) argument. The value of this variable takes the form of +((s3 addressbook getme +This command returns all the data available in the database concerning +the logged-in user ("Me"). The returned value takes the form of a keyed list: see the ((b addressbook record b)) command for a description of this format. Keyed lists can be very easily manipulated with the ((b keylget b)) and ((b keylset b)) commands defined in the TclX extension. @@ -133,14 +132,11 @@ ((i propName i)) argument. One can get the list of all the existing properties with the ((b addressbook property names b)) command. -((s3 addressbook record ((i recordID varname i)) -This command retrieves all the data available in the database concerning -the record with unique ID ((i recordID i)) and stores it in the variable -specified by the ((i varname i)) argument. The value of this variable +((s3 addressbook record ((i recordID i)) +This command returns all the data available in the database concerning +the record with unique ID ((i recordID i)). The returned value takes the form of a keyed list: see the ((b addressbook record b)) command -for a description of this format. Keyed lists can be very easily manipulated -with the ((b keylget b)) and ((b keylset b)) commands defined in the TclX -extension. One can also use the usual Tcl commands concerning lists. +for a description of this format. ((nl The format used for a particular value depends on the type of the property (string, integer, date, multivalue etc.). Some properties have a multiple type: MultiString for fields like Email, Phone etc., MultiDate @@ -165,6 +161,9 @@ ((nl Dates are returned as values suitable for use with the ((b clock format b)) Tcl command. It is the number of seconds relative to "Thu Jan 01 00:00:00 CET 1970". +((nl Note that keyed lists can be very easily manipulated +with the ((b keylget b)) and ((b keylset b)) commands defined in the TclX +extension. One can also use the usual Tcl commands concerning lists. ((s3 addressbook save This command lets you save the changes made in the database. Commands such |
|
From: <bde...@us...> - 2003-12-16 07:37:52
|
Update of /cvsroot/tcladdressbook/Help
In directory sc8-pr-cvs1:/tmp/cvs-serv1052/Help
Modified Files:
TclAddressBookHelp
Log Message:
Updated syntax for [getme] and [record]
Index: TclAddressBookHelp
===================================================================
RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- TclAddressBookHelp 13 Dec 2003 17:28:49 -0000 1.7
+++ TclAddressBookHelp 16 Dec 2003 07:37:48 -0000 1.8
@@ -1,6 +1,6 @@
Title: Tcladdressbook Help
Project: addressbook extension for Tcl
-Modified: 2003-12-13 18:24:43
+Modified: 2003-12-16 08:35:45
Abstract
@@ -17,7 +17,7 @@
addressbook create (group | person) name ?-ingroup groupID?
addressbook delete recordID ?-fromgroup groupID?
addressbook export personID
- addressbook getme varname
+ addressbook getme
addressbook groups ?-ids? ?-ingroup groupID?
addressbook image personID ?imageData?
addressbook import vCardData
@@ -26,7 +26,7 @@
addressbook property names (-groups | -persons)
addressbook property add (-groups | -persons) propName propType
addressbook property remove (-groups | -persons) propName
- addressbook record recordID varname
+ addressbook record recordID
addressbook save
addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value
addressbook set recordID propertyName ?value?
@@ -93,10 +93,9 @@
a VCard. The result should be considered as binary data since it can
contain an image associated to the record.
- addressbook getme varname
-This command retrieves all the data available in the database concerning
-the logged-in user ("Me") and stores it in the variable specified by
-the varname argument. The value of this variable takes the form of
+ addressbook getme
+This command returns all the data available in the database concerning
+the logged-in user ("Me"). The returned value takes the form of
a keyed list: see the addressbook record command for a description
of this format. Keyed lists can be very easily manipulated with the
keylget and keylset commands defined in the TclX extension.
@@ -161,14 +160,11 @@
propName argument. One can get the list of all the existing
properties with the addressbook property names command.
- addressbook record recordID varname
-This command retrieves all the data available in the database concerning
-the record with unique ID recordID and stores it in the variable
-specified by the varname argument. The value of this variable
+ addressbook record recordID
+This command returns all the data available in the database concerning
+the record with unique ID recordID. The returned value
takes the form of a keyed list: see the addressbook record command
-for a description of this format. Keyed lists can be very easily manipulated
-with the keylget and keylset commands defined in the TclX
-extension. One can also use the usual Tcl commands concerning lists.
+for a description of this format.
The format used for a particular value depends on the type of
the property (string, integer, date, multivalue etc.). Some properties have
a multiple type: MultiString for fields like Email, Phone etc., MultiDate
@@ -193,6 +189,9 @@
Dates are returned as values suitable for use with the clock
format Tcl command. It is the number of seconds relative to "Thu Jan 01
00:00:00 CET 1970".
+ Note that keyed lists can be very easily manipulated
+with the keylget and keylset commands defined in the TclX
+extension. One can also use the usual Tcl commands concerning lists.
addressbook save
This command lets you save the changes made in the database. Commands such
|