tcladdressbook-commits Mailing List for TclAddressBook (Page 3)
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: Bernard D. <bde...@us...> - 2004-08-24 06:00:11
|
Update of /cvsroot/tcladdressbook/Contribs/Tcl/AAB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2135/Contribs/Tcl/AAB Added Files: pkgIndex.tcl Log Message: First checkin --- NEW FILE: pkgIndex.tcl --- if { [catch {package require Tcl 8.4}] } { return } package ifneeded AAB 0.2 { source [file join $dir AAB.tcl] } |
|
From: Bernard D. <bde...@us...> - 2004-08-24 05:59:43
|
Update of /cvsroot/tcladdressbook/Contribs/Tcl/AAB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2068/Contribs/Tcl/AAB Added Files: AAB.tcl Log Message: First checkin --- NEW FILE: AAB.tcl --- package require addressbook 1.1 package require Tclx package provide AAB 0.2 namespace eval ::AAB {} # -------------------------------------------------------------------- # The main procs # -------------------------------------------------------------------- # AAB::getRecord # AAB::setRecord # AAB::newRecord # AAB::deleteRecord # AAB::find # AAB::findAnywhere # AAB::simpleFind # AAB::listAllRecords # # AAB::formatAddress proc ::AAB::getSelect { uid args } { set R [getRecord $uid] set res [list ] foreach key $args { lappend res [keylget R $key] } return $res } proc ::AAB::getRecord { uid } { if { [catch { set record [addressbook record $uid] } err] } { error $err } foreach key [keylkeys record] { if { [addressbook property type -persons $key] == "Date" } { set t [keylget record $key] set t [clock format $t -format "%Y-%m-%d"] keylset record $key $t } } return $record } # Set only specified keys. To erase an existing value, use NULL. proc ::AAB::setRecord { uid record } { foreach key [keylkeys record] { set t [keylget record $key] if { ![string length $t] } { set $t NULL } elseif { [addressbook property type -persons $key] == "Date" } { set t [clock scan $t] } if { [catch { addressbook set $uid $key $t } err] } { error "Could not write to record $uid. ($uid)" } } if { [catch { addressbook save } err] } { error "Could not save Addressbook. ($err)" } } proc ::AAB::newRecord { record } { if { [catch { addressbook create person [kelyget record Last] } uid] } { if { [catch { addressbook create person "" } uid] } { error "Could not create new record. ($uid)" } } setRecord $uid $record return $uid } proc ::AAB::deleteRecord { uid } { if { [catch { addressbook delete $uid } err] } { return "Could not delete record $uid. ($err)" } if { [catch { addressbook save } err] } { error "Could not save Addressbook. ($err)" } } # The argument $record is a keyed list like those returned by # [::AAB::getRecord]. For MultiTerm types like 'Address' and 'Phone' there # are two ways: either form the keyed list in all detail like this: # keylset R Address.home.City Paris # ::AAB::find $R # or form a rougher query like # keylset S Address Paris # ::AAB::find $S # (Note that in the first form, there is one more level of list nesting than # one would use with [addressbook search], which does not accept keyed list # style queries.) proc ::AAB::find { record } { foreach field [keylkeys record] { set str [keylget record $field] if { [string length $str] } { if { [addressbook property type -persons $field] == "MultiDictionary" } { # Here comes a trick for handling Multidictionary: set strList [list ] if { [catch { keylkeys record $field } placeList] } { # In this case the query is of the form {Address str} set strList [list [list "" [list "" $str]]] } else { # Split into separate queries, one for each specified place: foreach place $placeList { # Split into separate queries, one for each specified subfield: foreach subfield [keylkeys record $field.$place] { # And remove one level of braces: lappend strList [list $place [list $subfield [keylget record $field.$place.$subfield]]] } } } } elseif { [addressbook property type -persons $field] == "MultiString" } { if { [catch { keylkeys record $field } placeList] } { # In this case the query is of the form {Phone 1234} set strList [list [list "" $str]] } else { # Split up into separate queries, one for each specified # place, and also remove one level of braces... set strList [list ] foreach place $placeList { lappend strList [list $place [keylget record $field.$place]] } } } else { # For all other data types, the original $str was ok: set strList [list $str] } # Now run through the list of strings --- typically there is # only one entry in this list...: foreach str $strList { set tmpMatches [simpleFind $field $str] if { [info exists mList] } { set mList [intersect $mList $tmpMatches] } else { set mList $tmpMatches } } } } # If no search criteria are given, return all indices. if { ![info exists mList] } { set mList [listAllRecords] } if { ![llength $mList] } { error "No matches" } return $mList } proc ::AAB::simpleFind { field str } { if { [catch { set res \ [addressbook search -persons -ids -nocase $field > $str] } err] } { error "Problem in \"addressbook search\". ($err)" } return $res } # Anywhere means in text fields... proc ::AAB::findAnywhere { str } { set L [list ] foreach key [addressbook property names -persons] { switch -- [addressbook property type -persons $key] { "MultiDictionary" { set searchString [list "" [list "" $str]] } "MultiString" { set searchString [list "" $str] } "String" { set searchString $str } default { continue } } if { [catch { set res \ [addressbook search -persons -ids -nocase $key > $searchString] } err] } { error "Problem in \"addressbook search\". ($err)" } set L [union $L $res] } return $L } proc ::AAB::listAllRecords {} { return [addressbook persons -ids] } # -------------------------------------------------------------------- # Auxiliary procs # -------------------------------------------------------------------- proc keyl2arr { rec a {prefix ""} } { upvar 1 $a arr foreach key [keylkeys rec] { set val [keylget rec $key] if { [catch { keylkeys rec $key }] } { set arr(${prefix}${key}) $val } else { keyl2arr $val arr ${prefix}${key}. } } } proc ::AAB::formatAddress { uid } { set M [getRecord $uid] set pKeys [keylkeys M] set place "home" if { ![catch { set ABPF [keylget M ABPersonFlags] }] && $ABPF } { set place "work" if { [lcontain $pKeys Organization] } { append txt "[keylget M Organization]\r" } } elseif { [lsearch -regexp $pKeys (First|Last)] != -1 } { catch { append txt "[keylget M First] " } catch { append txt "[keylget M Last]" } append txt \r # if { [lcontain $pKeys Organization] } { # append txt "[keylget M Organization]\r" # } } if { [lcontain $pKeys Address] } { # Write the addresses, if any if { [catch {set A [keylget M Address.$place]}] } { error "No addrees found" } if { [lcontain [keylkeys A] Street] } { append txt "[keylget A Street]\r" } foreach c {ZIP City Province State} { if { [lcontain [keylkeys A] $c] } { append txt [keylget A $c] " " } } if { [lcontain [keylkeys A] Country] } { append txt [keylget A Country] \r } } ; # end of "Address" return $txt } |
|
From: Bernard D. <bde...@us...> - 2004-08-24 05:57:20
|
Update of /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser/AAB/plugins In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1436/plugins Log Message: Directory /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser/AAB/plugins added to the repository |
|
From: Bernard D. <bde...@us...> - 2004-08-24 05:56:39
|
Update of /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser/AAB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1237/AAB Log Message: Directory /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser/AAB added to the repository |
|
From: Bernard D. <bde...@us...> - 2004-08-24 05:56:03
|
Update of /cvsroot/tcladdressbook/Contribs/Tcl/AAB In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1043/AAB Log Message: Directory /cvsroot/tcladdressbook/Contribs/Tcl/AAB added to the repository |
|
From: Bernard D. <bde...@us...> - 2004-08-24 05:55:37
|
Update of /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv919/CardBrowser Log Message: Directory /cvsroot/tcladdressbook/Contribs/Alpha/CardBrowser added to the repository |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:45:51
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16100/Help Modified Files: TclAddressBookHelp.html Log Message: Updated for 1.1.1 Index: TclAddressBookHelp.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.html,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- TclAddressBookHelp.html 2 Aug 2004 08:09:09 -0000 1.24 +++ TclAddressBookHelp.html 8 Aug 2004 20:45:42 -0000 1.25 @@ -8,7 +8,7 @@ <P><IMG SRC="Images/TclAB_logo.gif " ALT="TclAB Logo" ALIGN=bottom></P> <P> <A HREF="TclAB.html"> Home Page</A> | <A HREF="http://sourceforge.net/projects/tcladdressbook"> Project Page at SourceForge</A><P><HR><BLOCKQUOTE><P><I> This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1. +documents version 1.1.1. </I></P></BLOCKQUOTE><HR> <UL> <LI><A HREF="#M1">NAME</A> @@ -153,7 +153,9 @@ 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.<P><H4><A NAME="M20"></A>addressbook label <I>personID</I> <I>propName</I> <I>index</I> ?<I>value</I>?</H4> +VCard. Note that the data can be binary if the VCard contains an image. +Starting from version 1.1.1 of the extension, the image is also imported by +the command as a custom icon for the record.<P><H4><A NAME="M20"></A>addressbook label <I>personID</I> <I>propName</I> <I>index</I> ?<I>value</I>?</H4> This command lets you get or set the label of a value in a multi-value property for a particular record. <P> Used without the <I>value</I> argument, the command will return the @@ -343,6 +345,8 @@ <LI> 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. <LI> 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. + <LI> 1.1.1 -- 2004/08/09 -- Technical upgrade. More error checking. +Fixed a memory leak. Images imported from VCards. </UL><P><H2><A NAME="M37"></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 @@ -369,6 +373,6 @@ See the TclX extension for keyed lists: TclX(n). See the Mk4Tcl extension for commands to open directly the database file.<P><H2><A NAME="M43"></A>KEYWORDS</H2> Address book, data base.<P><HR> -<P> Last updated 2004-08-02 10:00:52<P> +<P> Last updated 2004-08-08 22:38:01<P> </BODY> </HTML> \ No newline at end of file |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:45:40
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16073/Help Modified Files: TclAddressBookHelp.aida Log Message: Updated for 1.1.1 Index: TclAddressBookHelp.aida =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp.aida,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- TclAddressBookHelp.aida 2 Aug 2004 08:08:59 -0000 1.21 +++ TclAddressBookHelp.aida 8 Aug 2004 20:45:32 -0000 1.22 @@ -5,7 +5,7 @@ :Author: Bernard Desgraupes <bde...@ea...> :Homepage: <http://webperso.easyconnect.fr/bdesgraupes/> :Created: 2003-11-26 14:30:03 -:Modified: 2004-08-01 19:26:59 +:Modified: 2004-08-08 22:36:47 :Keywords: Address book, data base :TclCmd: set pkgversion 1.1 @@ -168,7 +168,9 @@ 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. +VCard. Note that the data can be binary if the VCard contains an image. +Starting from version 1.1.1 of the extension, the image is also imported by +the command as a custom icon for the record. ((s3 addressbook label ((i personID i)) ((i propName i)) ((i index i)) ?((i value i))? This command lets you get or set the label of a value in a multi-value property @@ -400,6 +402,8 @@ ((li 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. ((li 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. +((li 1.1.1 -- 2004/08/09 -- Technical upgrade. More error checking. +Fixed a memory leak. Images imported from VCards. lu)) |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:45:31
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16003/Help Modified Files: TclAddressBookHelp Log Message: Updated for 1.1.1 Index: TclAddressBookHelp =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAddressBookHelp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- TclAddressBookHelp 2 Aug 2004 08:08:50 -0000 1.21 +++ TclAddressBookHelp 8 Aug 2004 20:45:20 -0000 1.22 @@ -5,7 +5,7 @@ Abstract This is a manual page for the Tcladdressbook extension for Tcl. It -documents version 1.1. +documents version 1.1.1. 1. NAME @@ -192,7 +192,9 @@ 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. +VCard. Note that the data can be binary if the VCard contains an image. +Starting from version 1.1.1 of the extension, the image is also imported by +the command as a custom icon for the record. addressbook label personID propName index ?value? This command lets you get or set the label of a value in a multi-value property @@ -396,14 +398,16 @@ 6. INSTALLATION The extension is made of two files: the dynamic library (called -addressbook1.1.dylib in version 1.1) 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 TclAddressBook1.1, in version 1.1. 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. +addressbook1.1.dylib in version 1.1) 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 +TclAddressBook1.1, in version 1.1. +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. 7. VERSION HISTORY @@ -418,6 +422,8 @@ 1.1b5 -- 2004/08/01 -- New command [identifier label]. Fixed setting value with [identifier primary]. 1.1 -- 2004/08/02 -- Tests passed. Release of 1.1 version. + 1.1.1 -- 2004/08/09 -- Technical upgrade. More error checking. +Fixed a memory leak. Images imported from VCards. @@ -472,7 +478,7 @@ ---------------------------------------------------------------------- - Last updated 2004-08-02 10:02:09 + Last updated 2004-08-08 22:40:34 |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:45:02
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15938/Help Modified Files: TclAB.html Log Message: Updated for 1.1.1 Index: TclAB.html =================================================================== RCS file: /cvsroot/tcladdressbook/Help/TclAB.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TclAB.html 2 Aug 2004 08:21:09 -0000 1.4 +++ TclAB.html 8 Aug 2004 20:44:53 -0000 1.5 @@ -36,7 +36,7 @@ Binary releases of Tcladdressbook are available on the SourceForge site in the <A HREF="http://sourceforge.net/project/showfiles.php?group_id=96169"> download area</A> of the project. -<P> The latest version is <B>1.1</B>.<P><H2><A NAME="M4"></A>Source code</H2> +<P> The latest version is <B>1.1.1</B>.<P><H2><A NAME="M4"></A>Source code</H2> Tcladdressbook is an open source project. Its code is publicly available and can be found on the <A HREF="http://sourceforge.net/projects/tcladdressbook"> SourceForge site</A>. @@ -57,7 +57,7 @@ You can also address <A HREF="http://sourceforge.net/tracker/?atid=613885&group_id=96169&func=browse"> feature requests</A> and propose <A HREF="http://sourceforge.net/tracker/?atid=613884&group_id=96169&func=browse"> patches</A>.<P><P> Please e-mail about any question you might encounter: -<A HREF="mailto:bde...@us...">bde...@us...</A><P><P> Last updated 2004-08-02 10:19:18 +<A HREF="mailto:bde...@us...">bde...@us...</A><P><P> Last updated 2004-08-08 22:42:53 <HR> <P> <I>Tcladdressbook is hosted by</I> <A HREF="http://sourceforge.net"> <P><IMG SRC="http://sourceforge.net/sflogo.php?group_id=96169&type=4 " ALT="SourceForge.net Logo" ALIGN=bottom></P></A><P> |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:44:55
|
Update of /cvsroot/tcladdressbook/Help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15889/Help Modified Files: ReadMe Log Message: Updated for 1.1.1 Index: ReadMe =================================================================== RCS file: /cvsroot/tcladdressbook/Help/ReadMe,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- ReadMe 2 Aug 2004 06:32:51 -0000 1.5 +++ ReadMe 8 Aug 2004 20:44:44 -0000 1.6 @@ -1,5 +1,5 @@ -TclAddressBook 1.1 -================== +TclAddressBook 1.1.1 +==================== This is the Tcladdressbook extension implementing an [addressbook] command in Tcl. System MacOSX 10.2 or greater is required: the AddressBook framework |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:32:54
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14513/Source Modified Files: TclAddressBookUtils.c Log Message: Comment for TclAB_CheckItem Index: TclAddressBookUtils.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- TclAddressBookUtils.c 3 Aug 2004 09:52:13 -0000 1.21 +++ TclAddressBookUtils.c 8 Aug 2004 20:32:44 -0000 1.22 @@ -1,7 +1,7 @@ /* * File : "TclAddressBookUtils.c" * Created: 2003-12-05 10:08:03 - * Last modification: 2004-08-01 19:18:59 + * Last modification: 2004-08-07 21:19:06 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -652,7 +652,10 @@ * None. * * Side effects: - * None. + * Note that the function takes care of releasing the recordRef if it has + * been found but does not have the required type. This is because the + * caller, when receiving a result "false", cannot distinguish this + * situation from the case where the record itself could not be found. * *---------------------------------------------------------------------- */ @@ -681,6 +684,8 @@ kind = TclAB_TypeFromRecord(ab, *outItemRef); if (kind != inRecordType) { + // CFRelease the record. The caller won't have to release it. + CFRelease(*outItemRef); Tcl_AppendStringsToObj(Tcl_GetObjResult(interp), "Not a ", inRecordType == rec_person ? "person":"group", " ID in ", option, " argument", (char *) NULL); @@ -809,7 +814,7 @@ // Get the address book ab = ABGetSharedAddressBook(); - if(lookingInGroup) { + if (lookingInGroup) { if ( !TclAB_CheckItem(interp, ab, inGroupUID, "-ingroup", &inGroup, rec_group) ) { return TCL_ERROR; } |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:32:09
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14408/Source Modified Files: TclAddressBook.c Log Message: Image now copied when importing a VCard Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- TclAddressBook.c 3 Aug 2004 17:47:33 -0000 1.38 +++ TclAddressBook.c 8 Aug 2004 20:31:58 -0000 1.39 @@ -1,7 +1,7 @@ /* * File : "TclAddressBook.c" * Created: 2003-11-26 12:54:15 - * Last modification: 2004-08-03 11:45:18 + * Last modification: 2004-08-08 22:27:19 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -661,7 +661,8 @@ ABRecordRef theRecord; CFStringRef uidRef; CFDataRef vCard; - int kind, length, result, success; + CONST84 char * theUID; + int kind, length; Tcl_Obj * objPtr; if (objc != 3) { @@ -669,34 +670,26 @@ return TCL_ERROR; } - uidRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[2], &length), NULL); // Get the address book ab = ABGetSharedAddressBook(); - // Find the record corresponding to the UID - success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); - CFRelease(uidRef); - if (!success) {return TCL_ERROR;} - // Is it a person or a group? - kind = TclAB_TypeFromRecord(ab, theRecord); - if (kind != rec_person) { - Tcl_AppendStringsToObj(resultPtr, "Not a person record", (char *) NULL); - CFRelease(theRecord); + // Check if second argument is a person and get the corresponding record + theUID = Tcl_GetStringFromObj(objv[2], &length); + if ( !TclAB_CheckItem(interp, ab, theUID, "second", &theRecord, rec_person) ) { return TCL_ERROR; } vCard = ABPersonCopyVCardRepresentation(theRecord); + CFRelease(theRecord); if (vCard) { objPtr = Tcl_NewByteArrayObj( CFDataGetBytePtr(vCard), CFDataGetLength(vCard) ); Tcl_SetObjResult(interp, objPtr); + CFRelease(vCard); } else { Tcl_AppendStringsToObj(resultPtr, "Couldn't get vCard representation", (char *) NULL); - CFRelease(theRecord); return TCL_ERROR; } - CFRelease(vCard); - CFRelease(theRecord); return TCL_OK; } @@ -1028,7 +1021,7 @@ importedRecord = ABPersonCreateWithVCardRepresentation(vCard); CFRelease(vCard); // Adding the imported record directly to the database causes a - // crash. So we create a new record and copy the improted property/value + // crash. So we create a new record and copy the imported property/value // pairs to the new record. newRecord = ABPersonCreate(); if (!importedRecord || !newRecord) { @@ -1058,8 +1051,15 @@ } CFRelease(allProps); - // TODO: also copy the image if any - + // Also copy the image if there is one + { + CFDataRef imageRef = ABPersonCopyImageData(importedRecord); + if (imageRef) { + ABPersonSetImageData(newRecord, imageRef); + CFRelease(imageRef); + } + } + // Add the new record to the Address Book. Don't save here: leave // this to the Tcl level. if ( ABAddRecord(ab, newRecord) ) { |
|
From: Bernard D. <bde...@us...> - 2004-08-08 20:31:54
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14351/Source Modified Files: Changes.Log Log Message: Image now copied when importing a VCard Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Changes.Log 3 Aug 2004 10:13:37 -0000 1.23 +++ Changes.Log 8 Aug 2004 20:31:45 -0000 1.24 @@ -31,9 +31,10 @@ Last modification: $Date$ ================================================================================ -= 1.1.1 last update: += 1.1.1 released last update: 2004-08-07 20:52:56 ================================================================================ - Fixed subtle memory leak which happened when getting Date values. + Fixed subtle memory leak when getting Date values (Bug #1002508). + The [Import] command also copies the image if there is one when importing a VCard. More error checking. ================================================================================ |
|
From: Bernard D. <bde...@us...> - 2004-08-03 17:47:43
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4856/Source Modified Files: TclAddressBook.c Log Message: Fixed returned value in [type] after err checking Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- TclAddressBook.c 3 Aug 2004 17:17:14 -0000 1.37 +++ TclAddressBook.c 3 Aug 2004 17:47:33 -0000 1.38 @@ -2046,7 +2046,7 @@ CFStringRef typeRef; ABRecordRef theRecord; char theStr[256]; - int length, result = TCL_OK; + int length, result = TCL_OK, success; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "recordID"); @@ -2067,9 +2067,10 @@ // Panther and is not available in Jaguar. Workaround: get the record // reference and then the type from this record. // typeRef = ABCopyRecordTypeFromUniqueId(ab, uidRef); - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); CFRelease(uidRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} + typeRef = ABRecordCopyRecordType(theRecord); CFRelease(theRecord); if (!typeRef) { |
|
From: Bernard D. <bde...@us...> - 2004-08-03 17:17:24
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31110/Source Modified Files: TclAddressBook.c Log Message: Fixed confusion with boolean in [set] command Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- TclAddressBook.c 3 Aug 2004 09:53:38 -0000 1.36 +++ TclAddressBook.c 3 Aug 2004 17:17:14 -0000 1.37 @@ -601,7 +601,7 @@ ABRecordRef theRecord; CONST84 char * theUID; CFStringRef strRef; - int length, result = TCL_OK; + int length, result = TCL_OK, success; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "recordID"); @@ -615,9 +615,9 @@ ab = ABGetSharedAddressBook(); // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, strRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, strRef, resultPtr, &theRecord); CFRelease(strRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} if (!ABRemoveRecord(ab, theRecord)) { Tcl_AppendStringsToObj(resultPtr, "Couldn't remove record from database", (char *) NULL); @@ -661,7 +661,7 @@ ABRecordRef theRecord; CFStringRef uidRef; CFDataRef vCard; - int kind, length, result; + int kind, length, result, success; Tcl_Obj * objPtr; if (objc != 3) { @@ -673,9 +673,9 @@ // Get the address book ab = ABGetSharedAddressBook(); // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); CFRelease(uidRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} // Is it a person or a group? kind = TclAB_TypeFromRecord(ab, theRecord); @@ -1253,7 +1253,7 @@ ABRecordRef theRecord; CONST84 char * theUID; CFStringRef uidRef; - int index, kind, length, result; + int index, kind, length, result, success; ABAddressBookRef ab; Boolean onlyID = false; @@ -1281,9 +1281,9 @@ uidRef = CFStringCreateWithCString(NULL, theUID, NULL); // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); CFRelease(uidRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} // Is it a person or a group? kind = TclAB_TypeFromRecord(ab, theRecord); @@ -1467,7 +1467,7 @@ ABRecordRef theRecord; CONST84 char * theUID; CFStringRef uidRef; - int kind, length, result; + int kind, length, success; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "recordID"); @@ -1482,9 +1482,9 @@ ab = ABGetSharedAddressBook(); // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); CFRelease(uidRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} // Is it a person or a group? kind = TclAB_TypeFromRecord(ab, theRecord); @@ -1880,7 +1880,7 @@ CFTypeRef valueRef; ABRecordRef theRecord; ABPropertyType thePropType; - int kind, length, result = TCL_OK; + int kind, length, result = TCL_OK, success; Boolean setIt = false; if (objc != 4 && objc != 5) { @@ -1905,9 +1905,9 @@ ab = ABGetSharedAddressBook(); // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); + success = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); CFRelease(uidRef); - if (!result) {return TCL_ERROR;} + if (!success) {return TCL_ERROR;} // Is recordID a person or a group? kind = TclAB_TypeFromRecord(ab, theRecord); |
|
From: Bernard D. <bde...@us...> - 2004-08-03 10:13:54
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20641/Source Modified Files: Changes.Log Log Message: Changes for 1.1.1 Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Changes.Log 2 Aug 2004 10:23:53 -0000 1.22 +++ Changes.Log 3 Aug 2004 10:13:37 -0000 1.23 @@ -31,6 +31,12 @@ Last modification: $Date$ ================================================================================ += 1.1.1 last update: +================================================================================ + Fixed subtle memory leak which happened when getting Date values. + More error checking. + +================================================================================ = 1.1 released last update: 2004-08-02 10:26:01 ================================================================================ Tests passed. Release of 1.1 version. |
|
From: Bernard D. <bde...@us...> - 2004-08-03 09:53:48
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18164/Source Modified Files: TclAddressBook.c Log Message: More error checking. Inspected all CFRelease() calls. Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- TclAddressBook.c 2 Aug 2004 22:49:38 -0000 1.35 +++ TclAddressBook.c 3 Aug 2004 09:53:38 -0000 1.36 @@ -1,7 +1,7 @@ /* * File : "TclAddressBook.c" * Created: 2003-11-26 12:54:15 - * Last modification: 2004-08-02 09:29:40 + * Last modification: 2004-08-03 11:45:18 * Author: Bernard Desgraupes * e-mail: <bde...@ea...> * @@ -479,7 +479,7 @@ // Get the address book ab = ABGetSharedAddressBook(); - if(lookingInGroup) { + if (lookingInGroup) { if ( !TclAB_CheckItem(interp, ab, inGroupUID, "-ingroup", &inGroupRef, rec_group) ) { return TCL_ERROR; } @@ -497,13 +497,18 @@ } } - theCount = CFArrayGetCount(theItems); - CFRelease(theItems); - objPtr = Tcl_NewIntObj(theCount); - result = Tcl_ListObjAppendElement(interp, resultPtr, objPtr); - if (result != TCL_OK) { - Tcl_DecrRefCount(objPtr); + if (!theItems) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get list of groups", (char *) NULL); return TCL_ERROR; + } else { + theCount = CFArrayGetCount(theItems); + CFRelease(theItems); + objPtr = Tcl_NewIntObj(theCount); + result = Tcl_ListObjAppendElement(interp, resultPtr, objPtr); + if (result != TCL_OK) { + Tcl_DecrRefCount(objPtr); + return TCL_ERROR; + } } return TCL_OK; @@ -911,6 +916,7 @@ ABRecordRef theRecord; CFStringRef uidRef; CFDataRef imageRef; + CONST84 char * theUID; int length, kind, result = TCL_OK; Tcl_Obj * objPtr; Boolean setIt = false; @@ -928,19 +934,12 @@ setIt = true; } - uidRef = CFStringCreateWithCString(NULL, Tcl_GetStringFromObj(objv[2], &length), NULL); // Get the address book ab = ABGetSharedAddressBook(); - // Find the record corresponding to the UID - result = TclAB_RecordFromUID(ab, uidRef, resultPtr, &theRecord); - CFRelease(uidRef); - if (!result) {return TCL_ERROR;} - - // Is it a person or a group? - kind = TclAB_TypeFromRecord(ab, theRecord); - if (kind != rec_person) { - Tcl_AppendStringsToObj(resultPtr, "Not a person record", (char *) NULL); - CFRelease(theRecord); + + // Check if second argument is a person and get the corresponding record + theUID = Tcl_GetStringFromObj(objv[2], &length); + if ( !TclAB_CheckItem(interp, ab, theUID, "personID", &theRecord, rec_person) ) { return TCL_ERROR; } @@ -1040,37 +1039,42 @@ ab = ABGetSharedAddressBook(); // Loop over all the properties and copy them the the new record allProps = ABCopyArrayOfPropertiesForRecordType(ab, kABPersonRecordType); - theCount = CFArrayGetCount(allProps); - for (i = 0; i < theCount; i++) { - // Get the property at index i - theProperty = CFArrayGetValueAtIndex(allProps, i); - if (theProperty) { - theValue = ABRecordCopyValue(importedRecord, theProperty); - if (!theValue) { - continue; + if (!allProps) { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get list of properties", (char *) NULL); + result = TCL_ERROR; + } else { + theCount = CFArrayGetCount(allProps); + for (i = 0; i < theCount; i++) { + // Get the property at index i + theProperty = CFArrayGetValueAtIndex(allProps, i); + if (theProperty) { + theValue = ABRecordCopyValue(importedRecord, theProperty); + if (!theValue) { + continue; + } + ABRecordSetValue(newRecord, theProperty, theValue); + CFRelease(theValue); + } + } + CFRelease(allProps); + + // TODO: also copy the image if any + + // Add the new record to the Address Book. Don't save here: leave + // this to the Tcl level. + if ( ABAddRecord(ab, newRecord) ) { + // Retrieve the UID for the newly created record + uidRef = ABRecordCopyUniqueId(newRecord); + if (uidRef) { + CFStringGetCString(uidRef, theUID, sizeof(theUID), NULL); + CFRelease(uidRef); + Tcl_AppendStringsToObj(resultPtr, theUID, (char *) NULL); } - ABRecordSetValue(newRecord, theProperty, theValue); - CFRelease(theValue); + } else { + Tcl_AppendStringsToObj(resultPtr, "Couldn't add record to the Address Book", (char *) NULL); + result = TCL_ERROR; } } - if (allProps) CFRelease(allProps); - - // TODO: also copy the image if any - - // Add the new record to the Address Book. Don't save here: leave - // this to the Tcl level. - if ( ABAddRecord(ab, newRecord) ) { - // Retrieve the UID for the newly created record - uidRef = ABRecordCopyUniqueId(newRecord); - if (uidRef) { - CFStringGetCString(uidRef, theUID, sizeof(theUID), NULL); - CFRelease(uidRef); - Tcl_AppendStringsToObj(resultPtr, theUID, (char *) NULL); - } - } else { - Tcl_AppendStringsToObj(resultPtr, "Couldn't add record to the Address Book", (char *) NULL); - result = TCL_ERROR; - } } if (importedRecord) CFRelease(importedRecord); if (newRecord) CFRelease(newRecord); @@ -1285,6 +1289,7 @@ kind = TclAB_TypeFromRecord(ab, theRecord); if (kind == rec_undefined) { Tcl_AppendStringsToObj(resultPtr, "Unknown type for recordID argument", (char *) NULL); + CFRelease(theRecord); return TCL_ERROR; } @@ -1756,6 +1761,7 @@ // Create a CF reference for the searched value, the label and the key if (!TclAB_MakeSearchRefFromTcl(interp, theValue, thePropType, &labelRef, &keyRef, &valueRef)) { + CFRelease(propertyRef); return TCL_ERROR; } if (!valueRef) { @@ -1870,10 +1876,11 @@ CONST84 char * theProperty; CONST84 char * theUID; CONST84 char * theNewVal; - CFStringRef uidRef, propertyRef, valueRef; + CFStringRef uidRef, propertyRef; + CFTypeRef valueRef; ABRecordRef theRecord; ABPropertyType thePropType; - int kind, length, result; + int kind, length, result = TCL_OK; Boolean setIt = false; if (objc != 4 && objc != 5) { @@ -1893,7 +1900,6 @@ // Make CFString objects uidRef = CFStringCreateWithCString(NULL, theUID, NULL); - propertyRef = CFStringCreateWithCString(NULL, theProperty, kCFStringEncodingUTF8); // Get the address book ab = ABGetSharedAddressBook(); @@ -1907,43 +1913,47 @@ kind = TclAB_TypeFromRecord(ab, theRecord); // Find the property type (string, date, multivalue...) - if (kind == rec_person) { - thePropType = ABTypeOfProperty(ab, kABPersonRecordType, propertyRef); - } else { - thePropType = ABTypeOfProperty(ab, kABGroupRecordType, propertyRef); - } - if (thePropType == kABErrorInProperty) { - Tcl_AppendStringsToObj(resultPtr, "Unknown property '", theProperty, - "' for ", kind ? "Person":"Group" , " records", (char *) NULL); - CFRelease(propertyRef); - CFRelease(theRecord); - return TCL_ERROR; - } - + propertyRef = CFStringCreateWithCString(NULL, theProperty, kCFStringEncodingUTF8); if (propertyRef) { + if (kind == rec_person) { + thePropType = ABTypeOfProperty(ab, kABPersonRecordType, propertyRef); + } else { + thePropType = ABTypeOfProperty(ab, kABGroupRecordType, propertyRef); + } + if (thePropType == kABErrorInProperty) { + Tcl_AppendStringsToObj(resultPtr, "Unknown property '", theProperty, + "' for ", kind ? "Person":"Group" , " records", (char *) NULL); + CFRelease(propertyRef); + result = TCL_ERROR; + goto DONE; + } + if (setIt) { if (!TclAB_SetValue(interp, theRecord, propertyRef, theNewVal, thePropType)) { Tcl_AppendStringsToObj(resultPtr, "Couldn't set value for '", theProperty, "' property", (char *) NULL); - CFRelease(propertyRef); - return TCL_ERROR; + result = TCL_ERROR; } } else { valueRef = ABRecordCopyValue(theRecord, propertyRef); if (!valueRef) { Tcl_AppendStringsToObj(resultPtr, "Couldn't get value of '", theProperty, "' for this record", (char *) NULL); - CFRelease(propertyRef); - return TCL_ERROR; - } - TclAB_GetValue(interp, ab, propertyRef, valueRef, 0, kind); - CFRelease(valueRef); + result = TCL_ERROR; + } else { + TclAB_GetValue(interp, ab, propertyRef, valueRef, 0, kind); + CFRelease(valueRef); + } } CFRelease(propertyRef); + } else { + Tcl_AppendStringsToObj(resultPtr, "Couldn't get property ref", (char *) NULL); + result = TCL_ERROR; } +DONE: CFRelease(theRecord); - return TCL_OK; + return result; } |
|
From: Bernard D. <bde...@us...> - 2004-08-03 09:53:13
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18073/Source Modified Files: TclAddressBookUtils.h Log Message: CFTypeRef vs CFStringRef Index: TclAddressBookUtils.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- TclAddressBookUtils.h 1 Aug 2004 17:59:19 -0000 1.13 +++ TclAddressBookUtils.h 3 Aug 2004 09:53:02 -0000 1.14 @@ -43,7 +43,7 @@ void TclAB_GetValue(Tcl_Interp *interp, ABAddressBookRef ab, CFStringRef theProperty, - CFStringRef theValue, + CFTypeRef theValue, Boolean allValues, int inRecordType); |
|
From: Bernard D. <bde...@us...> - 2004-08-03 09:52:22
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17998/Source Modified Files: TclAddressBookUtils.c Log Message: Fixed mem leak due to CFStringCreateCopy call on CFDate type. Replace by CFRetain(). Index: TclAddressBookUtils.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBookUtils.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- TclAddressBookUtils.c 1 Aug 2004 17:58:59 -0000 1.20 +++ TclAddressBookUtils.c 3 Aug 2004 09:52:13 -0000 1.21 @@ -69,7 +69,8 @@ ABRecordRef inRecord, int inRecordType) { CFIndex theCount; - CFStringRef theValue, theProperty; + CFStringRef theProperty; + CFTypeRef theValue; CFArrayRef allProps; int i; @@ -118,11 +119,11 @@ void TclAB_GetValue(Tcl_Interp *interp, ABAddressBookRef ab, - CFStringRef inProperty, CFStringRef inValue, + CFStringRef inProperty, CFTypeRef inValue, Boolean allValues, int inRecordType) { - CFStringRef theValue, subValue, subLabel; - CFStringRef localizedStr; + CFStringRef subLabel, subValue, localizedStr; + CFTypeRef theValue; CFAbsoluteTime theAbsTime; ABPropertyType thePropType; ABMutableMultiValueRef multiValue; @@ -134,8 +135,7 @@ SInt32 theSInt32; unsigned int mvCount; Tcl_DString ds; - - + if (CFStringGetCString(inProperty, thePropName, sizeof(thePropName), NULL)) { if (inRecordType == rec_person) { @@ -143,8 +143,9 @@ } else { thePropType = ABTypeOfProperty(ab, kABGroupRecordType, inProperty); } - // Make a local copy of the CFStringRef - theValue = CFStringCreateCopy(NULL, inValue); + // Work on a local "copy" of the CFStringRef. Not sure this is + // necessary since inValue already has a retain count equal to 1. + theValue = CFRetain(inValue); if (theValue) { switch (thePropType) { |
|
From: Bernard D. <bde...@us...> - 2004-08-03 09:51:26
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17918/Source Modified Files: TclAddressBook_version.h Log Message: Bumping to 1.1.1 Index: TclAddressBook_version.h =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook_version.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- TclAddressBook_version.h 2 Aug 2004 05:40:52 -0000 1.10 +++ TclAddressBook_version.h 3 Aug 2004 09:51:14 -0000 1.11 @@ -1,12 +1,12 @@ // File: "TclAddressBook_version.h" // Created: 2003-09-24 07:28:22 -// Last modification: 2004-08-01 20:05:10 +// Last modification: 2004-08-02 23:39:54 // Author: Bernard Desgraupes // Description: version numbering for Tcladdressbook #define TCLADDRESSBOOK_MAJOR 1 #define TCLADDRESSBOOK_MINOR 1 -#define TCLADDRESSBOOK_SUBMINOR 0 +#define TCLADDRESSBOOK_SUBMINOR 1 #define TCLADDRESSBOOK_STAGE 'f' // 'd' for developStage // 'a' for alphaStage |
|
From: Bernard D. <bde...@us...> - 2004-08-02 22:49:54
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23720/Source Modified Files: TclAddressBook.c Log Message: Test if GetMe returns NULL Index: TclAddressBook.c =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- TclAddressBook.c 2 Aug 2004 07:37:19 -0000 1.34 +++ TclAddressBook.c 2 Aug 2004 22:49:38 -0000 1.35 @@ -725,6 +725,7 @@ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { ABAddressBookRef ab; + ABPersonRef myRecord; static CONST char *getmeSwitches[] = { "-id", (char *) NULL @@ -740,23 +741,28 @@ // Get the address book ab = ABGetSharedAddressBook(); - if (objc == 3) { - char theUID[256]; - CFStringRef uniqueId; - int index; - - if (Tcl_GetIndexFromObj(interp, objv[2], getmeSwitches, "option", 0, &index) != TCL_OK) { - return TCL_ERROR; - } - uniqueId = ABRecordCopyUniqueId(ABGetMe(ab)); - CFStringGetCString(uniqueId, theUID, sizeof(theUID), NULL); - CFRelease(uniqueId); - Tcl_SetObjResult(interp, Tcl_NewStringObj(theUID, strlen(theUID))); - } else { - // Store the record's data in the result object - TclAB_GetAllValues(interp, ab, ABGetMe(ab), rec_person); - } + myRecord = ABGetMe(ab); + if (myRecord) { + CFRetain(myRecord); + if (objc == 3) { + char theUID[256]; + CFStringRef uniqueId; + int index; + + if (Tcl_GetIndexFromObj(interp, objv[2], getmeSwitches, "option", 0, &index) != TCL_OK) { + return TCL_ERROR; + } + uniqueId = ABRecordCopyUniqueId(myRecord); + CFStringGetCString(uniqueId, theUID, sizeof(theUID), NULL); + CFRelease(uniqueId); + Tcl_SetObjResult(interp, Tcl_NewStringObj(theUID, strlen(theUID))); + } else { + // Store the record's data in the result object + TclAB_GetAllValues(interp, ab, myRecord, rec_person); + } + CFRelease(myRecord); + } return TCL_OK; } |
|
From: Bernard D. <bde...@us...> - 2004-08-02 10:24:06
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9026/Source Modified Files: Changes.Log Log Message: 1.1 released Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Changes.Log 2 Aug 2004 09:32:23 -0000 1.21 +++ Changes.Log 2 Aug 2004 10:23:53 -0000 1.22 @@ -31,7 +31,12 @@ Last modification: $Date$ ================================================================================ -= 1.1 last update: 2004-08-02 05:40:35 += 1.1 released last update: 2004-08-02 10:26:01 +================================================================================ + Tests passed. Release of 1.1 version. + +================================================================================ += 1.1b5 last update: 2004-08-01 17:18:15 ================================================================================ Command [addressbook identifier primary] can now set value. New command [addressbook label] to get/set the label of an item in |
|
From: Daniel A. S. <da...@us...> - 2004-08-02 09:32:50
|
Update of /cvsroot/tcladdressbook/Source/TclAddressBook.pbproj In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2522/Source/TclAddressBook.pbproj Modified Files: project.pbxproj Log Message: fixes for 1.1, building against Tcl.framework outside of /Library/Frameworks, added license file Index: project.pbxproj =================================================================== RCS file: /cvsroot/tcladdressbook/Source/TclAddressBook.pbproj/project.pbxproj,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- project.pbxproj 11 Dec 2003 11:20:02 -0000 1.2 +++ project.pbxproj 2 Aug 2004 09:32:40 -0000 1.3 @@ -232,7 +232,6 @@ buildActionMask = 2147483647; files = ( F5509190036C35B40130931B, - F5A272830377DE8E01FEA954, D1004D1205887D9B003C0555, D1004D7805888A3F003C0555, ); @@ -250,7 +249,7 @@ CC = "gcc-3.3"; CPLUSPLUS = "g++-3.3"; DYLIB_COMPATIBILITY_VERSION = 1.0; - DYLIB_CURRENT_VERSION = 1.0; + DYLIB_CURRENT_VERSION = 1.1; DYLIB_INSTALLED_NAME = "addressbook${DYLIB_CURRENT_VERSION}.dylib"; EXPORTED_SYMBOLS_FILE = TclAddressBook.exp; FRAMEWORK_SEARCH_PATHS = ""; @@ -262,12 +261,12 @@ LIBRARY_STYLE = DYNAMIC; OPTIMIZATION_CFLAGS = "-O0"; OTHER_CFLAGS = ""; - OTHER_LDFLAGS = ""; + OTHER_LDFLAGS = "-ltclstub8.4"; OTHER_LIBTOOL_FLAGS = ""; OTHER_REZFLAGS = ""; PRECOMPILE_PREFIX_HEADER = NO; PREFIX_HEADER = ""; - PRODUCT_NAME = addressbook1.0.dylib; + PRODUCT_NAME = addressbook1.1.dylib; SECTORDER_FLAGS = ""; USE_GCC3_PFE_SUPPORT = YES; WARNING_CFLAGS = "-Wmost -Wno-four-char-constants -Wno-unknown-pragmas"; @@ -282,7 +281,7 @@ }; F550918E036C35030130931B = { isa = PBXLibraryReference; - path = addressbook1.0.dylib; + path = addressbook1.1.dylib; refType = 3; }; F5509190036C35B40130931B = { @@ -297,12 +296,6 @@ path = /Library/Frameworks/Tcl.framework/libtclstub8.4.a; refType = 0; }; - F5A272830377DE8E01FEA954 = { - fileRef = F5A272820377DE8D01FEA954; - isa = PBXBuildFile; - settings = { - }; - }; //F50 //F51 //F52 |
|
From: Daniel A. S. <da...@us...> - 2004-08-02 09:32:49
|
Update of /cvsroot/tcladdressbook/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2522/Source Modified Files: Changes.Log Log Message: fixes for 1.1, building against Tcl.framework outside of /Library/Frameworks, added license file Index: Changes.Log =================================================================== RCS file: /cvsroot/tcladdressbook/Source/Changes.Log,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- Changes.Log 2 Aug 2004 05:40:35 -0000 1.20 +++ Changes.Log 2 Aug 2004 09:32:23 -0000 1.21 @@ -31,7 +31,7 @@ Last modification: $Date$ ================================================================================ -= 1.1b5 last update: += 1.1 last update: 2004-08-02 05:40:35 ================================================================================ Command [addressbook identifier primary] can now set value. New command [addressbook label] to get/set the label of an item in |