tcladdressbook-commits Mailing List for TclAddressBook (Page 11)
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-11 11:17:46
|
Update of /cvsroot/tcladdressbook/CVSROOT
In directory sc8-pr-cvs1:/tmp/cvs-serv10008/CVSROOT
Modified Files:
loginfo
Log Message:
Disabled writing to commitlog
Index: loginfo
===================================================================
RCS file: /cvsroot/tcladdressbook/CVSROOT/loginfo,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- loginfo 11 Dec 2003 09:21:22 -0000 1.4
+++ loginfo 11 Dec 2003 11:17:43 -0000 1.5
@@ -26,7 +26,7 @@
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
# Write out in file "commitlog"
-ALL (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
+# ALL (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
# CVSROOT /bin/mail -s "TclAddressBook-cvs: %s modified" bde...@us... 2>&1 > /dev/null
# DEFAULT /bin/mail -s "TclAddressBook-cvs: %s modified" tcl...@li... 2>&1 > /dev/null
|
|
From: <bde...@us...> - 2003-12-11 10:42:34
|
Update of /cvsroot/tcladdressbook/Source/TclAddressBook.pbproj In directory sc8-pr-cvs1:/tmp/cvs-serv3156/TclAddressBook.pbproj Log Message: Directory /cvsroot/tcladdressbook/Source/TclAddressBook.pbproj added to the repository |
|
From: <bde...@us...> - 2003-12-11 10:35:43
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv1872/Source Modified Files: TclAddressBook.pch Log Message: Modif for gcc compiler Index: TclAddressBook.pch =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.pch,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TclAddressBook.pch 11 Dec 2003 08:55:54 -0000 1.3 +++ TclAddressBook.pch 11 Dec 2003 10:35:39 -0000 1.4 @@ -14,6 +14,7 @@ #define USE_TCL_STUBS +#ifndef __APPLE_CC__ #if TARGET_API_MAC_CARBON // Carbon #if TARGET_API_MAC_OSX @@ -26,6 +27,7 @@ #else // Classic #pragma precompile_target "MW_TclAddressBookHeaderPPC" +#endif #endif |
|
From: <bde...@us...> - 2003-12-11 10:35:18
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv1786/Source
Modified Files:
TclAddressBook.c
Log Message:
Uncommented unused args for gcc
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- TclAddressBook.c 11 Dec 2003 08:42:22 -0000 1.18
+++ TclAddressBook.c 11 Dec 2003 10:35:13 -0000 1.19
@@ -243,7 +243,7 @@
int
TclABCmd_Changed(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -289,7 +289,7 @@
int
TclABCmd_Count(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -389,7 +389,7 @@
int
TclABCmd_Create(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -444,7 +444,7 @@
int
TclABCmd_Delete(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -554,7 +554,7 @@
int
TclABCmd_Export(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -627,11 +627,11 @@
int
TclABCmd_GetMe(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
- Tcl_Obj */* resultPtr */) /* Pointer to store the result. */
+ Tcl_Obj *resultPtr) /* Pointer to store the result. */
{
ABAddressBookRef ab;
CONST84 char * var;
@@ -677,7 +677,7 @@
int
TclABCmd_Groups(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -709,7 +709,7 @@
int
TclABCmd_Image(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -803,7 +803,7 @@
int
TclABCmd_Import(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -912,7 +912,7 @@
int
TclABCmd_Parents(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1004,7 +1004,7 @@
int
TclABCmd_Persons(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1038,7 +1038,7 @@
int
TclABCmd_Property(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1113,7 +1113,7 @@
int
TclABCmd_Record(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1182,11 +1182,11 @@
int
TclABCmd_Save(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp * interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
- Tcl_Obj * /* resultPtr */) /* Pointer to store the result. */
+ Tcl_Obj * resultPtr) /* Pointer to store the result. */
{
ABAddressBookRef ab;
@@ -1225,7 +1225,7 @@
int
TclABCmd_Search(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1413,7 +1413,7 @@
int
TclABCmd_Type(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
@@ -1496,7 +1496,7 @@
int
TclABCmd_Set(
- ClientData /* clientData */, /* Not used. */
+ ClientData clientData, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
Tcl_Obj *CONST objv[], /* Argument values. */
|
|
From: <bde...@us...> - 2003-12-11 09:23:29
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv21504/Source Modified Files: Changes.Log Log Message: remove --> delete Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Changes.Log 11 Dec 2003 06:45:10 -0000 1.6 +++ Changes.Log 11 Dec 2003 09:23:26 -0000 1.7 @@ -35,13 +35,14 @@ ================================================================================ = 1.0d9 last update: 2003-12-11 07:42:57 ================================================================================ + Command [remove] renamed to [delete]. ================================================================================ = 1.0d8 last update: 2003-12-11 07:42:21 ================================================================================ New command [search]. Works only for simple values. - Command [count] now accepts a -ingroup option. + Command [count] now accepts an -ingroup option. Command [value] renamed to [set]. ================================================================================ |
|
From: <bde...@us...> - 2003-12-11 08:58:43
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv17300/Source Modified Files: TclAddressBook_Headers.h Log Message: Comment Index: TclAddressBook_Headers.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_Headers.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- TclAddressBook_Headers.h 1 Dec 2003 16:46:11 -0000 1.1.1.1 +++ TclAddressBook_Headers.h 11 Dec 2003 08:58:40 -0000 1.2 @@ -1,9 +1,9 @@ // File: "TclAddressBook_Headers.h" // Created: 2003-11-26 12:56:37 -// Last modification: 2003-11-28 09:33:30 +// Last modification: 2003-12-11 09:58:01 // Author: Bernard Desgraupes -// Description: Use this header to include the precompiled headers -// on OSX for dylib target built with CW Pro 8 +// Description: Use this header to include the precompiled header +// on OSX when building with CW Pro 8 #pragma check_header_flags on |
|
From: <bde...@us...> - 2003-12-11 08:56:53
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv16925/Source Modified Files: TclAddressBook.exp Log Message: No comment Index: TclAddressBook.exp =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.exp,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- TclAddressBook.exp 1 Dec 2003 16:46:11 -0000 1.1.1.1 +++ TclAddressBook.exp 11 Dec 2003 08:56:50 -0000 1.2 @@ -1 +1 @@ -_Addressbook_Init # Addressbook_Init +_Addressbook_Init \ No newline at end of file |
|
From: <bde...@us...> - 2003-12-11 08:56:01
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv16687/Source Modified Files: TclAddressBook.pch Log Message: Suppressed TCLADDRESSBOOK_USE_FRAMEWORK_INCLUDES Index: TclAddressBook.pch =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.pch,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TclAddressBook.pch 5 Dec 2003 20:23:05 -0000 1.2 +++ TclAddressBook.pch 11 Dec 2003 08:55:54 -0000 1.3 @@ -1,6 +1,6 @@ // File: "TclAddressBook_CarbonMachO.pch" // Created: 2003-09-22 10:47:15 -// Last modification: 2003-12-05 10:27:22 +// Last modification: 2003-12-11 09:52:10 // Author: Bernard Desgraupes // Description: Use this header to include the precompiled headers // on OSX for dylib target built with CW Pro 8 @@ -9,8 +9,6 @@ #define TARGET_API_MAC_CARBON 1 #define TARGET_API_MAC_OSX 1 -#define TCLADDRESSBOOK_USE_FRAMEWORK_INCLUDES - // Stubs mechanism enabled #define USE_TCL_STUBS @@ -48,18 +46,7 @@ #endif -#ifdef TCLADDRESSBOOK_MACHO -#define TCLADDRESSBOOK_PATH_SEP '/' -#else -#define TCLADDRESSBOOK_PATH_SEP ':' -#endif - - -#ifdef TCLADDRESSBOOK_USE_FRAMEWORK_INCLUDES -#include <Tcl/tcl.h> -#else -#include <tcl.h> -#endif +#include <Tcl/tcl.h> #ifndef CONST84 // Tcl 8.4 backwards compatibility |
|
From: <bde...@us...> - 2003-12-11 08:55:55
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv16661/Source Modified Files: TclAddressBook.h Log Message: Suppressed TCLADDRESSBOOK_USE_FRAMEWORK_INCLUDES Index: TclAddressBook.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- TclAddressBook.h 1 Dec 2003 16:46:11 -0000 1.1.1.1 +++ TclAddressBook.h 11 Dec 2003 08:55:49 -0000 1.2 @@ -1,6 +1,6 @@ // File: "TclAddressBook.h" // Created: 2003-11-26 12:53:29 -// Last modification: 2003-11-28 09:32:49 +// Last modification: 2003-12-11 09:51:39 // Author: Bernard Desgraupes // Description: Use this header on OSX for dylib target built with CW Pro 8 @@ -15,7 +15,6 @@ #else -#define TCLADDRESSBOOK_USE_FRAMEWORK_INCLUDES #include "TclAddressBook_Headers.h" #endif // __MWERKS__ |
|
From: <bde...@us...> - 2003-12-11 08:46:46
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv15313/Help Modified Files: TclAddressBookHelp.html Log Message: Sync with aida file 1.3 Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- TclAddressBookHelp.html 11 Dec 2003 07:16:59 -0000 1.5 +++ TclAddressBookHelp.html 11 Dec 2003 08:46:42 -0000 1.6 @@ -11,7 +11,7 @@ <!-- :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-08 08:21:01 --> +<!-- :Modified: 2003-12-11 08:18:03 --> <!-- :Keywords: Address book, data base --> @@ -24,24 +24,24 @@ <LI><A HREF="#M3">INTRODUCTION</A> <LI><A HREF="#M4">SUBCOMMANDS</A> <UL><UL><LI><A HREF="#M5">addressbook changed</A></UL></UL> -<UL><UL><LI><A HREF="#M6">addressbook count (-groups | -persons) ?-ingroup groupID?</A></UL></UL> +<UL><UL><LI><A HREF="#M6">addressbook count (-groups | -persons) ?-ingroup <I>groupID</I>?</A></UL></UL> <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 export <I>personID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M9">addressbook getme <I>arrayvar</I></A></UL></UL> -<UL><UL><LI><A HREF="#M10">addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M11">addressbook image <I>personID</I> ?<I>imageData</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M12">addressbook import <I>vCardData</I></A></UL></UL> -<UL><UL><LI><A HREF="#M13">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> -<UL><UL><LI><A HREF="#M14">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> -<UL><UL><LI><A HREF="#M15">addressbook property names (-groups | -persons)</A></UL></UL> -<UL><UL><LI><A HREF="#M16">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> -<UL><UL><LI><A HREF="#M17">addressbook property remove (-groups | -persons) <I>propName</I></A></UL></UL> -<UL><UL><LI><A HREF="#M18">addressbook record <I>recordID arrayvar</I></A></UL></UL> -<UL><UL><LI><A HREF="#M19">addressbook remove <I>recordID</I> ?-fromgroup <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>arrayvar</I></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> +<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 arrayvar</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 type <I>recordID</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="#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> @@ -75,11 +75,11 @@ <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 remove</B>. To make +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 groupID?</H4> +<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. @@ -92,18 +92,24 @@ 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 export <I>personID</I></H4> +<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> 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="M9"></A> addressbook getme <I>arrayvar</I></H4> +<H4><A NAME="M10"></A> addressbook getme <I>arrayvar</I></H4> This command retrieves all the data available in the database concerning the logged-in user ("Me") and stores it in the array variable specified by the <I>arrayvar</I> argument. See the <B>addressbook record</B> command for a description of the format of the various kinds of properties. -<H4><A NAME="M10"></A> addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</H4> +<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 @@ -112,7 +118,7 @@ <I>-ingroup</I> option is specified, only the subgroups contained in the group with ID <I>groupID</I> will be returned. -<H4><A NAME="M11"></A> addressbook image <I>personID</I> ?<I>imageData</I>?</H4> +<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 @@ -120,20 +126,20 @@ contain valid binary data defining an image which will be associated the record with unique ID <I>personID</I>. -<H4><A NAME="M12"></A> addressbook import <I>vCardData</I></H4> +<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="M13"></A> addressbook parents ?-ids? <I>recordID</I></H4> +<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="M14"></A> addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H4> +<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 @@ -142,12 +148,12 @@ specified, only the members belonging to the group with ID <I>groupID</I> will be returned. -<H4><A NAME="M15"></A> addressbook property names (-groups | -persons)</H4> +<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="M16"></A> addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H4> +<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 @@ -157,13 +163,13 @@ Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, MultiDictionary, MultiInteger, MultiReal, MultiString.</I> -<H4><A NAME="M17"></A> addressbook property remove (-groups | -persons) <I>propName</I></H4> +<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="M18"></A> addressbook record <I>recordID arrayvar</I></H4> +<H4><A NAME="M19"></A> addressbook record <I>recordID arrayvar</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 array variable specified by the <I>arrayvar</I> argument. The keys of the array @@ -199,16 +205,10 @@ format</B> Tcl command. It is the number of seconds relative to "Thu Jan 01 00:00:00 CET 1970". -<H4><A NAME="M19"></A> addressbook remove <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="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 -remove</B> modify the data in memory: to make the changes definitive in the +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. @@ -264,11 +264,7 @@ 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 type <I>recordID</I></H4> -This command returns the type (ABPerson or ABGroup) of the record with -unique ID <I>recordID</I>. - -<H4><A NAME="M23"></A> addressbook set <I>recordID propertyName</I> ?<I>value</I>?</H4> +<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 @@ -276,6 +272,10 @@ 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> +This command returns the type (ABPerson or ABGroup) of the record with +unique ID <I>recordID</I>. <H2><A NAME="M24"></A> INSTALLATION</H2> |
|
From: <bde...@us...> - 2003-12-11 08:46:39
|
Update of /cvsroot/tcladdressbook/Help
In directory sc8-pr-cvs1:/tmp/cvs-serv15285/Help
Modified Files:
TclAddressBookHelp
Log Message:
Sync with aida file 1.3
Index: TclAddressBookHelp
===================================================================
RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- TclAddressBookHelp 11 Dec 2003 07:16:48 -0000 1.5
+++ TclAddressBookHelp 11 Dec 2003 08:46:36 -0000 1.6
@@ -15,6 +15,7 @@
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 arrayvar
addressbook groups ?-ids? ?-ingroup groupID?
@@ -26,11 +27,10 @@
addressbook property add (-groups | -persons) propName propType
addressbook property remove (-groups | -persons) propName
addressbook record recordID arrayvar
- addressbook remove recordID ?-fromgroup groupID?
addressbook save
addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value
- addressbook type recordID
addressbook set recordID propertyName ?value?
+ addressbook type recordID
5. INSTALLATION
6. VERSION HISTORY
7. REQUIREMENTS AND PORTABILITY
@@ -65,7 +65,7 @@
addressbook changed
This command returns 1 if there has been changes made to the database, 0
otherwise. Changes are made in memory with commands such as addressbook
-set, addressbook create, addressbook remove. To make
+set, addressbook create, addressbook delete. To make
these changes permanent, one must call the addressbook save
command.
@@ -82,6 +82,12 @@
particular group with unique ID groupID. If no error occurs, the
command returns the unique ID of the created record.
+ addressbook delete recordID ?-fromgroup groupID?
+This command removes the record with unique ID recordID from the
+database or from a particular subgroup specified by its unique ID with the
+-fromgroup option. Note that any changes made to the database won't
+be definitive until you invoke the addressbook save command.
+
addressbook export personID
This command lets you export the record with unique ID personID as
a VCard. The result should be considered as binary data since it can
@@ -188,16 +194,10 @@
format Tcl command. It is the number of seconds relative to "Thu Jan 01
00:00:00 CET 1970".
- addressbook remove recordID ?-fromgroup groupID?
-This command removes the record with unique ID recordID from the
-database or from a particular subgroup specified by its unique ID with the
--fromgroup option. Note that any changes made to the database won't
-be definitive until you invoke the addressbook save command.
-
addressbook save
This command lets you save the changes made in the database. Commands such
as addressbook set, addressbook create or addressbook
-remove modify the data in memory: to make the changes definitive in the
+delete modify the data in memory: to make the changes definitive in the
database, one must call explicitely the addressbook save command.
To check whether there has been changes in the database, use the
addressbook changed command.
@@ -251,10 +251,6 @@
name. The -nocase argument concerns string comparisons and requires
that no distinction be made between uppercase and lowercase letters.
- addressbook type recordID
-This command returns the type (ABPerson or ABGroup) of the record with
-unique ID recordID.
-
addressbook set recordID propertyName ?value?
This command lets you get or set the value of a particular property for the
record with unique ID recordID. If the value argument is
@@ -263,6 +259,10 @@
property propertyName will be set to this value. See the
addressbook record command for a description of the format used for the
various kinds of properties.
+
+ addressbook type recordID
+This command returns the type (ABPerson or ABGroup) of the record with
+unique ID recordID.
5. INSTALLATION
|
|
From: <bde...@us...> - 2003-12-11 08:43:52
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv14896/Help Modified Files: TclAddressBookHelp.aida Log Message: Doc [delete] Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TclAddressBookHelp.aida 11 Dec 2003 06:53:43 -0000 1.2 +++ TclAddressBookHelp.aida 11 Dec 2003 08:43:49 -0000 1.3 @@ -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-08 08:21:01 +:Modified: 2003-12-11 08:18:03 !! :Keywords: Address book, data base @@ -37,11 +37,11 @@ ((s3 addressbook changed 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 remove b)). To make +set b)), ((b addressbook create b)), ((b addressbook delete b)). To make these changes permanent, one must call the ((b addressbook save b)) command. -((s3 addressbook count (-groups | -persons) ?-ingroup groupID? +((s3 addressbook count (-groups | -persons) ?-ingroup ((i groupID i))? 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. @@ -54,6 +54,12 @@ particular group with unique ID ((i groupID i)). If no error occurs, the command returns the unique ID of the created record. +((s3 addressbook delete ((i recordID i)) ?-fromgroup ((i groupID i))? +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. + ((s3 addressbook export ((i personID i)) 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 @@ -160,16 +166,10 @@ format b)) Tcl command. It is the number of seconds relative to "Thu Jan 01 00:00:00 CET 1970". -((s3 addressbook remove ((i recordID i)) ?-fromgroup ((i groupID i))? -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. - ((s3 addressbook save 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 -remove b)) modify the data in memory: to make the changes definitive in the +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. @@ -223,10 +223,6 @@ name. The ((i -nocase i)) argument concerns string comparisons and requires that no distinction be made between uppercase and lowercase letters. -((s3 addressbook type ((i recordID i)) -This command returns the type (ABPerson or ABGroup) of the record with -unique ID ((i recordID i)). - ((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 record with unique ID ((i recordID i)). If the ((i value i)) argument is @@ -235,6 +231,10 @@ 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. + +((s3 addressbook type ((i recordID i)) +This command returns the type (ABPerson or ABGroup) of the record with +unique ID ((i recordID i)). ((s1 INSTALLATION |
|
From: <bde...@us...> - 2003-12-11 08:42:25
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv14753/Source
Modified Files:
TclAddressBook.c
Log Message:
[remove] renamed [delete]
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- TclAddressBook.c 11 Dec 2003 06:36:16 -0000 1.17
+++ TclAddressBook.c 11 Dec 2003 08:42:22 -0000 1.18
@@ -29,6 +29,7 @@
static int TclABCmd_Changed(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Count(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Create(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
+static int TclABCmd_Delete(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Export(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_GetMe(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Groups(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
@@ -38,11 +39,10 @@
static int TclABCmd_Persons(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Property(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Record(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
-static int TclABCmd_Remove(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Save(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Search(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
-static int TclABCmd_Type(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Set(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
+static int TclABCmd_Type(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
/*
@@ -121,15 +121,15 @@
int index, result;
static CONST char *switches[] = {
- "changed", "count", "create", "export", "getme", "groups",
- "image", "import", "parents", "persons", "property",
- "record", "remove", "save", "search", "set", "type", (char *) NULL
+ "changed", "count", "create", "delete", "export", "getme",
+ "groups", "image", "import", "parents", "persons",
+ "property", "record", "save", "search", "set", "type", (char *) NULL
};
enum {
- TCLAB_CHANGED, TCLAB_COUNT, TCLAB_CREATE, TCLAB_EXPORT, TCLAB_GETME, TCLAB_GROUPS,
- TCLAB_IMAGE, TCLAB_IMPORT, TCLAB_PARENTS, TCLAB_PERSONS, TCLAB_PROPERTY,
- TCLAB_RECORD, TCLAB_REMOVE, TCLAB_SAVE, TCLAB_SEARCH, TCLAB_SET, TCLAB_TYPE
+ TCLAB_CHANGED, TCLAB_COUNT, TCLAB_CREATE, TCLAB_DELETE, TCLAB_EXPORT, TCLAB_GETME,
+ TCLAB_GROUPS, TCLAB_IMAGE, TCLAB_IMPORT, TCLAB_PARENTS, TCLAB_PERSONS,
+ TCLAB_PROPERTY, TCLAB_RECORD, TCLAB_SAVE, TCLAB_SEARCH, TCLAB_SET, TCLAB_TYPE
};
resultPtr = Tcl_GetObjResult(interp);
@@ -145,10 +145,6 @@
}
switch (index) {
- case TCLAB_CREATE:
- result = TclABCmd_Create(clientData, interp, objc, objv, resultPtr);
- break;
-
case TCLAB_CHANGED:
result = TclABCmd_Changed(clientData, interp, objc, objv, resultPtr);
break;
@@ -157,6 +153,14 @@
result = TclABCmd_Count(clientData, interp, objc, objv, resultPtr);
break;
+ case TCLAB_CREATE:
+ result = TclABCmd_Create(clientData, interp, objc, objv, resultPtr);
+ break;
+
+ case TCLAB_DELETE:
+ result = TclABCmd_Delete(clientData, interp, objc, objv, resultPtr);
+ break;
+
case TCLAB_EXPORT:
result = TclABCmd_Export(clientData, interp, objc, objv, resultPtr);
break;
@@ -193,10 +197,6 @@
result = TclABCmd_Record(clientData, interp, objc, objv, resultPtr);
break;
- case TCLAB_REMOVE:
- result = TclABCmd_Remove(clientData, interp, objc, objv, resultPtr);
- break;
-
case TCLAB_SAVE:
result = TclABCmd_Save(clientData, interp, objc, objv, resultPtr);
break;
@@ -224,59 +224,6 @@
/*
*----------------------------------------------------------------------
*
- * TclABCmd_Create --
- *
- * This procedure is invoked to process the [addressbook create] Tcl command.
- * See the user documentation for details on what it does. It can be used
- * either to add a new group or person record to the database, or to add
- * a new property.
- *
- * Syntax:
- * addressbook create (group|person) name ?-ingroup groupID?
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclABCmd_Create(
- ClientData /* clientData */, /* Not used. */
- 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 index;
-
- static CONST char *createSubcmds[] = {
- "group", "person", (char *) NULL
- };
-
- enum {
- TCLAB_ADD_GROUP, TCLAB_ADD_PERSON
- };
-
- if (objc != 4 && objc != 6) {
- Tcl_WrongNumArgs(interp, 2, objv, "(group|person) name ?-ingroup groupID?");
- return TCL_ERROR;
- }
-
- if (Tcl_GetIndexFromObj(interp, objv[2], createSubcmds, "subcommand", 0, &index) != TCL_OK) {
- return TCL_ERROR;
- }
-
- return TclAB_CreateRecord(interp, objc, objv, resultPtr, index);
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
* TclABCmd_Changed --
*
* This procedure is invoked to process the [addressbook changed] Tcl command.
@@ -421,6 +368,173 @@
/*
*----------------------------------------------------------------------
*
+ * TclABCmd_Create --
+ *
+ * This procedure is invoked to process the [addressbook create] Tcl command.
+ * See the user documentation for details on what it does. It can be used
+ * either to add a new group or person record to the database, or to add
+ * a new property.
+ *
+ * Syntax:
+ * addressbook create (group|person) name ?-ingroup groupID?
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclABCmd_Create(
+ ClientData /* clientData */, /* Not used. */
+ 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 index;
+
+ static CONST char *createSubcmds[] = {
+ "group", "person", (char *) NULL
+ };
+
+ enum {
+ TCLAB_ADD_GROUP, TCLAB_ADD_PERSON
+ };
+
+ if (objc != 4 && objc != 6) {
+ Tcl_WrongNumArgs(interp, 2, objv, "(group|person) name ?-ingroup groupID?");
+ return TCL_ERROR;
+ }
+
+ if (Tcl_GetIndexFromObj(interp, objv[2], createSubcmds, "subcommand", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ }
+
+ return TclAB_CreateRecord(interp, objc, objv, resultPtr, index);
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclABCmd_Delete --
+ *
+ * This procedure is invoked to process the [addressbook delete] Tcl command.
+ * See the user documentation for details on what it does.
+ * - if -fromgroup is specified, remove recordID from the group: recordID can be
+ * either a person (remove it as a member of the group) or a group (remove it as
+ * a subgroup of the group)
+ * - otherwise, remove recordID from the database.
+ *
+ * Syntax:
+ * addressbook delete recordID ?-fromgroup groupID?
+ *
+ * Results:
+ * A standard Tcl result.
+ *
+ * Side effects:
+ * See the user documentation.
+ *
+ *----------------------------------------------------------------------
+ */
+
+int
+TclABCmd_Delete(
+ ClientData /* clientData */, /* Not used. */
+ Tcl_Interp *interp, /* Current interpreter. */
+ int objc, /* Number of arguments. */
+ Tcl_Obj *CONST objv[], /* Argument values. */
+ Tcl_Obj *resultPtr) /* Pointer to store the result. */
+{
+
+ ABAddressBookRef ab;
+ ABRecordRef theRecord, fromGroup;
+ CONST84 char * directUID;
+ CONST84 char * fromUID;
+ CFStringRef directCFStr;
+ int index, length, kind, result;
+ TextEncoding theEncoding = GetApplicationTextEncoding();
+ Boolean removingFromGroup = false;
+
+ static CONST char *rmRecSwitches[] = {
+ "-fromgroup", (char *) NULL
+ };
+
+ if (objc != 3 && objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "recordID ?-fromgroup groupID?");
+ return TCL_ERROR;
+ }
+
+ if (objc == 5) {
+ if (Tcl_GetIndexFromObj(interp, objv[3], rmRecSwitches, "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ } else {
+ fromUID = Tcl_GetStringFromObj(objv[4], &length);
+ removingFromGroup = true;
+ }
+ }
+
+ result = TCL_OK;
+ directUID = Tcl_GetStringFromObj(objv[2], &length);
+ directCFStr = CFStringCreateWithCString(NULL, directUID, theEncoding);
+
+ // Get the address book
+ ab = ABGetSharedAddressBook();
+
+ // Find the record corresponding to the UID
+ result = TclAB_RecordFromUID(ab, directCFStr, resultPtr, &theRecord);
+ CFRelease(directCFStr);
+ if (!result) {return TCL_ERROR;}
+
+ if (removingFromGroup) {
+ if ( !TclAB_CheckGroup(interp, ab, fromUID, "-fromgroup", &fromGroup) ) {
+ result = TCL_ERROR;
+ goto DONE;
+ }
+
+ // Is recordID a person or a group?
+ kind = TclAB_TypeFromRecord(ab, theRecord);
+ switch (kind) {
+ case rec_person:
+ if (!ABGroupRemoveMember(fromGroup, theRecord)) {
+ Tcl_AppendStringsToObj(resultPtr, "Couldn't remove member from group", (char *) NULL);
+ result = TCL_ERROR;
+ }
+ break;
+
+ case rec_group:
+ if (!ABGroupRemoveGroup(fromGroup, theRecord)) {
+ Tcl_AppendStringsToObj(resultPtr, "Couldn't remove subgroup from group", (char *) NULL);
+ result = TCL_ERROR;
+ }
+ break;
+
+ default:
+ Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID argument", (char *) NULL);
+ result = TCL_ERROR;
+ break;
+ }
+ CFRelease(fromGroup);
+ } else {
+ if (!ABRemoveRecord(ab, theRecord)) {
+ Tcl_AppendStringsToObj(resultPtr, "Couldn't remove record from database", (char *) NULL);
+ result = TCL_ERROR;
+ }
+ }
+
+DONE:
+ CFRelease(theRecord);
+ return result;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
* TclABCmd_Export --
*
* This procedure is invoked to process the [addressbook export] Tcl command.
@@ -1043,120 +1157,6 @@
CFRelease(theRecord);
Tcl_ResetResult(interp);
return TCL_OK;
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * TclABCmd_Remove --
- *
- * This procedure is invoked to process the [addressbook remove] Tcl command.
- * See the user documentation for details on what it does.
- * - if -fromgroup is specified, remove recordID from the group: recordID can be
- * either a person (remove it as a member of the group) or a group (remove it as
- * a subgroup of the group)
- * - otherwise, remove recordID from the database.
- *
- * Syntax:
- * addressbook remove recordID ?-fromgroup groupID?
- *
- * Results:
- * A standard Tcl result.
- *
- * Side effects:
- * See the user documentation.
- *
- *----------------------------------------------------------------------
- */
-
-int
-TclABCmd_Remove(
- ClientData /* clientData */, /* Not used. */
- Tcl_Interp *interp, /* Current interpreter. */
- int objc, /* Number of arguments. */
- Tcl_Obj *CONST objv[], /* Argument values. */
- Tcl_Obj *resultPtr) /* Pointer to store the result. */
-{
-
- ABAddressBookRef ab;
- ABRecordRef theRecord, fromGroup;
- CONST84 char * directUID;
- CONST84 char * fromUID;
- CFStringRef directCFStr;
- int index, length, kind, result;
- TextEncoding theEncoding = GetApplicationTextEncoding();
- Boolean removingFromGroup = false;
-
- static CONST char *rmRecSwitches[] = {
- "-fromgroup", (char *) NULL
- };
-
- if (objc != 3 && objc != 5) {
- Tcl_WrongNumArgs(interp, 2, objv, "recordID ?-fromgroup groupID?");
- return TCL_ERROR;
- }
-
- if (objc == 5) {
- if (Tcl_GetIndexFromObj(interp, objv[3], rmRecSwitches, "option", 0, &index) != TCL_OK) {
- return TCL_ERROR;
- } else {
- fromUID = Tcl_GetStringFromObj(objv[4], &length);
- removingFromGroup = true;
- }
- }
-
- result = TCL_OK;
- directUID = Tcl_GetStringFromObj(objv[2], &length);
- directCFStr = CFStringCreateWithCString(NULL, directUID, theEncoding);
-
- // Get the address book
- ab = ABGetSharedAddressBook();
-
- // Find the record corresponding to the UID
- result = TclAB_RecordFromUID(ab, directCFStr, resultPtr, &theRecord);
- CFRelease(directCFStr);
- if (!result) {return TCL_ERROR;}
-
- if (removingFromGroup) {
- if ( !TclAB_CheckGroup(interp, ab, fromUID, "-fromgroup", &fromGroup) ) {
- result = TCL_ERROR;
- goto DONE;
- }
-
- // Is recordID a person or a group?
- kind = TclAB_TypeFromRecord(ab, theRecord);
- switch (kind) {
- case rec_person:
- if (!ABGroupRemoveMember(fromGroup, theRecord)) {
- Tcl_AppendStringsToObj(resultPtr, "Couldn't remove member from group", (char *) NULL);
- result = TCL_ERROR;
- }
- break;
-
- case rec_group:
- if (!ABGroupRemoveGroup(fromGroup, theRecord)) {
- Tcl_AppendStringsToObj(resultPtr, "Couldn't remove subgroup from group", (char *) NULL);
- result = TCL_ERROR;
- }
- break;
-
- default:
- Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID argument", (char *) NULL);
- result = TCL_ERROR;
- break;
- }
- CFRelease(fromGroup);
- } else {
- if (!ABRemoveRecord(ab, theRecord)) {
- Tcl_AppendStringsToObj(resultPtr, "Couldn't remove record from database", (char *) NULL);
- result = TCL_ERROR;
- }
- }
-
-DONE:
- CFRelease(theRecord);
- return result;
}
|
|
From: <bde...@us...> - 2003-12-11 07:17:06
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1552/Help Modified Files: TclAddressBookHelp.html Log Message: Sync with aida file 1.2 Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TclAddressBookHelp.html 8 Dec 2003 23:12:30 -0000 1.4 +++ TclAddressBookHelp.html 11 Dec 2003 07:16:59 -0000 1.5 @@ -6,13 +6,13 @@ <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 --> +<!-- :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-08 08:21:01 --> -<!-- :Keywords: Address book, data base --> +<!-- :Keywords: Address book, data base --> <HR><BLOCKQUOTE><P><I> @@ -23,14 +23,33 @@ <LI><A HREF="#M2">SYNOPSIS</A> <LI><A HREF="#M3">INTRODUCTION</A> <LI><A HREF="#M4">SUBCOMMANDS</A> -<LI><A HREF="#M5">INSTALLATION</A> -<LI><A HREF="#M6">VERSION HISTORY</A> -<LI><A HREF="#M7">REQUIREMENTS AND PORTABILITY</A> -<LI><A HREF="#M8">KNOW ISSUES</A> -<LI><A HREF="#M9">LICENSE AND DISCLAIMER</A> -<LI><A HREF="#M10">SOURCE CODE</A> -<LI><A HREF="#M11">SEE ALSO</A> -<LI><A HREF="#M12">KEYWORDS</A> +<UL><UL><LI><A HREF="#M5">addressbook changed</A></UL></UL> +<UL><UL><LI><A HREF="#M6">addressbook count (-groups | -persons) ?-ingroup groupID?</A></UL></UL> +<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 export <I>personID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M9">addressbook getme <I>arrayvar</I></A></UL></UL> +<UL><UL><LI><A HREF="#M10">addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M11">addressbook image <I>personID</I> ?<I>imageData</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M12">addressbook import <I>vCardData</I></A></UL></UL> +<UL><UL><LI><A HREF="#M13">addressbook parents ?-ids? <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M14">addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</A></UL></UL> +<UL><UL><LI><A HREF="#M15">addressbook property names (-groups | -persons)</A></UL></UL> +<UL><UL><LI><A HREF="#M16">addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></A></UL></UL> +<UL><UL><LI><A HREF="#M17">addressbook property remove (-groups | -persons) <I>propName</I></A></UL></UL> +<UL><UL><LI><A HREF="#M18">addressbook record <I>recordID arrayvar</I></A></UL></UL> +<UL><UL><LI><A HREF="#M19">addressbook remove <I>recordID</I> ?-fromgroup <I>groupID</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 type <I>recordID</I></A></UL></UL> +<UL><UL><LI><A HREF="#M23">addressbook set <I>recordID propertyName</I> ?<I>value</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> @@ -46,231 +65,258 @@ <H2><A NAME="M3"></A> INTRODUCTION</H2> -The argument <I>subcommand</I> indicates what operation to perform. Any -unique abbreviation for each subcommand is acceptable. The valid +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> -<H5>addressbook changed</H5> -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 value</B>, -<B>addressbook create</B>, <B>addressbook remove</B>. To make these changes permanent, -one must call the <B>addressbook save</B> command. +<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 remove</B>. To make +these changes permanent, one must call the <B>addressbook save</B> +command. -<H5>addressbook count</H5> -<!-- ((s4 addressbook count (-groups | -persons) --> +<H4><A NAME="M6"></A> addressbook count (-groups | -persons) ?-ingroup groupID?</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 of this group. --> - +database. One can specify a particular group with the -ingroup option +to count only the subgroups or members in this group. -<H5>addressbook create (group | person) <I>name</I> ?-ingroup <I>groupID</I>?</H5> -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="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. -<H5>addressbook export <I>personID</I></H5> -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="M8"></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. -<H5>addressbook getme <I>arrayvar</I></H5> -This command retrieves all the data available in the database concerning the logged-in user -("Me") and stores it in the array variable specified by the <I>arrayvar</I> -argument. See the <B>addressbook record</B> -command for a description of the format of the various kinds of -properties. +<H4><A NAME="M9"></A> addressbook getme <I>arrayvar</I></H4> +This command retrieves all the data available in the database concerning +the logged-in user ("Me") and stores it in the array variable specified by +the <I>arrayvar</I> argument. See the <B>addressbook record</B> command +for a description of the format of the various kinds of properties. -<H5>addressbook groups ?-ids? ?-ingroup <I>groupID</I>?</H5> -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 +<H4><A NAME="M10"></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. -<H5>addressbook image <I>personID</I> ?<I>imageData</I>?</H5> -This command returns the custom image associated with the record -corresponding to the unique ID <I>personID</I>. If no -image exists, it raises an error. The returned bytes are binary data. +<H4><A NAME="M11"></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>. -<H5>addressbook import <I>vCardData</I></H5> -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="M12"></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. -<H5>addressbook parents ?-ids? <I>recordID</I></H5> -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="M13"></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. -<H5>addressbook persons ?-ids? ?-ingroup <I>groupID</I>?</H5> +<H4><A NAME="M14"></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. +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. -<H5>addressbook property names (-groups | -persons)</H5> -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 +<H4><A NAME="M15"></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. -<H5>addressbook property add (-groups | -persons) <I>propName</I> <I>propType</I></H5> -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 existing properties with the <B>addressbook property names</B> command. -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="M16"></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 +existing properties with the <B>addressbook property names</B> command. +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> -<H5>addressbook property remove (-groups | -persons) <I>propName</I></H5> -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="M17"></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. -<H5>addressbook record <I>recordID arrayvar</I></H5> +<H4><A NAME="M18"></A> addressbook record <I>recordID arrayvar</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 array -variable specified by the <I>arrayvar</I> argument. The keys of the array +variable specified by the <I>arrayvar</I> argument. The keys of the array (as returned by the <B>array names</B> Tcl command) are the names of the properties: the values are the current values of the corresponding -property. Only existing properties for the specified record are returned -by this command: you should unset the <I>arrayvar</I> variable before +property. Only existing properties for the specified record are returned by +this command: you should unset the <I>arrayvar</I> variable before invoking <B>addressbook record</B> in case you use this command repeatedly in order to be sure it does not keep stale information. -<P> The format used to return 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 -for fields like ABDate, MultiDictionary for the Address field. In case of a -multivalue, the returned value is a Tcl list. Each element of the list +<P> The format used to return 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 +for fields like ABDate, MultiDictionary for the Address field. In case of a +multivalue, the returned value is a Tcl list. Each element of the list corresponds to a single property. For instance: <UL> <LI> the elements of a MultiString or MultiDate value list are two-elements sublists: the first element is the label of the corresponding property (like Home, Work etc.) and the second is the value itself. <LI> the elements of a MultiDictionary value list are lists themselves, -representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl -dictionary as defined in version 8.5 of Tcl). Each element of this list -has two elements: the first one is the label describing the address (like -Home, Work etc.) and the second one is a list representing the dictionary. -The lists representing dictionaries contain two-elements 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 +representing a Label/Dictionary pair (dictionary in the AddressBook sense, +not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of +this list has two elements: the first one is the label describing the +address (like Home, Work etc.) and the second one is a list representing +the dictionary. The lists representing dictionaries contain two-elements +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> -<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". +<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". -<H5>addressbook remove <I>recordID</I> ?-fromgroup <I>groupID</I>?</H5> +<H4><A NAME="M19"></A> addressbook remove <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. +<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. -<H5>addressbook save</H5> -This command lets you save the changes made in the database. Commands such -as <B>addressbook value</B>, <B>addressbook create</B> or <B>addressbook -remove</B> modify the data in memory: to make the changes definitive in the -database, one must call explicitely the <B>addressbook save</B> command. +<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 +remove</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. -<H5>addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? <I>property op value</I></H5> +<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> <LI> <I>property</I> is the name of the property whose value will be -compared to the <I>value</I> argument +compared to the <I>value</I> argument <LI> <I>op</I> is an operator specifying the type of comparison. It can be one of the following symbols: <PRE> - ==, !=, <, <=, >, >= + ==, !=, <, <=, >, >=, ^= +</PRE> +which may have different interpretations depending on whether the value is +numeric or is a string. +<UL> + <LI> For a numeric value, they correspond respectively to: +<PRE> + == Equal + != Not Equal + < Less Than + <= Less Than or Equal + > Greater Than + >= 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: +<PRE> + == Equal + != Not Equal + < not applicable + <= not applicable + > Contains Substring + >= 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> -<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. +<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. -<H5>addressbook type <I>recordID</I></H5> +<H4><A NAME="M22"></A> addressbook type <I>recordID</I></H4> This command returns the type (ABPerson or ABGroup) of the record with unique ID <I>recordID</I>. -<H5>addressbook value <I>recordID propertyName</I> ?<I>value</I>?</H5> -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 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. -<H2><A NAME="M5"></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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This folder -should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, -more generally, in any folder contained in your <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="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 +contained in a folder called, in version 1.0, TclAddressBook1.0. This +folder should be installed on your system in /Library/Tcl or in +~/Library/Tcl or, more generally, in any folder contained in your +<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="M6"></A> VERSION HISTORY</H2> +<H2><A NAME="M25"></A> VERSION HISTORY</H2> <UL> - <LI> 1.0 - + <LI> 1.0 - </UL> -<H2><A NAME="M7"></A> REQUIREMENTS AND PORTABILITY</H2> -This extension is only useful on Macintosh platforms. Version 10.2 or +<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="M8"></A> KNOW ISSUES</H2> +<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="M9"></A> LICENSE AND DISCLAIMER</H2> +<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. -<PRE> - © Copyright Bernard Desgraupes 2003 -</PRE> +<P> © Copyright Bernard Desgraupes 2003 -<H2><A NAME="M10"></A> SOURCE CODE</H2> +<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> @@ -287,11 +333,13 @@ <A HREF="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook">http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/tcladdressbook</A> -<H2><A NAME="M11"></A> SEE ALSO</H2> +<H2><A NAME="M30"></A> SEE ALSO</H2> The Mk4Tcl extension. -<H2><A NAME="M12"></A> KEYWORDS</H2> +<H2><A NAME="M31"></A> KEYWORDS</H2> Address book, data base + + |
|
From: <bde...@us...> - 2003-12-11 07:16:52
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv1534/Help Modified Files: TclAddressBookHelp Log Message: Sync with aida file 1.2 Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TclAddressBookHelp 8 Dec 2003 23:12:24 -0000 1.4 +++ TclAddressBookHelp 11 Dec 2003 07:16:48 -0000 1.5 @@ -1,12 +1,6 @@ Title: Tcladdressbook Help Project: addressbook extension for Tcl -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-08 08:21:01 -Keywords: Address book, data base Abstract @@ -18,6 +12,25 @@ 2. SYNOPSIS 3. INTRODUCTION 4. SUBCOMMANDS + addressbook changed + addressbook count (-groups | -persons) ?-ingroup groupID? + addressbook create (group | person) name ?-ingroup groupID? + addressbook export personID + addressbook getme arrayvar + 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 arrayvar + addressbook remove recordID ?-fromgroup groupID? + addressbook save + addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value + addressbook type recordID + addressbook set recordID propertyName ?value? 5. INSTALLATION 6. VERSION HISTORY 7. REQUIREMENTS AND PORTABILITY @@ -42,206 +55,237 @@ 3. INTRODUCTION -The argument subcommand indicates what operation to perform. Any -unique abbreviation for each subcommand is acceptable. The valid +The argument subcommand indicates what operation to perform. Any +unique abbreviation for each subcommand is acceptable. The valid subcommands are explained in the next sections. 4. SUBCOMMANDS -addressbook changed -This command returns 1 if there has been changes made to the database, 0 -otherwise. Changes are made in memory with commands such as addressbook value, -addressbook create, addressbook remove. To make these changes permanent, -one must call the addressbook save command. + addressbook changed +This command returns 1 if there has been changes made to the database, 0 +otherwise. Changes are made in memory with commands such as addressbook +set, addressbook create, addressbook remove. To make +these changes permanent, one must call the addressbook save +command. -addressbook count + addressbook count (-groups | -persons) ?-ingroup groupID? This command returns the count of existing groups or persons in the -database. - +database. One can specify a particular group with the -ingroup option +to count only the subgroups or members in this group. -addressbook create (group | person) name ?-ingroup groupID? -This command lets you create a new group or a new person record. The name -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 -ingroup option one can -make the newly created record a subgroup or a member of the particular -group with unique ID groupID. If no error occurs, the command returns -the unique ID of the created record. + addressbook create (group | person) name ?-ingroup groupID? +This command lets you create a new group or a new person record. The +name 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 -ingroup +option one can make the newly created record a subgroup or a member of the +particular group with unique ID groupID. If no error occurs, the +command returns the unique ID of the created record. -addressbook export personID -This command lets you export the record with unique ID -personID as a VCard. The result should be -considered as binary data since it can contain an image associated to the -record. + addressbook export personID +This command lets you export the record with unique ID personID as +a VCard. The result should be considered as binary data since it can +contain an image associated to the record. -addressbook getme arrayvar -This command retrieves all the data available in the database concerning the logged-in user -("Me") and stores it in the array variable specified by the arrayvar -argument. See the addressbook record -command for a description of the format of the various kinds of -properties. + addressbook getme arrayvar +This command retrieves all the data available in the database concerning +the logged-in user ("Me") and stores it in the array variable specified by +the arrayvar argument. See the addressbook record command +for a description of the format of the various kinds of properties. -addressbook groups ?-ids? ?-ingroup groupID? -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 -ids argument is specified, the returned -list will contain only the unique IDs of the groups. If the -ingroup -option is specified, only the subgroups contained in the group + addressbook groups ?-ids? ?-ingroup groupID? +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 -ids argument is specified, the +returned list will contain only the unique IDs of the groups. If the +-ingroup option is specified, only the subgroups contained in the group with ID groupID will be returned. -addressbook image personID ?imageData? -This command returns the custom image associated with the record -corresponding to the unique ID personID. If no -image exists, it raises an error. The returned bytes are binary data. + addressbook image personID ?imageData? +If no imageData argument is specified, this command returns the +custom image associated with the record corresponding to the unique ID +personID. The returned bytes are binary data. If no image exists, it +raises an error. If an imageData argument is specified, it should +contain valid binary data defining an image which will be associated the +record with unique ID personID. -addressbook import vCardData -This command imports data in VCard format. The data specified by -the vCardData 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. + addressbook import vCardData +This command imports data in VCard format. The data specified by the +vCardData 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. -addressbook parents ?-ids? recordID -This command returns a list of all the groups the record with unique ID -recordID 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 -ids option is specified, only IDs are -returned. + addressbook parents ?-ids? recordID +This command returns a list of all the groups the record with unique ID +recordID 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 -ids option is specified, only IDs are +returned. -addressbook persons ?-ids? ?-ingroup groupID? + addressbook persons ?-ids? ?-ingroup groupID? 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 -ids argument is specified, the -returned list will contain only the unique IDs. If the --ingroup option is specified, only the members belonging to the group -with ID groupID will be returned. +field exists. If the -ids argument is specified, the returned list +will contain only the unique IDs. If the -ingroup option is +specified, only the members belonging to the group with ID groupID +will be returned. -addressbook property names (-groups | -persons) -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 + addressbook property names (-groups | -persons) +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 addressbook property add and addressbook property remove commands. -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 propName argument: it must be unique. One can get the list of -all the existing properties with the addressbook property names command. -The type of the property is specified by -the propType argument. This argument can have one of the following values: -Array, Data, Date, Dictionary, Integer, Real, String, MultiArray, -MultiData, MultiDate, MultiDictionary, MultiInteger, MultiReal, MultiString. + 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 +propName argument: it must be unique. One can get the list of all the +existing properties with the addressbook property names command. +The type of the property is specified by the propType argument. +This argument can have one of the following values: Array, Data, Date, +Dictionary, Integer, Real, String, MultiArray, MultiData, MultiDate, +MultiDictionary, MultiInteger, MultiReal, MultiString. -addressbook property remove (-groups | -persons) propName -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 -propName argument. One can get the list of all -the existing properties with the addressbook property names command. + addressbook property remove (-groups | -persons) propName +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 +propName argument. One can get the list of all the existing +properties with the addressbook property names command. -addressbook record recordID arrayvar + addressbook record recordID arrayvar This command retrieves all the data available in the database concerning the record with unique ID recordID and stores it in the array -variable specified by the arrayvar argument. The keys of the array +variable specified by the arrayvar argument. The keys of the array (as returned by the array names Tcl command) are the names of the properties: the values are the current values of the corresponding -property. Only existing properties for the specified record are returned -by this command: you should unset the arrayvar variable before +property. Only existing properties for the specified record are returned by +this command: you should unset the arrayvar variable before invoking addressbook record in case you use this command repeatedly in order to be sure it does not keep stale information. - The format used to return 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 -for fields like ABDate, MultiDictionary for the Address field. In case of a -multivalue, the returned value is a Tcl list. Each element of the list + The format used to return 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 +for fields like ABDate, MultiDictionary for the Address field. In case of a +multivalue, the returned value is a Tcl list. Each element of the list corresponds to a single property. For instance: the elements of a MultiString or MultiDate value list are two-elements sublists: the first element is the label of the corresponding property (like Home, Work etc.) and the second is the value itself. the elements of a MultiDictionary value list are lists themselves, -representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl -dictionary as defined in version 8.5 of Tcl). Each element of this list -has two elements: the first one is the label describing the address (like -Home, Work etc.) and the second one is a list representing the dictionary. -The lists representing dictionaries contain two-elements 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 +representing a Label/Dictionary pair (dictionary in the AddressBook sense, +not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of +this list has two elements: the first one is the label describing the +address (like Home, Work etc.) and the second one is a list representing +the dictionary. The lists representing dictionaries contain two-elements +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}. - 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". + 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". -addressbook remove recordID ?-fromgroup groupID? + addressbook remove recordID ?-fromgroup groupID? This command removes the record with unique ID recordID from the database or from a particular subgroup specified by its unique ID with the --fromgroup option. Note that any changes made to the database -won't be definitive until you invoke the addressbook save command. +-fromgroup option. Note that any changes made to the database won't +be definitive until you invoke the addressbook save command. -addressbook save -This command lets you save the changes made in the database. Commands such -as addressbook value, addressbook create or addressbook -remove modify the data in memory: to make the changes definitive in the -database, one must call explicitely the addressbook save command. + addressbook save +This command lets you save the changes made in the database. Commands such +as addressbook set, addressbook create or addressbook +remove modify the data in memory: to make the changes definitive in the +database, one must call explicitely the addressbook save command. To check whether there has been changes in the database, use the addressbook changed command. -addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value + addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? property op value 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 +compared to the value argument op is an operator specifying the type of comparison. It can be one of the following symbols: - ==, !=, <, <=, >, >= + ==, !=, <, <=, >, >=, ^= + +which may have different interpretations depending on whether the value is +numeric or is a string. + + For a numeric value, they correspond respectively to: + + == Equal + != Not Equal + < Less Than + <= Less Than or Equal + > Greater Than + >= Greater Than or Equal + ^= not applicable + +The ^= operator is not applicable (and will default to Greater Than or Equal). + + For a string value, they correspond respectively to: + + == Equal + != Not Equal + < not applicable + <= not applicable + > Contains Substring + >= Contains Substring + ^= Prefix Match + +The < and <= operators are not applicable and will both default to Equal. + + value is the value property you are searching - The -groups or -persons arguments 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. + The -groups or -persons arguments 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. -addressbook type recordID + addressbook type recordID This command returns the type (ABPerson or ABGroup) of the record with unique ID recordID. -addressbook value recordID propertyName ?value? -This command lets you get or set the value of a particular property for -the record with unique ID recordID. If the value argument is not -specified, it returns the current value of the property specified in the -propertyName argument. If value is specified, the property -propertyName will be set to this value. See the addressbook record -command for a description of the format used for the various kinds of -properties. + addressbook set recordID propertyName ?value? +This command lets you get or set the value of a particular property for the +record with unique ID recordID. If the value argument is +not specified, it returns the current value of the property specified in +the propertyName argument. If value is specified, the +property propertyName will be set to this value. See the +addressbook record command for a description of the format used for the +various kinds of properties. 5. INSTALLATION -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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This folder -should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, -more generally, in any folder contained in your auto_path Tcl variable. If -you use the extension within the AlphaX editor (version 8.0b11 or greater), -you can also install it in the Tclextensions folder which is located at the -same level as the application. +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 +contained in a folder called, in version 1.0, TclAddressBook1.0. This +folder should be installed on your system in /Library/Tcl or in +~/Library/Tcl or, more generally, in any folder contained in your +auto_path Tcl variable. If you use the extension within the AlphaX +editor (version 8.0b11 or greater), you can also install it in the +Tclextensions folder which is located at the same level as the +application. 6. VERSION HISTORY - 1.0 - + 1.0 - 7. REQUIREMENTS AND PORTABILITY -This extension is only useful on Macintosh platforms. Version 10.2 or +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). @@ -255,9 +299,7 @@ This software is free software and distributed under the same licensing terms as the Tcl language itself. See license.terms in the Tcl distribution. - - © Copyright Bernard Desgraupes 2003 - + © Copyright Bernard Desgraupes 2003 10. SOURCE CODE @@ -282,6 +324,8 @@ 12. KEYWORDS Address book, data base + + |
|
From: <bde...@us...> - 2003-12-11 06:53:46
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv30527/Help Modified Files: TclAddressBookHelp.aida Log Message: [count] has -ingroup option. [value] renamed [set] Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- TclAddressBookHelp.aida 9 Dec 2003 08:05:00 -0000 1.1 +++ TclAddressBookHelp.aida 11 Dec 2003 06:53:43 -0000 1.2 @@ -1,12 +1,12 @@ :Title: Tcladdressbook Help :Project: addressbook extension for Tcl -:Version: $Revision$ -:CVSDate: $Date$ -:Author: Bernard Desgraupes <bde...@ea...> -:Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> -:Created: 2003-11-26 14:30:03 +!! :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-08 08:21:01 -:Keywords: Address book, data base +!! :Keywords: Address book, data base ((/ @@ -27,212 +27,237 @@ ((s1 INTRODUCTION -The argument ((i subcommand i)) indicates what operation to perform. Any -unique abbreviation for each subcommand is acceptable. The valid +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. ((s1 SUBCOMMANDS -((s4 addressbook changed -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 value b)), -((b addressbook create b)), ((b addressbook remove b)). To make these changes permanent, -one must call the ((b addressbook save b)) command. +((s3 addressbook changed +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 remove b)). To make +these changes permanent, one must call the ((b addressbook save b)) +command. -((s4 addressbook count -!! ((s4 addressbook count (-groups | -persons) +((s3 addressbook count (-groups | -persons) ?-ingroup groupID? 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 of this group. - +database. One can specify a particular group with the -ingroup option +to count only the subgroups or members in this group. -((s4 addressbook create (group | person) ((i name i)) ?-ingroup ((i groupID i))? -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. +((s3 addressbook create (group | person) ((i name i)) ?-ingroup ((i groupID i))? +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. -((s4 addressbook export ((i personID i)) -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. +((s3 addressbook export ((i personID i)) +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. -((s4 addressbook getme ((i arrayvar i)) -This command retrieves all the data available in the database concerning the logged-in user -("Me") and stores it in the array variable specified by the ((i arrayvar i)) -argument. See the ((b addressbook record b)) -command for a description of the format of the various kinds of -properties. +((s3 addressbook getme ((i arrayvar i)) +This command retrieves all the data available in the database concerning +the logged-in user ("Me") and stores it in the array variable specified by +the ((i arrayvar i)) argument. See the ((b addressbook record b)) command +for a description of the format of the various kinds of properties. -((s4 addressbook groups ?-ids? ?-ingroup ((i groupID i))? -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 +((s3 addressbook groups ?-ids? ?-ingroup ((i groupID i))? +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. -((s4 addressbook image ((i personID i)) ?((i imageData i))? -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)). +((s3 addressbook image ((i personID i)) ?((i imageData i))? +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)). -((s4 addressbook import ((i vCardData i)) -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. +((s3 addressbook import ((i vCardData i)) +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. -((s4 addressbook parents ?-ids? ((i recordID i)) -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. +((s3 addressbook parents ?-ids? ((i recordID i)) +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. -((s4 addressbook persons ?-ids? ?-ingroup ((i groupID i))? +((s3 addressbook persons ?-ids? ?-ingroup ((i groupID i))? 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. +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. -((s4 addressbook property names (-groups | -persons) -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 +((s3 addressbook property names (-groups | -persons) +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. -((s4 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 ((i propName i)) argument: it must be unique. One can get the list of -all the existing properties with the ((b addressbook property names b)) command. -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)) +((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 +((i propName i)) argument: it must be unique. One can get the list of all the +existing properties with the ((b addressbook property names b)) command. +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)) -((s4 addressbook property remove (-groups | -persons) ((i propName i)) -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. +((s3 addressbook property remove (-groups | -persons) ((i propName i)) +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. -((s4 addressbook record ((i recordID arrayvar i)) +((s3 addressbook record ((i recordID arrayvar 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 array -variable specified by the ((i arrayvar i)) argument. The keys of the array +variable specified by the ((i arrayvar i)) argument. The keys of the array (as returned by the ((b array names b)) Tcl command) are the names of the properties: the values are the current values of the corresponding -property. Only existing properties for the specified record are returned -by this command: you should unset the ((i arrayvar i)) variable before +property. Only existing properties for the specified record are returned by +this command: you should unset the ((i arrayvar i)) variable before invoking ((b addressbook record b)) in case you use this command repeatedly in order to be sure it does not keep stale information. -((nl The format used to return 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 -for fields like ABDate, MultiDictionary for the Address field. In case of a -multivalue, the returned value is a Tcl list. Each element of the list +((nl The format used to return 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 +for fields like ABDate, MultiDictionary for the Address field. In case of a +multivalue, the returned value is a Tcl list. Each element of the list corresponds to a single property. For instance: ((lu ((li the elements of a MultiString or MultiDate value list are two-elements sublists: the first element is the label of the corresponding property (like Home, Work etc.) and the second is the value itself. ((li the elements of a MultiDictionary value list are lists themselves, -representing a Label/Dictionary pair (dictionary in the AddressBook sense, not a Tcl -dictionary as defined in version 8.5 of Tcl). Each element of this list -has two elements: the first one is the label describing the address (like -Home, Work etc.) and the second one is a list representing the dictionary. -The lists representing dictionaries contain two-elements 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 +representing a Label/Dictionary pair (dictionary in the AddressBook sense, +not a Tcl dictionary as defined in version 8.5 of Tcl). Each element of +this list has two elements: the first one is the label describing the +address (like Home, Work etc.) and the second one is a list representing +the dictionary. The lists representing dictionaries contain two-elements +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}. lu)) -((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 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". -((s4 addressbook remove ((i recordID i)) ?-fromgroup ((i groupID i))? +((s3 addressbook remove ((i recordID i)) ?-fromgroup ((i groupID i))? 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. +((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. -((s4 addressbook save -This command lets you save the changes made in the database. Commands such -as ((b addressbook value b)), ((b addressbook create b)) or ((b addressbook -remove b)) modify the data in memory: to make the changes definitive in the -database, one must call explicitely the ((b addressbook save b)) command. +((s3 addressbook save +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 +remove 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. -((s4 addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? ((i property op value i)) +((s3 addressbook search ?(-groups | -persons)? ?-ids? ?-nocase? ((i property op value i)) 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 +compared to the ((i value i)) argument ((li ((i op i)) is an operator specifying the type of comparison. It can be one of the following symbols: ((| - ==, !=, <, <=, >, >= + ==, !=, <, <=, >, >=, ^= |)) +which may have different interpretations depending on whether the value is +numeric or is a string. +((lu +((li For a numeric value, they correspond respectively to: +((| + == Equal + != Not Equal + < Less Than + <= Less Than or Equal + > Greater Than + >= Greater Than or Equal + ^= not applicable +|)) +The ((v ^= v)) operator is not applicable (and will default to Greater Than or Equal). + +((li For a string value, they correspond respectively to: +((| + == Equal + != Not Equal + < not applicable + <= not applicable + > Contains Substring + >= Contains Substring + ^= Prefix Match +|)) +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 lu)) -((nl 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. +((nl 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. -((s4 addressbook type ((i recordID i)) +((s3 addressbook type ((i recordID i)) This command returns the type (ABPerson or ABGroup) of the record with unique ID ((i recordID i)). -((s4 addressbook value ((i recordID propertyName i)) ?((i value i))? -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. +((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 +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. ((s1 INSTALLATION -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 -contained in a folder called, in version 1.0, TclAddressBook1.0. This folder -should be installed on your system in /Library/Tcl or in ~/Library/Tcl or, -more generally, in any folder contained in your ((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. +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 +contained in a folder called, in version 1.0, TclAddressBook1.0. This +folder should be installed on your system in /Library/Tcl or in +~/Library/Tcl or, more generally, in any folder contained in your +((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. ((s1 VERSION HISTORY ((lu -((li 1.0 - +((li 1.0 - lu)) ((s1 REQUIREMENTS AND PORTABILITY -This extension is only useful on Macintosh platforms. Version 10.2 or +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). @@ -246,9 +271,7 @@ This software is free software and distributed under the same licensing terms as the Tcl language itself. See license.terms in the Tcl distribution. -((| - © Copyright Bernard Desgraupes 2003 -|)) +((nl © Copyright Bernard Desgraupes 2003 ((s1 SOURCE CODE @@ -273,6 +296,8 @@ ((s1 KEYWORDS Address book, data base + + |
|
From: <bde...@us...> - 2003-12-11 06:45:14
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv29495/Source Modified Files: Changes.Log Log Message: 1.0d7 and d8 Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Changes.Log 6 Dec 2003 15:36:39 -0000 1.5 +++ Changes.Log 11 Dec 2003 06:45:10 -0000 1.6 @@ -31,12 +31,27 @@ = 1.0 released last update: ================================================================================ + ================================================================================ -= 1.0d7 last update: 2003-12-06 07:13:17 += 1.0d9 last update: 2003-12-11 07:42:57 +================================================================================ + + +================================================================================ += 1.0d8 last update: 2003-12-11 07:42:21 +================================================================================ + New command [search]. Works only for simple values. + Command [count] now accepts a -ingroup option. + Command [value] renamed to [set]. + +================================================================================ += 1.0d7 last update: 2003-12-09 17:31:04 ================================================================================ New [import] and [export] commands to transmit data in vCard format. New [image] command to get/set the image of a person's record. - + Renamed commands: [add] is now [create]. [properties] is now [property names], + while [property add] and [property remove] replace [add property] and + [remove property], and [remove record] returned to [remove]. ================================================================================ = 1.0d6 last update: 2003-12-06 07:10:21 |
|
From: <bde...@us...> - 2003-12-11 06:36:34
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv28292/Source Modified Files: TclAddressBook_version.h Log Message: Upped to 1.0d9 Index: TclAddressBook_version.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_version.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TclAddressBook_version.h 6 Dec 2003 06:20:44 -0000 1.3 +++ TclAddressBook_version.h 11 Dec 2003 06:36:31 -0000 1.4 @@ -1,12 +1,12 @@ // File: "TclAddressBook_version.h" // Created: 2003-09-24 07:28:22 -// Last modification: 2003-12-06 07:18:26 +// Last modification: 2003-12-11 07:32:42 // Author: Bernard Desgraupes // Description: version numbering for Tcladdressbook #define TCLADDRESSBOOK_MAJOR 1 #define TCLADDRESSBOOK_MINOR 0 -#define TCLADDRESSBOOK_SUBMINOR 7 +#define TCLADDRESSBOOK_SUBMINOR 9 #define TCLADDRESSBOOK_STAGE 'd' // 'd' for developStage // 'a' for alphaStage |
|
From: <bde...@us...> - 2003-12-11 06:36:20
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv28263/Source
Modified Files:
TclAddressBook.c
Log Message:
[count] has -ingroup option. [value] renamed [set]
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- TclAddressBook.c 9 Dec 2003 20:09:18 -0000 1.16
+++ TclAddressBook.c 11 Dec 2003 06:36:16 -0000 1.17
@@ -42,7 +42,7 @@
static int TclABCmd_Save(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Search(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
static int TclABCmd_Type(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
-static int TclABCmd_Value(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
+static int TclABCmd_Set(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[], Tcl_Obj *resultPtr);
/*
@@ -123,13 +123,13 @@
static CONST char *switches[] = {
"changed", "count", "create", "export", "getme", "groups",
"image", "import", "parents", "persons", "property",
- "record", "remove", "save", "search", "type", "value", (char *) NULL
+ "record", "remove", "save", "search", "set", "type", (char *) NULL
};
enum {
TCLAB_CHANGED, TCLAB_COUNT, TCLAB_CREATE, TCLAB_EXPORT, TCLAB_GETME, TCLAB_GROUPS,
TCLAB_IMAGE, TCLAB_IMPORT, TCLAB_PARENTS, TCLAB_PERSONS, TCLAB_PROPERTY,
- TCLAB_RECORD, TCLAB_REMOVE, TCLAB_SAVE, TCLAB_SEARCH, TCLAB_TYPE, TCLAB_VALUE
+ TCLAB_RECORD, TCLAB_REMOVE, TCLAB_SAVE, TCLAB_SEARCH, TCLAB_SET, TCLAB_TYPE
};
resultPtr = Tcl_GetObjResult(interp);
@@ -205,12 +205,12 @@
result = TclABCmd_Search(clientData, interp, objc, objv, resultPtr);
break;
- case TCLAB_TYPE:
- result = TclABCmd_Type(clientData, interp, objc, objv, resultPtr);
+ case TCLAB_SET:
+ result = TclABCmd_Set(clientData, interp, objc, objv, resultPtr);
break;
- case TCLAB_VALUE:
- result = TclABCmd_Value(clientData, interp, objc, objv, resultPtr);
+ case TCLAB_TYPE:
+ result = TclABCmd_Type(clientData, interp, objc, objv, resultPtr);
break;
default:
@@ -329,7 +329,7 @@
* See the user documentation for details on what it does.
*
* Syntax:
- * addressbook count (-groups|-persons)
+ * addressbook count (-groups|-persons) ?-ingroup groupID?
*
* Results:
* A standard Tcl result.
@@ -352,43 +352,61 @@
CFArrayRef theItems;
CFIndex theCount;
Tcl_Obj * objPtr;
- int index, result;
+ Boolean lookingInGroup = false;
+ int index, length, rectype, result;
+ ABRecordRef inGroupRef;
+ CONST84 char * inGroupUID;
static CONST char *countSwitches[] = {
- "-groups", "-persons", (char *) NULL
+ "-groups", "-persons", "-ingroup", (char *) NULL
};
enum {
- TCLAB_COUNT_GROUPS, TCLAB_COUNT_PERSONS
+ TCLAB_COUNT_GROUPS, TCLAB_COUNT_PERSONS, TCLAB_COUNT_INGROUP
};
- if (objc != 3) {
- Tcl_WrongNumArgs(interp, 2, objv, "(-groups|-persons)");
+ if (objc != 3 && objc != 5) {
+ Tcl_WrongNumArgs(interp, 2, objv, "(-groups|-persons) ?-ingroup groupID?");
return TCL_ERROR;
}
- result = TCL_OK;
-
- // Get the address book
- ab = ABGetSharedAddressBook();
-
if (Tcl_GetIndexFromObj(interp, objv[2], countSwitches,
- "option", 0, &index) != TCL_OK) {
+ "option", 0, &rectype) != TCL_OK) {
return TCL_ERROR;
}
- switch (index) {
- case TCLAB_COUNT_GROUPS:
- theItems = ABCopyArrayOfAllGroups(ab);
- break;
-
- case TCLAB_COUNT_PERSONS:
- theItems = ABCopyArrayOfAllPeople(ab);
- break;
+ if (objc == 5) {
+ if (Tcl_GetIndexFromObj(interp, objv[objc-2], countSwitches, "option", 0, &index) != TCL_OK) {
+ return TCL_ERROR;
+ } else {
+ inGroupUID = Tcl_GetStringFromObj(objv[objc-1], &length);
+ lookingInGroup = true;
+ }
+ }
+
+ // Get the address book
+ ab = ABGetSharedAddressBook();
+
+ if(lookingInGroup) {
+ if ( !TclAB_CheckGroup(interp, ab, inGroupUID, "-ingroup", &inGroupRef) ) {
+ return TCL_ERROR;
+ }
+ if (rectype == TCLAB_COUNT_GROUPS) {
+ theItems = ABGroupCopyArrayOfAllSubgroups(inGroupRef);
+ } else if (rectype == TCLAB_COUNT_PERSONS) {
+ theItems = ABGroupCopyArrayOfAllMembers(inGroupRef);
+ }
+ CFRelease(inGroupRef);
+ } else {
+ if (rectype == TCLAB_COUNT_GROUPS) {
+ theItems = ABCopyArrayOfAllGroups(ab);
+ } else if (rectype == TCLAB_COUNT_PERSONS) {
+ theItems = ABCopyArrayOfAllPeople(ab);
+ }
}
- CFRelease(theItems);
theCount = CFArrayGetCount(theItems);
+ CFRelease(theItems);
objPtr = Tcl_NewIntObj(theCount);
result = Tcl_ListObjAppendElement(interp, resultPtr, objPtr);
if (result != TCL_OK) {
@@ -1455,13 +1473,13 @@
/*
*----------------------------------------------------------------------
*
- * TclABCmd_Value --
+ * TclABCmd_Set --
*
- * This procedure is invoked to process the [addressbook value] Tcl command.
+ * This procedure is invoked to process the [addressbook set] Tcl command.
* See the user documentation for details on what it does.
*
* Syntax:
- * addressbook value recordID property ?value?
+ * addressbook set recordID property ?value?
*
* If the ?value? argument is specified, the command tries to set the
* property to that value, otherwise it returns the current value of
@@ -1477,7 +1495,7 @@
*/
int
-TclABCmd_Value(
+TclABCmd_Set(
ClientData /* clientData */, /* Not used. */
Tcl_Interp *interp, /* Current interpreter. */
int objc, /* Number of arguments. */
|
|
From: <bde...@us...> - 2003-12-09 20:09:21
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv8215/Source
Modified Files:
TclAddressBook.c
Log Message:
Using TclAB_RecordAndTypeFromUID, TclAB_MultiValueFromTcl. Improved search for multivalues
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- TclAddressBook.c 9 Dec 2003 09:06:27 -0000 1.15
+++ TclAddressBook.c 9 Dec 2003 20:09:18 -0000 1.16
@@ -432,7 +432,7 @@
ABRecordRef theRecord;
CFStringRef uidRef;
CFDataRef vCard;
- int length, kind;
+ int kind, length, result;
Tcl_Obj * objPtr;
if (objc != 3) {
@@ -444,12 +444,9 @@
// Get the address book
ab = ABGetSharedAddressBook();
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
+ if (!result) {return TCL_ERROR;}
// Is it a person or a group?
kind = TclAB_TypeFromRecord(ab, theRecord);
@@ -612,13 +609,10 @@
// Get the address book
ab = ABGetSharedAddressBook();
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
-
+ if (!result) {return TCL_ERROR;}
+
// Is it a person or a group?
kind = TclAB_TypeFromRecord(ab, theRecord);
if (kind != rec_person) {
@@ -796,7 +790,7 @@
ABRecordRef theRecord;
CONST84 char * theUID;
CFStringRef uidRef;
- int index, kind, length;
+ int index, kind, length, result;
ABAddressBookRef ab;
Boolean onlyID = false;
@@ -824,13 +818,10 @@
uidRef = CFStringCreateWithCString(NULL, theUID, GetApplicationTextEncoding());
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
-
+ if (!result) {return TCL_ERROR;}
+
// Is it a person or a group?
kind = TclAB_TypeFromRecord(ab, theRecord);
if (kind == rec_undefined) {
@@ -1001,7 +992,7 @@
CONST84 char * var;
CONST84 char * theUID;
CFStringRef uidRef;
- int length, kind;
+ int kind, length, result;
if (objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "recordID arrayvar");
@@ -1014,13 +1005,11 @@
uidRef = CFStringCreateWithCString(NULL, theUID, GetApplicationTextEncoding());
// Get the address book
ab = ABGetSharedAddressBook();
+
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
+ if (!result) {return TCL_ERROR;}
// Is it a person or a group?
kind = TclAB_TypeFromRecord(ab, theRecord);
@@ -1101,18 +1090,15 @@
result = TCL_OK;
directUID = Tcl_GetStringFromObj(objv[2], &length);
+ directCFStr = CFStringCreateWithCString(NULL, directUID, theEncoding);
// Get the address book
ab = ABGetSharedAddressBook();
- directCFStr = CFStringCreateWithCString(NULL, directUID, theEncoding);
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, directCFStr);
+ result = TclAB_RecordFromUID(ab, directCFStr, resultPtr, &theRecord);
CFRelease(directCFStr);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
+ if (!result) {return TCL_ERROR;}
if (removingFromGroup) {
if ( !TclAB_CheckGroup(interp, ab, fromUID, "-fromgroup", &fromGroup) ) {
@@ -1235,8 +1221,6 @@
CONST84 char * theValue;
CFStringRef propertyRef, valueRef;
CFArrayRef foundItemsRef;
- SInt32 theSInt32;
- double theDouble;
int i, index, opIndex, kind = rec_person, length;
TextEncoding theEncoding = GetApplicationTextEncoding();
Boolean onlyID = false;
@@ -1253,21 +1237,21 @@
};
static CONST char *searchOpSwitches[] = {
- "==", "!=", "<", "<=", ">", ">=", (char *) NULL
+ "==", "!=", "<", "<=", ">", ">=", "^=", (char *) NULL
};
// Same order as in the ABSearchComparison enum. DON'T CHANGE IT!
enum {
TCLAB_SEARCHOP_EQUAL, TCLAB_SEARCHOP_NOTEQUAL, TCLAB_SEARCHOP_LESSTHAN,
TCLAB_SEARCHOP_LESSTHANOREQUAL, TCLAB_SEARCHOP_GREATERTHAN,
- TCLAB_SEARCHOP_GREATERTHANOREQUAL,
+ TCLAB_SEARCHOP_GREATERTHANOREQUAL, TCLAB_SEARCHOP_PREFIXMATCH
};
if (objc < 5 || objc > 8) {
Tcl_WrongNumArgs(interp, 2, objv, "?(-groups|-persons)? ?-ids? ?-nocase? property op value");
return TCL_ERROR;
}
- if (objc > 6) {
+ if (objc > 5) {
for (i = objc-4; i > 1; i--) {
if (Tcl_GetIndexFromObj(interp, objv[i], searchSwitches, "option", 0, &index) != TCL_OK) {
return TCL_ERROR;
@@ -1307,40 +1291,19 @@
// Get the address book
ab = ABGetSharedAddressBook();
- thePropType = ABTypeOfProperty(ab, kind ? kABPersonRecordType : kABGroupRecordType, theProperty);
+ thePropType = ABTypeOfProperty(ab, kind ? kABPersonRecordType : kABGroupRecordType, propertyRef);
switch (thePropType) {
- case kABArrayProperty:
- case kABDictionaryProperty:
- case kABStringProperty:
- case kABMultiArrayProperty:
- case kABMultiDictionaryProperty:
- case kABMultiStringProperty:
- valueRef = CFStringCreateWithCString(NULL, theValue, theEncoding);
- break;
-
case kABDateProperty:
- case kABMultiDateProperty:
- theDouble = atof(theValue);
- theDouble -= kCFAbsoluteTimeIntervalSince1970;
- valueRef = CFDateCreate(NULL, theDouble);
- isNumeric = true;
- break;
-
case kABIntegerProperty:
case kABRealProperty:
+ case kABMultiDateProperty:
case kABMultiIntegerProperty:
case kABMultiRealProperty:
- theSInt32 = atoi(theValue);
- valueRef = CFNumberCreate(NULL, kCFNumberSInt32Type, &theSInt32);
isNumeric = true;
- break;
-
- case kABDataProperty:
- case kABMultiDataProperty:
- valueRef = NULL;
- default:
- break;
}
+
+ // Create a CF reference for the searched value
+ valueRef = TclAB_MultiValueFromTcl(interp, theValue, thePropType);
if (!valueRef) {
Tcl_AppendStringsToObj(resultPtr, "Invalid value", (char *) NULL);
CFRelease(propertyRef);
@@ -1367,6 +1330,16 @@
}
break;
+ case TCLAB_SEARCHOP_PREFIXMATCH:
+ if (isNumeric) {
+ comparison = kABGreaterThanOrEqual;
+ } else if (noCase) {
+ comparison = kABPrefixMatchCaseInsensitive;
+ } else {
+ comparison = kABPrefixMatch;
+ }
+ break;
+
case TCLAB_SEARCHOP_NOTEQUAL:
case TCLAB_SEARCHOP_LESSTHAN:
case TCLAB_SEARCHOP_LESSTHANOREQUAL:
@@ -1453,29 +1426,24 @@
// Is it a group or a person ?
// NB: we could get the type from the UID directly with the function
- // ABCopyRecordTypeFromUniqueId(). But it has been introduced only in
+ // ABCopyRecordTypeFromUniqueId() but it has been introduced only in
// Panther and is not available in Jaguar. Workaround: get the record
// reference and then the type from this record.
// typeRef = ABCopyRecordTypeFromUniqueId(ab, uidRef);
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- CFRelease(uidRef);
- return TCL_ERROR;
- }
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
+ if (!result) {return TCL_ERROR;}
typeRef = ABRecordCopyRecordType(theRecord);
CFRelease(theRecord);
-
if (!typeRef) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
+ Tcl_AppendStringsToObj(resultPtr, "Unrecognized type for record", (char *) NULL);
return TCL_ERROR;
}
if ( CFStringGetCString(typeRef, theStr, sizeof(theStr), theEncoding) ) {
Tcl_AppendStringsToObj(resultPtr, theStr, (char *) NULL);
} else {
- Tcl_AppendStringsToObj(resultPtr, "Unknown type", (char *) NULL);
+ Tcl_AppendStringsToObj(resultPtr, "CFStringGetCString error", (char *) NULL);
result = TCL_ERROR;
}
@@ -1523,7 +1491,7 @@
CFStringRef uidRef, propertyRef, valueRef;
ABRecordRef theRecord;
ABPropertyType thePropType;
- int kind, length;
+ int kind, length, result;
TextEncoding theEncoding = GetApplicationTextEncoding();
Boolean setIt = false;
@@ -1550,12 +1518,9 @@
ab = ABGetSharedAddressBook();
// Find the record corresponding to the UID
- theRecord = ABCopyRecordForUniqueId(ab, uidRef);
+ result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord);
CFRelease(uidRef);
- if (!theRecord) {
- Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
- return TCL_ERROR;
- }
+ if (!result) {return TCL_ERROR;}
// Is recordID a person or a group?
kind = TclAB_TypeFromRecord(ab, theRecord);
|
|
From: <bde...@us...> - 2003-12-09 20:07:20
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv7832/Source
Modified Files:
TclAddressBookUtils.c
Log Message:
TclAB_RecordAndTypeFromUID, TclAB_MultiValueFromTcl
Index: TclAddressBookUtils.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- TclAddressBookUtils.c 9 Dec 2003 09:06:08 -0000 1.5
+++ TclAddressBookUtils.c 9 Dec 2003 20:07:12 -0000 1.6
@@ -332,9 +332,57 @@
*----------------------------------------------------------------------
*/
-Boolean TclAB_SetValue(Tcl_Interp *interp, ABRecordRef theRecord, CFStringRef inProperty,
+Boolean TclAB_SetValue(Tcl_Interp *interp, ABRecordRef inRecord, CFStringRef inProperty,
CONST84 char * inValue, ABPropertyType inPropType)
{
+ CFStringRef 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);
+ if (theValueRef) {
+ result = ABRecordSetValue(inRecord, inProperty, theValueRef);
+ CFRelease(theValueRef);
+ }
+ return result;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclAB_MultiValueFromTcl --
+ *
+ * This function is invoked to build a CF object representing a value or
+ * multivalue from a Tcl variable or list.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ *
+ *----------------------------------------------------------------------
+ */
+// case kABStringProperty:
+// case kABMultiStringProperty:
+// case kABDateProperty:
+// case kABMultiDateProperty:
+// case kABIntegerProperty:
+// case kABRealProperty:
+// case kABDictionaryProperty:
+// case kABMultiDictionaryProperty:
+// case kABMultiIntegerProperty:
+// case kABMultiRealProperty:
+
+// case kABArrayProperty:
+// case kABDataProperty:
+// case kABMultiArrayProperty:
+// case kABMultiDataProperty:
+
+CFStringRef TclAB_MultiValueFromTcl(Tcl_Interp *interp, CONST84 char * inValue, ABPropertyType inPropType)
+{
CFStringRef theValue = NULL, subLabel, subKey, subValue;
ABMutableMultiValueRef multiValue;
CFMutableDictionaryRef theDict;
@@ -345,74 +393,31 @@
Tcl_Obj *elemPtr, *subElemPtr, *objPtr, *labelPtr, *dictPtr, *keyPtr, *valuePtr;
switch (inPropType) {
-
case kABStringProperty:
theValue = CFStringCreateWithCString(NULL, inValue, theEncoding);
- if (theValue) {
- result = ABRecordSetValue(theRecord, inProperty, theValue);
- CFRelease(theValue);
- }
- break;
+ return theValue;
case kABDateProperty:
theDouble = atof(inValue);
theDouble -= kCFAbsoluteTimeIntervalSince1970;
theValue = CFDateCreate(NULL, theDouble);
- if (theValue) {
- result = ABRecordSetValue(theRecord, inProperty, theValue);
- CFRelease(theValue);
- }
- break;
+ return theValue;
case kABIntegerProperty:
+ case kABRealProperty:
theSInt32 = atoi(inValue);
theValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theSInt32);
- if (theValue) {
- result = ABRecordSetValue(theRecord, inProperty, theValue);
- CFRelease(theValue);
- }
- break;
+ return theValue;
case kABMultiStringProperty:
- // Create a mutable multiValue
- multiValue = ABMultiValueCreateMutable();
- // Remove the old value of the property
- result = ABRecordRemoveValue(theRecord, inProperty);
- // Parse the new string value as a Tcl list of two elems sublists
- objPtr = Tcl_NewStringObj(inValue, strlen(inValue));
- Tcl_IncrRefCount(objPtr);
- Tcl_ListObjLength(interp, objPtr, &listLen);
- // Loop over all the sublists
- for (j = 0; j < listLen; j++) {
- elemPtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(j));
- labelPtr = TclLindexList(interp, elemPtr, Tcl_NewIntObj(0));
- valuePtr = TclLindexList(interp, elemPtr, Tcl_NewIntObj(1));
-
- // Make CFStrings out of the Tcl objects
- subValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), theEncoding);
- subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), theEncoding);
- // Add the value/label pair to the multivalue
- if (subValue && subLabel) {
- result = ABMultiValueAdd(multiValue, subValue, subLabel, NULL);
- CFRelease(subValue);
- CFRelease(subLabel);
- }
- }
- Tcl_DecrRefCount(objPtr);
- // Add the multivalue property to the record
- result = ABRecordSetValue(theRecord, inProperty, multiValue);
- CFRelease(multiValue);
- break;
-
-
case kABMultiDateProperty:
+ case kABMultiIntegerProperty:
+ case kABMultiRealProperty:
// Create a mutable multiValue
multiValue = ABMultiValueCreateMutable();
- // Remove the old value of the property
- result = ABRecordRemoveValue(theRecord, inProperty);
// Parse the new string value as a Tcl list of two elems sublists
objPtr = Tcl_NewStringObj(inValue, strlen(inValue));
Tcl_IncrRefCount(objPtr);
@@ -422,10 +427,26 @@
elemPtr = TclLindexList(interp, objPtr, Tcl_NewIntObj(j));
labelPtr = TclLindexList(interp, elemPtr, Tcl_NewIntObj(0));
valuePtr = TclLindexList(interp, elemPtr, Tcl_NewIntObj(1));
+
// Make CFStrings out of the Tcl objects
- theDouble = atof(Tcl_GetStringFromObj(valuePtr, &length));
- theDouble -= kCFAbsoluteTimeIntervalSince1970;
- subValue = CFDateCreate(NULL, theDouble);
+ switch (inPropType) {
+ case kABMultiStringProperty:
+ subValue = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(valuePtr, &length), theEncoding);
+ break;
+
+ case kABMultiDateProperty:
+ theDouble = atof(Tcl_GetStringFromObj(valuePtr, &length));
+ theDouble -= kCFAbsoluteTimeIntervalSince1970;
+ subValue = CFDateCreate(NULL, theDouble);
+ break;
+
+ case kABMultiIntegerProperty:
+ case kABMultiRealProperty:
+ theSInt32 = atoi(Tcl_GetStringFromObj(valuePtr, &length));
+ subValue = CFNumberCreate(NULL, kCFNumberSInt32Type, &theSInt32);
+ break;
+
+ }
subLabel = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(labelPtr, &length), theEncoding);
// Add the value/label pair to the multivalue
if (subValue && subLabel) {
@@ -435,17 +456,13 @@
}
}
Tcl_DecrRefCount(objPtr);
- // Add the multivalue property to the record
- result = ABRecordSetValue(theRecord, inProperty, multiValue);
- CFRelease(multiValue);
- break;
+ return multiValue;
+ case kABDictionaryProperty:
case kABMultiDictionaryProperty:
// Create a mutable multiValue
multiValue = ABMultiValueCreateMutable();
- // Remove the old value of the property
- result = ABRecordRemoveValue(theRecord, inProperty);
// Parse the new string value as a Tcl list of label/dictionary pairs
objPtr = Tcl_NewStringObj(inValue, strlen(inValue));
Tcl_IncrRefCount(objPtr);
@@ -484,18 +501,13 @@
Tcl_DecrRefCount(dictPtr);
}
Tcl_DecrRefCount(objPtr);
- // Add the multivalue property to the record
- result = ABRecordSetValue(theRecord, inProperty, multiValue);
- CFRelease(multiValue);
- break;
+ return multiValue;
case kABErrorInProperty:
default:
- CFRelease(theValue);
- break;
+ return theValue;
}
- return result;
}
@@ -549,6 +561,82 @@
/*
*----------------------------------------------------------------------
*
+ * TclAB_RecordFromUID --
+ *
+ * This function is invoked to determine the record corresponding
+ * to a particular UID.
+ *
+ * Results:
+ * A boolean (true if succeeded, false otherwise)
+ *
+ * Side effects:
+ * The caller is responsible for releasing the inUID CFStringRef.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Boolean TclAB_RecordFromUID(ABAddressBookRef ab, CFStringRef inUID,
+ Tcl_Obj *resultPtr, ABRecordRef * outRecordRef)
+{
+ *outRecordRef = ABCopyRecordForUniqueId(ab, inUID);
+ if (!*outRecordRef) {
+ Tcl_AppendStringsToObj(resultPtr, "Unrecognized record ID", (char *) NULL);
+ return false;
+ }
+ return true;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * TclAB_CheckGroup --
+ *
+ * This function is invoked to check the validity of an -ingroup/-fromgroup
+ * optional argument and return the corresponding record reference.
+ *
+ * Results:
+ * None.
+ *
+ * Side effects:
+ * None.
+ *
+ *----------------------------------------------------------------------
+ */
+
+Boolean TclAB_CheckGroup(Tcl_Interp *interp, ABAddressBookRef ab, CONST84 char * inGroupUID,
+ CONST84 char * option, ABRecordRef * outGroupRef)
+{
+ CFStringRef groupCFStr;
+ int kind;
+ Boolean result = true;
+
+ groupCFStr = CFStringCreateWithCString(NULL, inGroupUID, GetApplicationTextEncoding());
+ // Find the record corresponding to the UID
+ *outGroupRef = ABCopyRecordForUniqueId(ab, groupCFStr);
+ CFRelease(groupCFStr);
+ if (!*outGroupRef) {
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Unrecognized record ID in ", option,
+ " argument", (char *) NULL);
+ result = false;
+ } else {
+ // Is it really a group?
+ kind = TclAB_TypeFromRecord(ab, *outGroupRef);
+ if (kind != rec_group) {
+ Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Not a group ID in ", option,
+ " argument", (char *) NULL);
+ CFRelease(groupCFStr);
+ result = false;
+ }
+ }
+
+ return result;
+}
+
+
+/*
+ *----------------------------------------------------------------------
+ *
* TclAB_ListItems --
*
* This function is invoked by the [addressbook persons] and
@@ -727,53 +815,6 @@
}
}
}
-}
-
-
-/*
- *----------------------------------------------------------------------
- *
- * TclAB_CheckGroup --
- *
- * This function is invoked to check the validity of an -ingroup/-fromgroup
- * optional argument and return the corresponding record reference.
- *
- * Results:
- * None.
- *
- * Side effects:
- * None.
- *
- *----------------------------------------------------------------------
- */
-
-Boolean TclAB_CheckGroup(Tcl_Interp *interp, ABAddressBookRef ab, CONST84 char * inGroupUID,
- CONST84 char * option, ABRecordRef * outGroupRef)
-{
- CFStringRef groupCFStr;
- int kind;
- Boolean result = true;
-
- groupCFStr = CFStringCreateWithCString(NULL, inGroupUID, GetApplicationTextEncoding());
- // Find the record corresponding to the UID
- *outGroupRef = ABCopyRecordForUniqueId(ab, groupCFStr);
- CFRelease(groupCFStr);
- if (!*outGroupRef) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Unrecognized record ID in ", option,
- " argument", (char *) NULL);
- result = false;
- } else {
- // Is it really a group?
- kind = TclAB_TypeFromRecord(ab, *outGroupRef);
- if (kind != rec_group) {
- Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Not a group ID in ", option,
- " argument", (char *) NULL);
- CFRelease(groupCFStr);
- result = false;
- }
- }
-
- return result;
}
|
|
From: <bde...@us...> - 2003-12-09 20:06:02
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1:/tmp/cvs-serv7572/Source Modified Files: TclAddressBookUtils.h Log Message: TclAB_RecordAndTypeFromUID, TclAB_MultiValueFromTcl Index: TclAddressBookUtils.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TclAddressBookUtils.h 7 Dec 2003 16:43:21 -0000 1.3 +++ TclAddressBookUtils.h 9 Dec 2003 20:05:50 -0000 1.4 @@ -1,7 +1,7 @@ /* * File : "TclAddressBookUtils.h" * Created: 2003-12-05 10:05:19 - * Last modification: 2003-12-04 18:03:13 + * Last modification: 2003-12-09 10:29:16 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -54,6 +54,10 @@ CONST84 char * inValue, ABPropertyType inPropType); +CFStringRef TclAB_MultiValueFromTcl(Tcl_Interp *interp, + CONST84 char * inValue, + ABPropertyType inPropType); + void TclAB_ResultListFromCFArray(Tcl_Interp *interp, Tcl_Obj *resultPtr, CFArrayRef allSubGroups, @@ -98,10 +102,14 @@ CONST84 char * option, ABRecordRef * outGroupRef); +Boolean TclAB_RecordAndTypeFromUID(ABAddressBookRef ab, + CFStringRef inUID, + Tcl_Obj *resultPtr, + ABRecordRef * outRecordRef); extern Tcl_Obj * TclLindexList(Tcl_Interp* interp, - Tcl_Obj* listPtr, - Tcl_Obj* argPtr ); + Tcl_Obj* listPtr, + Tcl_Obj* argPtr ); #endif // TCLADDRESSBOOKUTILS_H |
|
From: <bde...@us...> - 2003-12-09 09:11:32
|
Update of /cvsroot/tcladdressbook/Help
In directory sc8-pr-cvs1:/tmp/cvs-serv16764/Help
Modified Files:
ReadMe
Log Message:
No automatic loading in AlphaX
Index: ReadMe
===================================================================
RCS file: /cvsroot/tcladdressbook/Help/ReadMe,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -d -r1.1.1.1 -r1.2
--- ReadMe 1 Dec 2003 16:48:46 -0000 1.1.1.1
+++ ReadMe 9 Dec 2003 09:11:27 -0000 1.2
@@ -10,8 +10,7 @@
/Library/Tcl or ~/Library/Tcl or any folder contained in your auto_path
variable. If you use it with the AlphaX editor (version 8.0b11 or greater),
you can also install it in the Tclextensions folder which is located at the
-same level as the application and it will be loaded automatically by AlphaX
-at startup.
+same level as the application.
Please read the documentation about the command in the Help file
TclAddressBookHelp.html
|
|
From: <bde...@us...> - 2003-12-09 09:09:38
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1:/tmp/cvs-serv16531/Help Modified Files: TclAB_QuickStart.tcl Log Message: First tutorial. Updated commands syntax. Index: TclAB_QuickStart.tcl =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB_QuickStart.tcl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- TclAB_QuickStart.tcl 1 Dec 2003 16:48:46 -0000 1.1.1.1 +++ TclAB_QuickStart.tcl 9 Dec 2003 09:09:35 -0000 1.2 @@ -1,55 +1,97 @@ -# http://webperso.easyconnect.fr/bdesgraupes/Downloads/Tcladdressbook1.0.sit +# This file is a tutorial that demonstrates the [addressbook] command. +# For a detailed and complete description of the syntax of each subcommand, +# see the file TclAddressBookHelp (text format) or TclAddressBookHelp.html +# (to be viewed in a browser). +# +# Author: Bernard Desgraupes +# e-mail: <bde...@ea...> +# Web page of the Tcladdressbook extension: +# http://sourceforge.net/project/showfiles.php?group_id=96169 +# +# $Date$ +# $Revision$ + + +# Load the extension package require addressbook + +# Count the existing groups and person records addressbook count -groups addressbook count -persons + +# List the groups (name and ID) addressbook groups +# List the groups (only ID) addressbook groups -ids + +# List the person records (name and ID) addressbook persons +# List the person records (only ID) 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] -addressbook record $theid arr -parray arr +# Store the info about this record in the array arrperson and display the +# results with the [parray] command +addressbook record $theid arrperson +parray arrperson +# Put the ID of the first group in the variable theid set theid [lindex [addressbook groups -ids] 0] -addressbook record $theid arr -parray arr +# Store the info about this group in the array arrgrp and display the +# results with the [parray] command +addressbook record $theid arrgrp +parray arrgrp + +# Find the type of the object corresponding to the ID $theid (ABPerson or ABGroup) addressbook type $theid + +# Get the list of all existing properties for groups or persons addressbook properties -groups addressbook properties -persons + +# Remove the record corresponding to the ID $theid from the database +addressbook remove $theid +# Check that there were changes (1 if yes, 0 if no) addressbook changed +# Save the changes to make them permanent addressbook save -set theid [lindex [addressbook persons -ids] 1] -addressbook remove $theid -# Check that there were changes -ÇÈ addressbook changed -1 -# Must save to make the remove permanent -ÇÈ addressbook save - -# Remove from a specific group +# 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 + +# List the subgroups of a specific group (name and ID) set theid [lindex [addressbook groups -ids] 2] -addressbook subgroups $theid -addressbook subgroups $theid -ids +addressbook groups $theid -ingroup $groupid +# List the subgroups of a specific group (only ID) +addressbook groups $theid -ingroup $groupid -ids + +# 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 $theid -ids |
|
From: <bde...@us...> - 2003-12-09 09:06:30
|
Update of /cvsroot/tcladdressbook/Source
In directory sc8-pr-cvs1:/tmp/cvs-serv16187/Source
Modified Files:
TclAddressBook.c
Log Message:
Local vars cleanup
Index: TclAddressBook.c
===================================================================
RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- TclAddressBook.c 9 Dec 2003 08:08:12 -0000 1.14
+++ TclAddressBook.c 9 Dec 2003 09:06:27 -0000 1.15
@@ -1,7 +1,7 @@
/*
* File : "TclAddressBook.c"
* Created: 2003-11-26 12:54:15
- * Last modification: 2003-12-07 16:51:26
+ * Last modification: 2003-12-09 09:19:10
* Author: Bernard Desgraupes
* e-mail: <bde...@ea...>
*
@@ -251,7 +251,7 @@
Tcl_Obj *CONST objv[], /* Argument values. */
Tcl_Obj *resultPtr) /* Pointer to store the result. */
{
- int index, result;
+ int index;
static CONST char *createSubcmds[] = {
"group", "person", (char *) NULL
@@ -692,7 +692,6 @@
CFIndex theCount;
char theUID[256];
int i, length, result;
- Tcl_Obj * objPtr;
unsigned char * theBytes;
Tcl_ResetResult(interp);
@@ -805,10 +804,6 @@
"-ids", (char *) NULL
};
- enum {
- TCLAB_PARENTS_IDS
- };
-
if (objc != 3 && objc != 4) {
Tcl_WrongNumArgs(interp, 2, objv, "?-ids? recordID");
return TCL_ERROR;
@@ -1237,7 +1232,6 @@
ABSearchComparison comparison;
ABPropertyType thePropType;
CONST84 char * theProperty;
- CONST84 char * theOp;
CONST84 char * theValue;
CFStringRef propertyRef, valueRef;
CFArrayRef foundItemsRef;
|