Re: Treo650 SPRINT new firmware: error VFSDBCache.c, Line:4051, unattached record

2005-03-31 Thread Chris Faherty
On Thursday 31 March 2005 03:20, Lukas Zeller wrote:

 So I'll be going back to a previous workaround posted by Chris
 Faherty, which only resizes the record to size 0 and sets
 dmRecAttrDelete and dmRecAttrDirty. As I do not have a SPRINT Treo
 here, I do not know yet if this really fixes the issue.

I was wrong.  DmResizeRecord() calls MemHandleResize() and you can't have a 
chunk size of 0, so I think it will fail.

DmAttachRecord() is fine to use NULL as the handle for the record.

 *  PARAMETERS: 
 *  dbR - reference to open database
 *  *atP- desired index to insert record at, actual 
index on return.
 *  newH- MemHandle of new record or NULL (if NULL, 
record's localChunkID
 *field will be set to zero in the 
record list)
 *  *oldHP  - MemHandle of replaced record returned here (this 
record chunk
 *is orphaned - dmOrphanOwnerID).

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: Treo650 SPRINT new firmware: error VFSDBCache.c, Line:4051, unattached record

2005-03-31 Thread Chris Faherty
On Thursday 31 March 2005 11:54, Lukas Zeller wrote:

 Where did you copy this from? I believe I looked up DmAttachRecord in
 the most recent PalmOS docs and did not find the note about passing a
 NULL pointer. Anyway, documented or not, doing so reliably crashes
 the new SPRINT Treo at next call to DmSyncDatabase().

The PalmOS 3.5 sources, available by signing up somewhere years ago.  Not 
sure where to get it now, likely still available from one of the Palm 
companies.

Yeah hard to tell what's changed since 3.5.  I looked at the MemPtrResize() 
and I see that setting it to zero size is discouraged but not illegal.  Not 
sure of the ramifications of having a zero-size chunk connected to a record 
versus no chunk at all.

Really though I don't even think it's all that important, what size the 
chunk is.  You could probably just leave it as-is.  Once the sync process 
sees the delete attribute, the record will be removed.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: Treo 650 (GSM) crashing on delete record!

2005-02-21 Thread Chris Faherty
On Sunday 20 February 2005 09:43, Ralph Curtis wrote:

 I am having a problem with the 650. It crashes when my app performs a
 DmDeleteRecord call for a valid record!

Perhaps you can you perform the DmDeleteRecord() in other ways..  From what 
I understand, it simply shrinks the chunk and sets the attributes.

UInt16 attr;

DmResizeRecord(MainDB, index, 0); /* i think you can do this */
DmRecordInfo(MainDB, index, attr, NULL, NULL);
attr |= dmRecAttrDelete|dmRecAttrDirty;
DmSetRecordInfo(MainDB, index, attr, NULL);

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: POSE complains Win APIs called before valid draw window

2005-02-19 Thread Chris Faherty
On Saturday 19 February 2005 23:29, Luc Le Blanc wrote:
 When my app initializes its preferences for the first time, it computes
 color indexes based on certain RGB values. By calling WinRGBToIndex, I
 am sure to get indexes based on the current screen resolution. This
 works fine on real devices, but POSE brings up a fatal alert (with no
 Continue button, just Debug and Reset) stating that I called a Win API
 before establishing a valid draw window. I'm not drawing anything, just
 performing RGB conversions.  Should I worry? Since I found no way of
 turning off this specific error detection, I should minimaly detect
 whether I'm running on POSE and skip that code that prevents any further
 debugging.

If you are stuck, you can do this at startup:

WinSetDrawWindow(WinGetDisplayWindow());

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: PODS vs CodeWarrior

2005-02-18 Thread Chris Faherty
On Monday 14 February 2005 14:05, Cory Pratt wrote:

 I use prc-tools (the compiler used by PODS) on Linux exclusively
 and I am sure that I am not alone.

I'm still using multilink with my prc-tools :-)  It's simply awesome.  One 
project is up to 9 32K segments.  I just keep adding and adding code without 
any issues.

Is prc-tools (and PODS) still using that do-it-yourself segmentation?  Ugh.  
That would be quite a shame.

The issues I've had with CodeWarrior.  Perhaps they don't apply any longer:

- Debug was painfully slow when single stepping.

- Seemed to require upgrading for every SDK.  Wouldn't be much of an issue,
  but for the fact that upgrading often broke my toolchain and gave me the
  usual Windows syndrome of half-baked installs.

- Makes these weirdo .frk directories and zero-length files, and all around
  messes up my source controls with its binary touching goodness.  One
  time, I parked a 100% working project, and several months later I opened
  it up again, and it wouldn't build!

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: PODS vs CodeWarrior

2005-02-18 Thread Chris Faherty
On Friday 18 February 2005 16:36, Ben Combee wrote:

 That's an artifact of Constructor.  V9 still uses Constructor if you want,
 but defaults to a new Palm OS 68K Linker and PilRC for resources.

Hi.  Does it still use the .frk and zero-length files etc?  I was under the 
impression that those were something required initially from when it was 
ported off the Mac.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: Replacing password with asterisks in text field?

2005-02-11 Thread Chris Faherty
On Thursday 10 February 2005 08:56, Roger Stringer wrote:

 This has been discussed many times in the past, so check the archives for
 the various solution.

global var
--
MemHandle passwordFontH;

In StartApplication()
-
FontPtr fontP;

/* define special password font */
if ((passwordFontH = DmGetResource('NFNT', PasswordFont))) {
if ((fontP = MemHandleLock(passwordFontH))) {
FntDefineFont((FontID)128, fontP);
}
}

In StopApplication()

if (passwordFontH) {
MemHandleUnlock(passwordFontH);
DmReleaseResource(passwordFontH);
}

Where you define your field
--
FldSetFont(fldp, (FontID)128);

*or* if you use textTableItem style, in your LoadItem()
---
TblSetItemFont(tableP, row, column, (FontID)128);

In your .rcp

FONT ID PasswordFont FONTID 128 password-font.txt
#use any resource ID you want for PassWordFont

password-font.txt
-
fontType 36864
ascent 9
descent 2

GLYPH ' '
--
--
-#-#--
--#---
##-##-
--#---
-#-#--
--
--
--
--

GLYPH -1
--
--
-#-#--
--#---
##-##-
--#---
-#-#--
--
--
--
--

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: Replacing password with asterisks in text field?

2005-02-11 Thread Chris Faherty
On Friday 11 February 2005 03:05, Chris Faherty wrote:

 global var etc etc etc

Actually there may be a problem with the code I reposted and OS6.  Not sure 
what's wrong, though I recall it not looking right on the Cobalt simulator.  
I haven't investigated it though.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/


Re: Get day of week from system date

2004-08-06 Thread Chris Faherty
On Friday 06 August 2004 08:51 am, Chris Hall wrote:

 Does anyone have a code sample of how to extract the system date and find
 out what day of the week it is?

DateTimeType dt;
UInt16 dow;

TimSecondsToDateTime(TimGetSeconds(), dt);
dow = DayOfWeek(dt.month, dt.day, dt.year);

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Treo 600 Development

2004-07-27 Thread Chris Faherty
On Tuesday 27 July 2004 02:36 am, Edward P. Ross wrote:

 Well - HsGetPhoneLibrary is Treo 600 specific API (from the PluggedIn
 site)

 What I am saying is that it's returning nothing.  Interestingly enough,
 the PhoneInfo sample that comes in another zip file does the same thing
 - which leads be to believe that there's something missing in the Treo
 simulator.

 Can anyone comment?

Can't say why it doesn't work.  You can try the backwards-compatible way, 
which is to use a LoadPhoneLibrary() like function.  The SimpleSMS example 
shows this.

I actually wasn't aware of HsGetPhoneLibrary().  Seems like they should have 
at least made it into a macro, rather than a trap, so that code would work 
on older Treos.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: palmsim hanging on Win98

2004-07-27 Thread Chris Faherty
On Tuesday 27 July 2004 02:00 pm, Kenneth Wang wrote:

 ..I'm using Win98 on a fairly old machine (AMD proc, 500MHz).
 A responder via tools-forum suggested I use Windows 2000 or XP, but
 this is not an option for me, and the PalmSource page on the simulator
 says it's tested on 98.  Anyway, after starting things up, I can run
 built-in apps in the simulator fine.  But when I install a prc, even
 very simple ones, things inconsistently hang, with the Task Manager
 telling me PalmSim is not responding.

Try 5.1.  Simulators past 5.1 hang for me as well on Windows 98.  It's not 
your fault :-)  They're broken.

If you must use  5.1, you can try this.  Place your files in the AutoLoad 
directory instead of installing via the UI.  That helps.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Selected Cell in the Table

2004-07-26 Thread Chris Faherty
On Monday 26 July 2004 01:13 pm, Dorot?a Karine wrote:

 I have a table in m application and my table has a
 label column and then a data column who's cells can be
 a mixture of all the table cell styles.
 When my table has anything but a textTableItem in the
 last row, second
 column, then all the other rows that have
 textTableItems in them do not
 highlight correctly - the whole row gets highlighted,
 not just the cell from
 the column before it. Then when I select another row,
 the previously
 selected row has some visual artifacts from the bad
 highlighting.

 I've tried this on a number of devices and simulators.

When you initialize your table.. what you want to do is use 
TblSetColumnEditIndicator(,, false) on the columns to the right of your 
label column.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: problem with calling FrmGotoForm

2004-07-25 Thread Chris Faherty
On Sunday 25 July 2004 10:18 pm, druid wrote:

 I call a popup from main with a menu selection
 from the popup I have another menu
 WHen I select an Item form the Popup's menu I want the
 current popup to close and open the new popup

What I like to do is use frmUpdateEvent as a popup dispatcher.  In my main 
form's event handler, I'll do something like this:

case frmUpdateEvent:
switch (e-data.frmUpdate.updateCode) {
case frmRedrawUpdateCode:
FrmDrawForm(FrmGetActiveForm());
break;
case UC_POPUP1_START:
FrmPopupForm(POPUP1);
break;
case UC_POPUP1_STOP:
/* maybe I want to do something whenever POPUP1 is dismissed */
break;
case UC_POPUP2_START:
FrmPopupForm(POPUP2);
break;
case UC_POPUP2_STOP:
break;
}
return true;

When I want to fire off a popup, I'll use FrmUpdateForm().  Likewise, from 
the popup's handler, I'll use FrmUpdateForm() to indicate to the caller 
that the popup has been dismissed.

For example, to start popup from anywhere:

FrmUpdateForm(MainForm, UC_POPUP1_START);

And inside the popup's handler, when I want to dismiss:

FrmUpdateForm(MainForm, UC_POPUP1_STOP);
FrmReturnToForm(MainForm);

And, as per your example, if I wanted to cause a transition from POPUP1 to 
POPUP2, I would do it one of two ways.

From POPUP1:

FrmUpdateForm(MainForm, UC_POPUP1_STOP);
FrmUpdateForm(MainForm, UC_POPUP2_START);
FrmReturnToForm(MainForm);

Or I would put some logic in case UC_POPUP1_STOP to do it in the caller.  
That is more likely since I would want to snarf some stuff prior to the 
secondary popup.

To be honest, I don't really use UC_POPUP1_START.. I just FrmPopupForm() 
wherever I need it.  And I use multiple update codes depending on what type 
of popup dismissal (OK, Cancel, etc).  My point is, that using 
FrmUpdateForm() from your popup's handler is a way to notify the calling 
form what it should do next.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: for Annada Prasana

2004-07-02 Thread Chris Faherty
On Friday 02 July 2004 02:33 am, Gaurav Mengi wrote:

 Hi Annada,
 I've tested the application and it runs successfully if I try to
 communicate between ::
 1)Two palm Simulators
 2)between simulator running on windows mchine and another application
 running on linux machine..

 But when i try to run on the device..ie I'm only able to send the data
 from the device but cannot receive the data.

 I'm sending u a code which works fine on TReo 270 where I'm using a dial
 up but  not Tungsten C where i'm using wi-fi.

I have it in my notes that I did this:

MemSet((char *) saddr, sizeof(saddr), 0);
NetLibSocketBind(refnum, sock, (NetSocketAddrType *) saddr,
sizeof(saddr), timeout, errno);

Which will fail in the emulator, but was required to get PalmOS on the 
device to assign a non-zero (unreachable) source port.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: for Annada Prasana

2004-07-02 Thread Chris Faherty
On Friday 02 July 2004 04:25 am, Gaurav Mengi wrote:
 Hi Annada,
  I was waiting for some pointers from ur side...

 As u have mentioned I had already done that..

 I'll be glad If u can send me the code(snapshot) of N/w Programming using
 UDP Sockets which works successfully on the device...especially
 the snapshot of that code where ur receiving the message

In case it helps.  Here is what I've used.  Ignore the DNS cache stuff.  
This gives a random receive port.  From my server I reply to whatever port 
the packet indicates.

I noticed that in your code you don't NetLibSocketConnect().  This may not 
be required with UDP, but I wouldn't be surprised if PalmOS gets messed up 
without it.

Int16 connectsockudp(char *host, char *service, UInt16 refnum, Int32 timeout)
{
NetSocketRef sock;
Int16 one;
Int16 i1;
NetSocketAddrINType saddr;
NetHostInfoPtr phe;
NetHostInfoBufType AppHostInfo;
Boolean nameresolved=false;
UInt32 hosthash;

one = 1;

MemSet((char *) saddr, sizeof(saddr), 0);
saddr.family = netSocketAddrINET;
saddr.port = NetHToNS(StrAToI(service));

if ((sock = NetLibSocketOpen(refnum, netSocketAddrINET,
netSocketTypeDatagram, 0, timeout, errno))  0) {
return 0;
}

/* see if we can use our DNS cache */
if (!FtrGet(MainAppID, FTR_HOSTHASH, hosthash) 
(rotating_hash(host, StrLen(host)) == hosthash) 
!FtrGet(MainAppID, FTR_HOSTIP, (UInt32 *)saddr.addr)) {
nameresolved = true;
}

/*
 * Map host name to IP address, allowing for dotted decimal.
 * I try to assimilate the name first to see if it is just
 * a dotted IP.  If not, then I use the DNS to resolve.
 *
 * Also it tries to retrieve a cached IP from a feature.
 */
if (!nameresolved ||
((saddr.addr = NetLibAddrAToIN(refnum, host)) == -1)) {
if ((phe = NetLibGetHostByName(refnum, host, AppHostInfo,
timeout, errno)) != 0) {
/*
 * Sometimes the first address in the list is zero.  This
 * makes me have to search through them to find the first
 * non-zero address.
 */
for (i1=0; i1  netDNSMaxAddresses; i1++) {
if (phe-addrListP[i1] != NULL) {
if (*phe-addrListP[i1] != '\0') {
MemMove((char *) saddr.addr,
(char *) phe-addrListP[i1], phe-addrLen);
nameresolved = true;
break;
}
}
}
}
if (!nameresolved) {
NetLibSocketClose(refnum, sock, timeout, errno);
return 0;
} else {
/*
 * Cache the IP to make future lookups quicker.  Note that
 * I store a hash of the hostname only to validate the need for
 * an uncached DNS lookup later.
 */
FtrSet(MainAppID, FTR_HOSTHASH, rotating_hash(host, 
StrLen(host)));
FtrSet(MainAppID, FTR_HOSTIP, (UInt32)saddr.addr);
}
}

if (NetLibSocketConnect(refnum, sock, (NetSocketAddrType *) saddr,
sizeof(saddr), timeout, errno) != 0) {
NetLibSocketClose(refnum, sock, timeout, errno);
return 0;
}

/* set to non-blocking */
NetLibSocketOptionSet(refnum, sock, netSocketOptLevelSocket,
netSocketOptSockNonBlocking, one, sizeof(one), timeout, errno);
/* turn off Nagle */
NetLibSocketOptionSet(refnum, sock, netSocketOptLevelTCP,
netSocketOptTCPNoDelay, one, sizeof(one), timeout, errno);

/*
 * This usually fails in the emulator.  It's needed to have PalmOS
 * assign a non-zero source port.
 */
MemSet((char *) saddr, sizeof(saddr), 0);
NetLibSocketBind(refnum, sock, (NetSocketAddrType *) saddr,
sizeof(saddr), timeout, errno);

return sock;
} 

An example of receiving a UDP packet:

NetFDSetType rfds, wfds;
unsigned char buf[32];

netFDZero(rfds);
netFDZero(wfds);
netFDSet(sysFileDescStdIn, rfds);
netFDSet(udpsock, rfds);
rv = NetLibSelect(appref, netFDSetSize, rfds, wfds, NULL, tp,
err);
if ((rv  0)  netFDIsSet(udpsock, rfds) 
((bytes = NetLibReceive(appref, udpsock, buf,
sizeof(buf), 0, 0, 0, 1, err)) == 16) 
(buf[0] == 0xa5)  (buf[1] == 0x5a)) {
ispacket = true;
/* success */
if (buf[6] == 1) ismail = true; /* now we'll do a full POP */
break;
}

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: URGENT QUESTION - What is the real free memory?

2004-07-01 Thread Chris Faherty
On Thursday 01 July 2004 02:07 pm, Desenvolvimento 3 wrote:

 To get the free space must I have to do anything more than using
 MemCardInfo function?

Do a search here for GetOSFreeMem.  I'd post the search result but it was 
about 1,000 characters.

http://kb.palmsource.com

That function does a bunch of voodoo fuzzy math.  Comes out with a number I 
can live with.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Treo600 serial #

2004-06-24 Thread Chris Faherty
On Thursday 24 June 2004 01:49 pm, Keyur Patwa wrote:

 You need to use the following function call for that.

 PhnLibCardInfo (refNum,0,0,version,serial);

 It is I think defined in SystemMgr.h file.

There's also an example in Treo600_ALL_Samples.zip/PhoneInfo.zip from 
pluggedin.palmos.com.  Don't forget to free the returned serial text.  Took 
me a week to find that memory leak :)  I had thought it was a ptr into ROM 
but it isn't.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Treo600 serial #

2004-06-24 Thread Chris Faherty
On Thursday 24 June 2004 01:52 pm, Chris Faherty wrote:

  PhnLibCardInfo (refNum,0,0,version,serial);

I should also mention that it can be flaky unless the phone power is on.  
I've had it return  on occasion with the older Treos and I think I 
saw it do that on the 600 as well.  I half-believe that it sends a AT 
command to the modem LOL.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: MenuHideItem problem

2004-06-14 Thread Chris Faherty
On Monday 14 June 2004 12:27 pm, Shannon wrote:

(re broken MenuHideItem on OS 3.5)

 Why isn't this working? Am I going to have to resort to creating separate
 menus?

Unfortunately I think you'll have to implement a work-around, such as using 
separate menus, for OS 3.5.  I've had the same problem, and in searching 
around, I found that it is terminally broken.

Why isn't a fix included in the glue library?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Packing records

2004-06-11 Thread Chris Faherty
On Friday 11 June 2004 04:08 pm, E F wrote:

 In the application I have to cycle through records and display the
 apporpriate one based on certain criteria.  I am assumng when cycling
 through them now, I would have to unpack it, read it and continue.  This
 seems like it would slow down the application pretty well.

 Am I missing something?  Or is there a better way to go?

I started using numbered fields when I found how useful they were on the  
BlackBerry.  I use a number (tag) to represent a field, and my record chunk 
is several fields concatenated in no particular order.

[len][tag][data][len][tag][data]..

When I want a field, I lock the record chunk and then skip through the 
fields until I find the field's tag.  I make a function such as 
len=get_field(recp, NAME_TAG, ptr).  Often I will read-only access the 
field via the ptr and len, for convenience and speed.

The advantages are that you can shrink or grow a field since it isn't 
positional, and it's quick to get to a field since you are just skipping 
[len] then comparing [tag] and so on until [tag] matches what you want.  
It's also nice to be able to obsolete a particular field or have a different 
set of fields in each record.  You no longer have to migrate your data to 
fit a new schema, you simply begin supporting some newer field tags.

The PalmOS typical pack/unpack is not so good.  Lots of times a record has 
back-to-back strings and unpacking always involves copying it into RAM 
structures.

The RIM way is to deref each field, getting a ptr and len, within a locked 
record for read-only access.  For writing, they have a load() save() 
symantic which uses RAM.  For example, you would load() the record, make 
field changes, and when you save() it would commit the changes.

So that's what I would suggest.  While you are cycling through records, you 
deref only the fields you need in a record with some type of get_field() 
function.  And if you need to change the record, you make a copy into RAM, 
change the fields with individual set_field() delete_field() etc, and then 
replace the existing record.  For improved speed, you may hack the record 
directly without making a RAM copy.. but you'd loose the transactional 
safety of replacing the record as a whole.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Changing number of visible items in a list

2004-06-09 Thread Chris Faherty
On Wednesday 09 June 2004 02:50 am, Kyle Dorian wrote:

 Is there any way to change the number of visible items displayed in a list
 during runtime?

http://www.palmos.com/dev/support/docs/palmos/List.html

LstSetHeight Function ^TOP^
Purpose

Set the number of items visible in a list.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: TimGetTicks and Zire 21

2004-06-06 Thread Chris Faherty
On Sunday 06 June 2004 04:07 pm, Doug Pogue wrote:

 I developed a stopwatch application for my Palm IIIx and it keeps
 perfect time. I bought a new Zire 21 and when I use the same application
 it loses 1 second every 10 minutes! I am using the TimGetTicks api call.

Just a FYI, you probably know this..

(PalmOS docs)
  TimGetTicks Function
  Purpose

  Return the tick count since the last reset. The tick count does not
  advance while the device is in sleep mode.

Perhaps it does advance on some devices, but I know that it doesn't on at 
least some of them.  Are you allowing the device to sleep, or are you 
keeping it awake?  And along those lines, see if it makes a difference.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: How to open few network connections?

2004-06-03 Thread Chris Faherty
On Thursday 03 June 2004 05:57 am, Petr Stetina wrote:

 Yes - without SysTaskDelay () following NetLibSocketShutdown () causes
 probably premature closing of socket and transmited data are lost even
 if last NetLibSend () did not return any error.

I looked up the SO_LINGER, and if disabled it will not attempt to send 
pending data during a close().  NetLibSocketShutdown() seems superfluous to 
me.  It takes a while to send pending data and ultimately close both sides 
of a connection.

What you can try is setting the linger time yourself (instead of zero in my 
example).  That should make NetLibClose() block for a maximum time or until 
the pending data is sent.

linger.onOff = true;
linger.time = 10;

The default way I believe is to return from NetLibClose() immediately and 
then do the pending and connection closing in the network thread.

Or you can change your protocol to work through a single connection.  Or you 
can have the server disconnect when complete and then recognize that via a 
client-side read of zero bytes.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: How to open few network connections?

2004-06-02 Thread Chris Faherty
On Wednesday 02 June 2004 09:42 am, Petr Stetina wrote:

 What should I change in my app to overcome this problem?

NetSocketLingerType linger;

linger.onOff = true;
linger.time = 0;
NetLibSocketOptionSet(AppNetRefnum, sock, netSocketOptLevelSocket,
netSocketOptSockLinger, linger, sizeof(linger), AppNetTimeout,
errno);

That should help.  I remember running into that issue before.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: How to open few network connections?

2004-06-02 Thread Chris Faherty
On Wednesday 02 June 2004 06:33 pm, Petr Stetina wrote:

 Thanks, it works fine but in order to make app working I have added
 SysTaskDelay next to last NetLibSend:

  SysTaskDelay (SysTicksPerSecond ());

  if (NetLibSocketShutdown (netLib, dataSocket, netSocketDirBoth, -1,
 err) != 0) printf (Cannot shut connection down.\n);

  if (ExNetLibSocketClose (netLib, dataSocket, -1, err) != 0) printf
 (Cannot close data connection.\n);
  else printf (Data connection closed.\n);

 Additional delay causes significant degradation of transfer rate. Is
 there another way how to solve this issue? I also try to reduce number
 of ticks delayed but with lower number of ticks connection lost portion
 of data sent to server.

What is the SysTaskDelay() for?  What happens when you don't use it.. does 
the socket shutdown before data arrives at the other end or something?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Keyboard question

2004-05-25 Thread Chris Faherty
On Tuesday 25 May 2004 10:28 am, Dana Long wrote:

 I'm still working on masking a password field and am now forced to deal
 with the user selecting the keyboard modal form and entering text that
 way.

global var
--
MemHandle passwordFontH;

In StartApplication()
-
FontPtr fontP;

/* define special password font */
if ((passwordFontH = DmGetResource('NFNT', PasswordFont))) {
if ((fontP = MemHandleLock(passwordFontH))) {
FntDefineFont((FontID)128, fontP);
}
}

In StopApplication()

if (passwordFontH) {
MemHandleUnlock(passwordFontH);
DmReleaseResource(passwordFontH);
}

Where you define you field
--
FldSetFont(fldp, (FontID)128);

*or* if you use textTableItem style, in your LoadItem()
---
TblSetItemFont(tableP, row, column, (FontID)128);

In your .rcp

FONT ID PasswordFont FONTID 128 password-font.txt
#use any resource ID you want for PassWordFont

password-font.txt
-
fontType 36864
ascent 9
descent 2

GLYPH ' '
--
--
-#-#--
--#---
##-##-
--#---
-#-#--
--
--
--
--

GLYPH -1
--
--
-#-#--
--#---
##-##-
--#---
-#-#--
--
--
--
--

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: database header

2004-05-21 Thread Chris Faherty
On Friday 21 May 2004 03:28 pm, [EMAIL PROTECTED] wrote:

 The problem is how to identify, based on the bytes being dowloaded, if the
 file is a database or not.

You could check how 'file' does it, or shell to it:

$ file SysZLib.prc
SysZLib.prc: Palm OS dynamic library data ZLib

$ file menuhack.prc
menuhack.prc: HackMaster hack MenuHack HACK

$ file stainout.prc
stainout.prc: AportisDoc file Stain-Removal-Guide

then again, it sometimes doesn't indicate anything on perfectly good files..

$ file AddressDB.pdb
AddressDB.pdb: data

versus

$ file rfc804.pdb
rfc804.pdb: AportisDoc file rfc804

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: What technique to determine active/inactive

2004-05-20 Thread Chris Faherty
On Thursday 20 May 2004 01:20 am, RVRoadie wrote:

 Thanks, do you also use a ftr to store DB refs so you don't have to
 open/close on each callback? Same for Mathlib and other library
 references?

At first I did, but ultimately I decided against it.  Instead, I just 
layered things so that I opened things only when needed during the callback. 
For example, my old code would have an OpenDatabases() and CloseDatabases() 
function.  I have over 20 database files so it became slower and slower to 
open them all at once.  What I do now is I open a database the first time it 
is used in a session and I keep track of which ones I've opened, so that I 
can close them.

Libraries which are in use cannot be replaced, so when my code was keeping 
them open while backgrounded, I used the hotsync start/end signals as 
opportunities to close/open the libraries.  Worked ok, until I was required 
to use Nutshell installer.  Nutshell installer doesn't send the sync start 
notification, so I got stuck when upgrading libraries because I had no idea 
when the install was to occur.  That led me to change the behavior and 
open/close the libraries during each callback session.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: What technique to determine active/inactive

2004-05-19 Thread Chris Faherty
On Wednesday 19 May 2004 07:51 pm, RVRoadie wrote:

 What technique is best for determining whether you are the active program,
 or you are receiving a background notification or callback?

My vote is to use a ftr as a flag while you are in the foreground.  Just 
cover the bases (i.e. clear it after hotsync in case a stale ftr exists) so 
that its value is correct in all circumstances.  Everything else, in my 
experience, wound up being complicated and/or unreliable.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Auto application termination

2004-05-18 Thread Chris Faherty
On Tuesday 18 May 2004 02:34 pm, Dana Long wrote:

 I handle the sysAppLaunchCmdDisplayAlarm command in StarterPalmMain()
 by calling AppStop(), then AppStart() and then FrmGotoForm(LoginForm).

Seems like it would be simpler to just relaunch the application with 
SysUIAppSwitch() if you want to start fresh.  Why can't you just 
FrmGotoForm(LoginForm) from your displayalarm without AppStop(), AppStart() 
etc?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: DmSetDatabaseInfo() on OS 5.x is locking my appinfo!

2004-05-07 Thread Chris Faherty
On Friday 07 May 2004 03:37 am, Ben Combee wrote:

 I don't see anything in the code of Palm OS 5.4 that would cause the chunk
 you assign as the appInfo block to be locked.  Can you provide sample code
 that shows this bug?

Thanks for checking.  I will post a full example as soon as I can.  Sorry 
for the confusing pseudo below.  Basically I did:

.. create new file
DmGetDatabaseLockState() /* get highest,count,busy */
.. print values

DmNewHandle() /* create appinfo */
DmWrite() /* copy stuff to it */
MemHandleUnlock() /* unlock the appinfo */
MemHandleToLocalID() /* prepare for assignment */

DmSetDatabaseInfo() /* assign appinfo */

/* placeholder */

DmGetDatabaseLockState()
.. print values

The print values before showed highest=0,count=0,busy=0.
The print values after  showed highest=1,count=1,busy=0.

No records in database.  If I used NULL for the appinfoID parameter of 
DmSetDatabaseInfo() then it was highest=0,count=0,busy=0.

Also if I do this:

MemLocalIDToGlobal() /* the appinfo parameter above */
if (MemHandleLockCount()) MemHandleUnlock()

.. at /* placeholder */ it will show highest=0,count=0,busy=0 so I know it 
is the appinfo.

Was using OS 5.3 simulator both debug  release.  I will do some more 
experiments and provide a better example as soon as I can.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


DmSetDatabaseInfo() on OS 5.x is locking my appinfo!

2004-05-06 Thread Chris Faherty
Can someone please check the DmSetDatabaseInfo() function in OS 5.x to see 
why it is locking the appinfo when it is assigned.  The older OSs don't do 
that.

Are the OS 5.x limited sources available through NDA like the older ones?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: epoch time

2004-04-04 Thread Chris Faherty
On Sunday 04 April 2004 11:20 am, Vu Pham wrote:

 I am just curious, why PalmOS chooses 01/01/1904 as its epoch time when
 PalmOS is not as old as Unix ?

Simple answer.. Mac Weenies :-)

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: code too big - linker problem

2004-03-29 Thread Chris Faherty
On Monday 29 March 2004 03:14 pm, Jan Bandouch wrote:

 2) Whats easier and faster to implement? A shared library (I have a
 source file that I link that has no globals and statics and would make a
 good lib), or the multi-segmenting?
 Both seem to be quite some work (especially without CodeWarrior), and
 I'm running a little out of time, as my app should be finished by
 wednesday. Well, guess it won't, but anyway, help or tips appreciated.

I think the easiest thing would be to use prc-tools multi-section support.  
You need to change your Makefile a little, make a .def file, and add an 
attribute macro to each function proto you would like to exist in a 
non-default section.

I was having pretty good success with that until I ran into unsurmountable 
issues with a project which does foreground/background operations.  I could 
not fit all functions which I needed to call from a timer/non-global-launch 
within one 32K section.  So I had to go back to using Multilink.  I didn't 
want to use it (i.e. will it work in the future?), but alas, it has saved my 
bacon once again.  My code is now at 4 sections!

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: encryption/decryption Palm Database

2004-03-03 Thread Chris Faherty
On Wednesday 03 March 2004 04:25 am, Ron Nicholson wrote:

   http://www.coopcomp.com/AESLib/

I'm using that one.  Very nice.  This is probably in a FAQ, but if you test 
it in the simulator you should force 68K mode as the simulator is x86 and 
will crash when it tries to run the ARM code.

FtrSet(AESLibCreatorID, AESLibFtrNumForce68K, 1);

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Gotchas with Notifications?

2004-03-02 Thread Chris Faherty
On Tuesday 02 March 2004 08:53 pm, Walt Bilofsky wrote:

 I found that updating the app with a HotSync will move its address, so
 then the next notification goes to the wrong place and gives a message
 like
(snip)
 So it turns its notifications off before the HotSync and back on again
 after.

You should also be aware of procedure alarms.  I believe anything which is 
registered as a callback will give you problems when your function moves.  
But, the thing is, you must use the original function address in order to 
unregister/cancel the pending operation.  With procedure alarms, you will 
need to store the original function address within a feature so that you can 
cancel/reschedule a pending alarm in your hotsync code.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Developer Suite - mirrors?

2004-02-27 Thread Chris Faherty
On Friday 27 February 2004 03:04 pm, David A. Desrosiers wrote:

   Now, if only we could get the Simulators and PODS running in Wine,
 that would be a good leap forward (nudge, nudge). I hate loading up vmware
 to fit it all in there (and darnit, PODS filled the image, so I had to
 expand the virtual disk to add the extra 670 megs to install it all =).

I bought Win4Lin 3.0 a while back (year or two) when they had a promotion 
running.  It was like $49.99.  Best money spent ever!!!  I spent another $20 
or so to upgrade to 5.x.  I think they have a promotion now with 5.x for 
like $69.99.

It's not as capable as vmware, as I have that too laying around.  But the 
performance is stunning, and not having to use a separate file store makes 
things much easier for development.  As is typical, games won't work nearly 
as well as they do in wine(x).  And you're stuck with the win9x platform.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Developer Suite - mirrors?

2004-02-27 Thread Chris Faherty
On Friday 27 February 2004 05:46 pm, David A. Desrosiers wrote:

   For me, there's another blocker: win4lin doesn't support USB.

   I absolutely require USB for my development tasks.

I hear ya.  For me it's USB, Bluetooth, and IrDA, none of which I can get 
working with win4lin.  Someone supposedly got IrDA going, but it never has 
worked with my dongle.  Perhaps in the future this stuff will work.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Developer Suite - mirrors?

2004-02-27 Thread Chris Faherty
On Friday 27 February 2004 06:03 pm, David A. Desrosiers wrote:

   And all of the above works out of the box with VMware. It isn't
 cheap..

It used to be :-)  I think I paid $89 for my old vmware.  Unfortunately it 
ran like molasses next to win4lin.  It's a trade off.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm OS Developer Su?te - Now Available ?

2004-02-19 Thread Chris Faherty
On Thursday 19 February 2004 05:25 am, Eron Hennessey wrote:

 I'm not really sure if this is even a true statement to begin with --
 and it's definitely becoming less true every day.  Are you talking palm
 developers?  C/C++ developers, or just developers! developers!
 developers! ?

OMG I just got that ( http://www.ntk.net/ballmer/mirrors.html )  LOL!

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm OS Developer Su?te - Now Available ?

2004-02-18 Thread Chris Faherty
On Wednesday 18 February 2004 04:43 pm, Keith Rollin wrote:

 ..but those installing cygwin from the Palm OS Developer
 Suite installer get a much stripped down version.

Will we be able to just add a URL to the regular cygwin.com installer to 
install the Palm OS Developer Suite?  Please please please :-)

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm OS Developer Su?te - Now Available ?

2004-02-17 Thread Chris Faherty
On Monday 16 February 2004 04:19 pm, Keith Rollin wrote:

 Seriously, I stayed away from the cygwin stuff for many years,
 wondering why I should encumber my systems with that old cruft.  Now
 that I've installed them and had a chance to play with them, I can't
 imagine having a development system without them.  Now I don't have
 to switch over to MPW on my Mac any more... :-)

I was using a client's Windows system for development for a week, using 
cygwin prc-tools etc.  It's still quite slow when compared to using 
prc-tools from a unix-like box.  It left me very frustrated in that I 
couldn't finish the job during that week.

Both machines are about the same; mine is an Athlon 1700 running Linux, and 
the Windows box was a Celeron 1.8Ghz.  Prc-tools with Linux is 9 seconds to 
build my project, whereas prc-tools (cygwin) on Windows XP was 180 seconds.  
Isn't that peculiar.  I'd laugh, but it can truly impact the amount of work 
you can get done in a day.

I love cygwin, and the awesome package manager/installer.  Though I hope 
someday the cygwin stuff can be made faster.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Palm OS Developer Su?te - Now Available ?

2004-02-17 Thread Chris Faherty
On Tuesday 17 February 2004 03:08 am, Aaron Ardiri wrote:

 i think, the speed issues maybe related to the OS - not to the software
 specifically within cygwin. windows XP chews more resources than linux. :)
 give your windows XP box more ram, and - its faster :)

 my laptops use a minimum of 768Mb of ram these days - takes no time to
 compile my prc-tools projects :) and, on a slowish 1.2GHz PIII :)

It doesn't really seem to be doing much.. it just takes forever to compile.  
I still think it is something not implemented efficiently.  I was using a 
2.4GHz P4 Windows XP laptop and it was still many times slower than my cheap 
Athlon and Linux.. though it was fast enough.

On my box, I also have a Windows 98SE running inside of win4lin.  When I 
compile in native Linux it is 19 seconds.  Using win98se in win4lin it is 5 
minutes.  Hardly any activity noticable during the compile.. the hard disk 
blinks maybe once every 5 seconds.  It's just painfully slow.

I think it may have something to do with console programming in win32.  I 
seem to recall an old console project which gained a considerable speedup by 
simply making it window-based.  I fear that the win32 console stuff is 
performance crippled in some way.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Who is PalmOS's competitor Number One ? Microsoft? Symbian? Or Someone else?

2003-11-07 Thread Chris Faherty
On Friday 07 November 2003 07:02 am, Virendra wrote:

 What do you guys think on this front? With the entry
 of Embedded Linux and strong competition from Symbian,
 what market does palm have ?

While waiting for my GSM Treo 600 I picked up a Nokia 3650 (Symbian) for $99 
during a t-mobile promotion.  If they ever get a thumboard on one of these 
things, PalmOne had better watch out!

The main attraction I see is the cheap price, high performance ( 100MHz), 
ruggedness, and ubiquity.  They seem to have a lot of multimedia players on 
them.  Out of the box I can stream radio and video with the RealOne player.  
I bought a browser, Doris Browser, and wow it just runs rings around 
anything on the PalmOS platform  OS 5.x.

Programming is definitely weird, but you can do a lot of stuff with very 
little knowledge.  I know that the Treo 600 is going to blow it away, but 
I'm finding this 3650 to be strangely addicting (hello Bluetooth!), and I'm 
almost a Palm fanatic.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Who is PalmOS's competitor Number One ? Microsoft? Symbian? Or Someone else?

2003-11-07 Thread Chris Faherty
On Friday 07 November 2003 09:39 am, Aaron Ardiri wrote:

 the development kits for symbian really suck - but, the good news
 is that they are gcc based (for some of us). there lacks decent
 compiler/front end support for these tools; hence, it can be quite
 hard to write even simple applications.

It's somewhat awkward in that it builds the WINS architecture in VC and the 
THUMB architecture in GCC.  I had a weird structure packing issue and that 
left me guessing on the device.  I've since learned that there is a 
gdbstub.sis to allow debugging on the device with GDB.

Though debugging with Visual Studio and the Epoc simulator is not all that 
bad.  You have to loopback your serial ports into a pppd to get networking 
but it works well enough.

One things for certain; I hate UNICODE :)

 symbian has always had the idea of pushing J2ME based applications;
 which, i personally see as a mistake - mainly due to speed. a lot of
 'symbian' users are actually J2ME, very few are native C++ developers.

The J2ME stuff works very well on that platform.  I don't know how nice it 
is for programming because, well, I basically I hate Java.  The ability to 
beam a .jar and have it run on the phone is very slick.  I haven't had any 
troubles at all with that functionality.

I was even able to compile a J2ME application and package it up to run on 
the device.  That is no small feat for me!  So they must have done something 
right.

 nokia 3650 is not good to compare; the nokia 6600 will be interesting.

I wouldn't have bought this for over $99.  The Sony Pxxx devices don't 
appeal to me at all -- those are too bulky and expensive.  The low price and 
compact size of the Nokia is what is making it so irresistable.  I'm 
finishing up a suite of IR keyboard drivers for it, so maybe that will help 
a bit.  I kinda doubt it though.  Needs a thumboard.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Who is PalmOS's competitor Number One ? Microsoft? Symbian? Or Someone else?

2003-11-07 Thread Chris Faherty
On Friday 07 November 2003 10:04 am, Riccardo Cohen wrote:

 I'm not an expert at all, but for me the real war is a PalmOS against
 WindowsCE. I think Microsoft will not let the market go without Microsoft.
 As we all could see it 10 years ago with NextStep, quality does not mean
 success.

Microsoft keeps making their developer kits require Win2K.  Am I the only 
one locked out of development because of that?  I use win4lin.

My friend tells me that Microsoft is making big progress in getting industry 
adoption for their handhelds in places where they use dotnet in their 
enterprise.  Something about being able to easily port the applications.

OTOH the idea of phone applications is mostly where you push a button and 
a program retrieves/displays a hunk of information.  Like the defunct Web 
Clipping Architecture.  Any of these platforms can compete in doing that, so 
it comes down to hardware ubiquity.

Microsoft's recent Voice Command announcement is interesting.  I can totally 
see that working now.  Doing some searches on Symbian show that a bunch of 
stuff is available for it as well.. actually there's some built-in API I 
believe.  Ok, now I'm intrigued.  Things like that don't seem to popup on 
PalmOS too often.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Who is PalmOS's competitor Number One ? Microsoft? Symbian? Or Someone else?

2003-11-07 Thread Chris Faherty
On Friday 07 November 2003 01:32 pm, Florent Pillet wrote:
 That's because you don't deal enough with non-Roman languages. Believe
 me, Unicode is paramount when you have to process things in a multitude
 of languages with various encodings, etc. At least, Unicode
 standardizes all this.

I guess I should have said I hate the way Nokia uses TDesC :)  Though I am 
getting used to it.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


netSocketOptSockNotice (socket notices, callbacks etc) usage

2003-10-04 Thread Chris Faherty
I posted this to comm-dev-forum last week but there's not a lot of activity 
over there.  I still haven't gotten the netSocketOptSockNotice to work 
properly.  I believe I am doing everything properly, using the 
NetSocketNoticeType structure with NetLibSocketOptionSet(), but I can't help 
but think it is some type of struct packing issue.  Though I have tried to 
squirm the struct and size to make it work, but haven't had success.

Has anyone worked with socket notices yet?  SDK-5 added this stuff in 
NetMgr.h which I presume only works for OS 5 and beyond.  For some reason I 
am always getting sysErrParamErr from the NetLibSocketOptionSet() within the 
simulator, which is the only OS 5 platform I have for use.

NetSocketNoticeType nsnt;

/* set activity callback */
MemSet(nsnt, sizeof(nsnt), 0);
nsnt.type = netSocketNoticeCallback;
nsnt.condition = netSocketNoticeTCPReceive;
nsnt.notice.callback.callbackP = my_socket_callback;
nsnt.notice.callback.userDataP = NULL;
if (NetLibSocketOptionSet(AppNetRefnum, sock, netSocketOptLevelSocket,
netSocketOptSockNotice, nsnt, sizeof(nsnt), AppNetTimeout, errno))
ShowErrorMsg(ErrToString(errno));

Err my_socket_callback(void *userDataP, UInt16 socketRef, UInt32 condition)
{
return 0;
}

I would like to use these nifty socket features for background networking, 
rather than the hideous method of using a periodic timer to poll the sockets.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Breaking the 32K barrier for codes which handle non-sysAppLaunchCmdNormalLaunch

2003-09-30 Thread Chris Faherty
On Monday 29 September 2003 02:07 pm, Aaron Ardiri wrote:
 you can write your own 'code handling' for segments. i have done this
 previously without any problems at all - especially if you are coding
 without globals :)

I'd recommend Multilink before doing that :)

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Breaking the 32K barrier for codes which handle non-sysAppLaunchCmdNormalLaunch

2003-09-30 Thread Chris Faherty
On Tuesday 30 September 2003 04:14 am, Aaron Ardiri wrote:
 multilink may help solve some problems - but, beware of the
 launch codes.. my general practice is to never assume you have
 globals; and, you never run into these types of problems :)

From what I've read about Multilink, and my fairly ordinary use of it, I 
understand that it uses two schemes to do inter-segment calls; one while 
globals are avail and one while they are not.

http://www.djw.org/product/palm/multilink/

Perhaps it's just dumb luck, but that thing has made things so much simpler 
for me.  I couldn't believe it when I took Palm's Mail application and built 
it with prc-tools+Multilink and it ran perfectly on the first build.

Ahh well, to be honest I probably won't use it forever.  Hasn't given me 
problems but I am a little scared that some newer toolchain may break it, 
and I don't know enough to be able to fix it :(  It's just so darned perfect 
that it's hard to stop making projects with it..

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Does sysNotifyNetSocketEvent exist?

2003-09-26 Thread Chris Faherty
I'm looking at the OS 5 SDK and it appears there is a notification which 
happens during socket activities.  However I can't find the appropriate 
notifyType to register.  It appears it should be called 
sysNotifyNetSocketEvent.  Does anyone know what the value is?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Determining if simulator is running

2003-09-25 Thread Chris Faherty
On Thursday 25 September 2003 12:11 am, Ben Combee wrote:

 Look in HostControl.h for a suitable function.

Thank you Regis and Ben.  I'm using this and it is good.

HostID hid;
hid = HostGetHostID();
if ((hid == hostIDPalmOSEmulator) || (hid == hostIDPalmOSSimulator))
inposer = true;

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Determining if simulator is running

2003-09-24 Thread Chris Faherty
Hi.  Can someone tell me the equivalent of POSE FtrGet('pose' ...) so that I 
can determine if the Palm OS 5.x simulator is running?  I couldn't find 
anything in the supplied docs, kb, etc.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Web Clippings Net 1273 Error

2003-09-22 Thread Chris Faherty
On Sunday 21 September 2003 11:28 am, Ben Combee wrote:
 You do realize that the Treo 300 doesn't some with Web Clipping or INetLib
 support, and that there is no legal way to install that onto the device,
 because Handspring chose not to include those components in their OS
 build, right?

You can buy the Mobile Internet Kit for $3 (used) off Amazon and install the 
library files.  That's legal.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: SysNotifyRegister

2003-09-22 Thread Chris Faherty
On Monday 22 September 2003 04:03 pm, Eric Blanpied wrote:

 if(cmdPBP-notify-notifyType == sysNotifyTimeChangeEvent) {

 When I try and use this in codewarrior I get an error saying that it's not
 a struct/union/whatvever. Do I need to cast it? What type would I be
 casting it to? Or perhaps I need to declare the struct?

SysNotifyParamType *snpt;

snpt = (SysNotifyParamType *)cmdPBP;

if (snpt-notifyType == ..

Or I suppose you could typecast it:

if (((SysNotifyParamType *)cmdPBP)-notifyType == .

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: OS5.2: has SysNotifyBroadcastFromInterrupt WakeupHandler been fixed ?

2003-08-15 Thread Chris Faherty
On Thursday 14 August 2003 06:39 pm, Steve Mason wrote:

 So this looks like I'm not going to be able to do what I want, which is
 trying to port a real-time serial port service routine that runs in the
 background (ie, while other programs are running) to OS5.x.  I'm assuming
 of course that I can't use SysNotifyBroadcast() from the wakeup handler or
 that there is another way to run my serial buffer servicing routine in
 near real time.

 Anyone have any ideas about how I could possibly do this ? (besides
 setting an alarm and polling the serial buffer every second - too slow!)

I had similar problems back in April, in writing a keyboard driver.  On OS 
5.x, while I have a serial port open, I register for 
sysNotifyEventDequeuedEvent and poll.  I don't believe it will work if you 
want to receive serial while the device is asleep.  You may also want to 
EvtSetNullEventTick() at some point while the serial port is open to 
guarantee a minimum nilEvent rate.  Use the event log in the simulator and 
you can see the nilEvent rate.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Coding Standards

2003-08-14 Thread Chris Faherty
On Tuesday 12 August 2003 09:11 pm, Alan Ingleby wrote:

 (This is mine...)

 void MyFunc(Char* buffer, UInt32 type) {
   switch(type) {
 case 1:
   StrCopy(buffer, One);
   break;
 case 2:
   StrCopy(buffer, Two);
   break;
 default:
   StrCopy(buffer, Huh?);
   break;
   }
 }

Hmm.  This is fun..

void MyFunc(Char* buffer, UInt32 type)
{
switch (type) {
case 1:
StrCopy(buffer, One);
break;
case 2:
StrCopy(buffer, Two);
break;
default:
StrCopy(buffer, Huh?);
break;
}
}

This can be summarized as:
indent -gnu -brs -br -ce -i4 -ncs -npcs -nprs -l80 -npsl -nut -nlp -ci4

Which I use to change PalmOS coding style sources into something usable :)

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: gdb with Simulator

2003-08-04 Thread Chris Faherty
On Monday 04 August 2003 08:05 pm, Khaki Wizard wrote:
 It seems that the gdb in PRC-tools does not work with
 the Palm OS 5 Simulator.
 Anybody knows whether it should work or not?
 SuggestionS?

It works.  But the 'gdbS' feature is not set by default so you have to force 
a break.  There was a program called gdbpanel.prc which simply sets the 
feature, but it doesn't work so hot in OS 5.x.

So what I usually do is in my app:

FtrSet('gdbS', 0, 0x12BEEF34);

And then I run it twice.  Someone should write another gdbpanel which 
doesn't blow up in OS 5.x.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: removable media file systems: Palm vs PocketPC

2003-07-30 Thread Chris Faherty
On Wednesday 30 July 2003 03:14 am, Aaron Ardiri wrote:

 its FAT16 - pretty standardized :)

Some of the smaller cards are FAT12.  I have a 16MB MMC that is.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Debug Palm apps

2003-07-23 Thread Chris Faherty
On Wednesday 23 July 2003 11:59 am, Ricardo Marques wrote:
 Hello
 I'm developing an aplication in a m515 using PRC and Cygwin. Since I don't
 have any IDE debugging the app is quite cumbersome. So I'd like to know if
 it is possible to display on the PDA's screen debug messages in a similar
 way as it is done with printf and C, without having to execute a reset.
 I've tried ErrFatalDisplay but that forces a reset with no use so...
 Any help would be greatly

Why not use gdb?  I can't recall if you need to run gdb to get Dbg messages 
or not.  At any rate you can use:  DbgMessage()

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Laucnhing a web clip form a prc

2003-07-22 Thread Chris Faherty
On Tuesday 22 July 2003 10:39 am, Alexandre Barreto wrote:

 this is my function now:
(snip)
   SysAppLaunchCmdOpenDBType* parametros;
(snip)

You're missing:

if (!(parametros = MemPtrNew(sizeof(SysAppLaunchCmdOpenDBType {
return sysErrNoFreeRAM;
}

parametros-cardNo = cardNo;
parametros-dbID = dbID;

 MemPtrSetOwner(parametros, 0);
 err = SysUIAppSwitch(cardNo,ClipID,sysAppLaunchCmdOpenDB,parametros );

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Laucnhing a web clip form a prc

2003-07-22 Thread Chris Faherty
On Tuesday 22 July 2003 01:18 pm, Alexandre Barreto wrote:

 i tried that but i keep geting the erro in compilation
 ilegal implicit conversion  from 'void *' to 'SysAppLaunchCmdOpenDBType *'

Typecast it then.

if (!(parametros = (SysAppLaunchCmdOpenDBType *)
MemPtrNew(sizeof(SysAppLaunchCmdOpenDBType {
return sysErrNoFreeRAM;
}

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: PalmOS 5 and Hacking

2003-07-22 Thread Chris Faherty
On Tuesday 22 July 2003 08:07 pm, Chris Tutty wrote:
 Well ok, assuming that the handler patch will have to be replaced with
 a notification handler the question of how to store data other than via
 FtrGet remains.  I would have thought that any other form of memory
 handling would have the same sort of overhead.  What was the problem
 with the Ftr~ calls that changing to the reserved trap avoided?

The serial callback has a UInt32 argument.  Instead of just storing the 
portid in there, use it to hold a pointer to a locked structure.  Then put 
the portid in the structure along with other stuff you need while in the 
callback.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Programmatically generating a shortcut stroke

2003-07-20 Thread Chris Faherty
My understanding is that a shortcut Graffiti stroke sequence is needed to 
put a PalmOS device into macro mode; i.e. shortcut+ts = timestamp.  I'd like 
to be able to do this from a keyboard driver but I haven't had much luck in 
using GrfProcessStroke().

Can someone provide an example of enqueuing the strokes for a character and 
then telling Graffiti to interpret them?  Thanks.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: A plea for prc-tool help

2003-07-03 Thread Chris Faherty
On Thursday 03 July 2003 03:58 pm, Rick Reynolds wrote:
 Well, now this person is me!  I finally slogged through the steps
 necessary to rebuild the prc-tools and now have a version that came from
 today's CVS source tree.

I tried to build the CVS on Windows after your first post.  Everything was 
building ok but then I found I was using some cygwin parts from an AVRGCC 
installation, and when I adjusted my path to the recent cygwin stuff the 
Perl interpreter kept GPFing.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: A plea for prc-tool help

2003-07-03 Thread Chris Faherty
On Thursday 03 July 2003 04:24 pm, Rick Reynolds wrote:
 Well, I appreciate the effort.  I ended up installing a current update of
 cygwin at the start of my effort.  After that, things were pretty smooth
 overall.

I'm new to the cygwin setup.exe tool.  It's pretty slick, you can just go in 
and click off what you need, and it downloads and installs it.  I hadn't 
realized that it has multiple package versions so I may try putting an older 
or newer Perl package on to see if it gets rid of the build problem I had.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: PilRC problem with HackMaster

2003-06-06 Thread Chris Faherty
Raison Mikhael [EMAIL PROTECTED] wrote on 6/6/03 3:58 am:

 TRAP ID 1000 0xA132 for example.

TRAP ID 1000 VALUE 0xA132

Somewhere in the versions it became picky about that.  Can't remember which
is the correct syntax.

-- 
/* Chris Faherty [EMAIL PROTECTED] */


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Is there any way to redirect actual PDA screenshots to PC ????

2003-05-31 Thread Chris Faherty
On Friday 30 May 2003 11:44 am, Anamika Bhat wrote:

 However, my manager wants me to find a way such that , when I use my
 application on the PDA, those actions should be redirected to the PC so
 that the  customers can see my actions on the actual PDA instead of the
 emulator. In other words, I want to use the actual PDA to do a demo, but
 it should be seen by other people without any problem.

 Is there any way the above condition could be achieved???

There used to be a way to do something very cool like that.  Remote UI 
is part of the Palm debug protocol and it allows a debugger to replicate a 
realtime screen through the cradle.  It's very cool, I used to use it for 
data entry because it was seamless.

The application is called pilot-debug, and it's in the pilot-link package.  
I think the command is called mirror.  Anyways I can't build it right now to 
test with my newer devices.  There may be other debuggers or apps which do 
this.  I kinda recall someone putting together a shareware package which 
used this same technique.

I can't find the shareware thing, I coulda sworn it was out there but I 
don't know what it is called.  I guess someone will have to write another.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Debugging multi-segmented app with prc-tools-2.2 fails

2003-05-27 Thread Chris Faherty
On Tuesday 27 May 2003 12:47 pm, Rick Reynolds wrote:

 If I understand you correctly, I need a later version of gdb in order to
 use multilink -- gdb has been fixed and multilink (version 0.3) now works
 as designed.  Correct?

Yes.  The only problem I've run into was with older gdb's broken 
add-symbol-file.  The command only accepted literal values, and so the 
script which multilink produced could not work.  Here's the script..

# Generated by multilink -gdb-script option
define load-segments
  set $jmptable = *((long**)($a5-4))
  echo loading segments
  echo .
  add-symbol-file Mail0001.out *(long*)(((long)$jmptable)+4)
  echo done\n
end
document load-segments
  load-segments command for Mail (2 segments)
  Use the load-segments command to load the non-zeroth segments
  in a multi-segment application. This allows you do debug code
  in any segment.
end

So to use it with broken gdb, you'd have to get the value of 
*(long*)(((long)$jmptable)+4) and type it manually into add-symbol-file.  
Not that big of a deal really, but it'll slow you down.  That's only needed 
for segments beyond the first, which naturally would work.

 Since I'm not currently building with multilink, I can't check this yet.
 But I'm betting that I have the broken one since Overbeek's patches are
 dated December of 2002.

Not sure.  The add-symbol-file is barely one line of code.  The hardest part 
about multilink is definitely building it.  The debian prc-tools binary 
package doesn't include libbfd.a bfd.h, so you'll have to build the whole 
toolchain to get them in order to build multilink.

I'll have to make a debian bug report.  Lemme do that real quick.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Launching an app at interupt time

2003-04-03 Thread Chris Faherty
On Thursday 03 April 2003 03:14 pm, Bob Baker wrote:

 I've installed (working) code that replaces the EvtGetEvent function.
  During the execution of my code I need to (asynchronously) start a
 'Help' application.  This 'Help' app does not want to cause the current
 application to end but needs to display a single screen for a preset
 amount of time (the screen to be displayed varies based on passed info).

Here's what I do; http://rallypilot.sourceforge.net/work/pbjtime.zip


FormActiveStateType formState;

/* launch it */
if ((DmGetNextDatabaseByTypeCreator(true, searchInfo,
sysFileTApplication, 'PBJT', true, cardNo, dbID) == 0)) {
/* save all of the current app's UI state */
FrmSaveActiveState(formState);
SysAppLaunch(cardNo, dbID,
sysAppLaunchFlagNewStack|sysAppLaunchFlagNewGlobals,
sysAppLaunchCmdCustomBase+1, NULL, res);
/* restore all of the current app's UI state */
FrmRestoreActiveState(formState);
}

Since my app will now have globals, I just have a little flag I set in the 
code for when it is launched this way.  In particular, I don't use the 
regular event chain to switch forms to mine, but rather I do the steps 
manually.  This is because I didn't want the original form handler to be 
involved in the process.

It's a bit cheesy.  But then, normal timer dialog code does pretty much the 
same thing.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Launching an app at interupt time

2003-04-03 Thread Chris Faherty
On Thursday 03 April 2003 06:09 pm, Bob Baker wrote:

   frmP = FrmInitForm (MainForm);
   logWrite(\nAbout to draw form', true);
   FrmDrawForm (frmP);
   logWrite(\nAbout to set active, true);
   FrmSetActiveForm (frmP);
   logWrite(\nHeading for 'reset', true);

At some point it is going to call a form event handler.  Since you haven't 
set one, it is still assigned to the current application's code.  Who knows 
what that'll do, except probably crash.

Try this:

   frmP = FrmInitForm (MainForm);
   FrmSetActiveForm(frmP);
   logWrite(\nAbout to draw form', true);
   FrmSetEventHandler(frmP, MainFormHandleEvent);
   FrmDrawForm (frmP);
   logWrite(\nAbout to set active, true);
   FrmSetActiveForm (frmP);
   logWrite(\nHeading for 'reset', true);

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Launching an app at interupt time

2003-04-03 Thread Chris Faherty
On Thursday 03 April 2003 07:56 pm, Ben Combee wrote:

 Therefore, I think the original poster needs to override both EvtGetEvent
 and SysHandleEvent to get proper.

Also to the original poster.  In my posted example I was using 
SysHandleEvent to launch from.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Sleep Wake Functions?

2003-03-27 Thread Chris Faherty
On Thursday 27 March 2003 09:22 am, [EMAIL PROTECTED] wrote:

 2) What is the event for detecting the PDA is going to sleep?

OS = 3.2

Boolean is_os_32(void)
{
UInt32 romVersion;
FtrGet(sysFtrCreator, sysFtrNumROMVersion, romVersion);
/* some NotifyMgr things need = 3.2 */
if (romVersion = 0x0320) return true;
return false;
}

void register_sleep(void)
{
UInt16 cardNo;
LocalID dbID;
if (!is_os_32()) return;
if (!SysCurAppDatabase(cardNo, dbID)) {
SysNotifyRegister(cardNo, dbID,
sysNotifySleepNotifyEvent,
NULL, sysNotifyNormalPriority, NULL);
}
}

void register_wake(void)
{
UInt16 cardNo;
LocalID dbID;
if (!is_os_32()) return;
if (!SysCurAppDatabase(cardNo, dbID)) {
SysNotifyRegister(cardNo, dbID,
sysNotifyLateWakeupEvent,
NULL, sysNotifyNormalPriority, NULL);
}
}

.. PilotMain(UInt16 cmd ..)

SysNotifyParamType *snpt;

switch (cmd) {

case sysAppLaunchCmdNotify:
snpt = (SysNotifyParamType *)cmdPBP;
switch (snpt-notifyType) {
case sysNotifySleepNotifyEvent:
break;
case sysNotifyLateWakeupEvent:
}
break;

case sysAppLaunchCmdSystemReset:
case sysAppLaunchCmdSyncNotify:
register_sleep();
register_wake();
break;

 1) How do you prevent the PDA from going to sleep while running your
 application

As Dave Lippincott wrote, EvtResetAutoOffTimer() calls within your event 
loop.  There are also techniques which can be done via NotifyMgr.  This 
would be used if you need to defer sleep which isn't necessarily caused by 
auto-off.  For example, if you wanted to prevent sleeping due to the lid 
being closed on the Treo :)  Of course you wouldn't want to do that while a 
phone call is active or you would get a very large bill.

From TreoHelper:

void register_sleeprequest(void)
{
UInt16 cardNo;
LocalID dbID;
if (!is_os_32()) return;
if (!SysCurAppDatabase(cardNo, dbID)) {
SysNotifyRegister(cardNo, dbID,
sysNotifySleepRequestEvent,
NULL, sysNotifyNormalPriority, NULL);
}
}

SysNotifyParamType *snpt;
SleepEventParamType *sept;

snpt = (SysNotifyParamType *)cmdPBP;
switch (snpt-notifyType) {
case sysNotifySleepRequestEvent:
sept = (SleepEventParamType *)(snpt-notifyDetailsP);
if ((sept-reason == sysSleepPowerButton) 
!HsAttrGet(hsAttrSysSleepReason, 0, tui16) 
(tui16 == hsSysSleepLid)) {
LoadPrefs(tprefs);
if (tprefs.stayonlidnetwork) {
if (!LoadPhoneLibrary(tplibref)) {
if (!PhnLibGetPhoneCallStatus(tplibref, tui32)) {
/*
 * So, if a SleepLid request comes in, and we have
 * our prefs set for it, and the phonecallstatus
 * shows a data call active, then we defer sleep.
 */
if (tui32phnGPRSCallActive) sept-deferSleep++;
}
ClosePhoneLibrary(tplibref);
}
}
}
break;

You detect the sysNotifySleepRequestEvent and increment the deferSleep 
parameter.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Determining if LCD is on

2003-03-24 Thread Chris Faherty
On Sunday 15 December 2002 12:59 pm, Scott Gruby wrote:

  I've searched high and low in the forums archives, the KB, the 3.5 and
  4.x source, and header files and am unable to figure out how to
  determine if the LCD is on or off. Is there a simple way to do this? In
  particular I'm working on a Treo 300..

 I hate touching the processor directly, but it looks like I don't have a
 choice right now.

Just for completeness, I believe this will work..

#include Handspring/HsExt.h

UInt16 tui16;
if (!HsAttrGet(hsAttrDisplayOn, 0, tui16)  tui16) {
  /* screen is on */
}

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: something wierd !

2003-03-03 Thread Chris Faherty
On Monday 03 March 2003 05:33 am, sylBEERt wrote:

 I'm making a call to gethostbyname on the Palm  it seems to be failing
 ONLY for a particular hostname. I use exactly the same code .. with the
 same hostname in a c++ program on linux  it works just fine !! Ofcourse
 I'm using Berkley Sockets. What is wierd is that this bit of code was
 working perfectly well until a week ago!!

 the hostname for which my code is failing is: 'toc.oscar.aol.com'

(snip)

 I get success, but testHostentP-h_addr holds a NULL value. As a result of
 which, connect fails !

 Can't see what I'm doing wrong. Any solutions, suggestions anyone ?

This may not be related, but I noticed a strange thing like that on a 
particular host as well.  It was a particular DNS entry which returned 
different values to balance the load, and it began freaking out my Palm 
applications.  What I found was needed was to enumerate the list provided 
within the returned NetHostInfoPtr, as sometimes the first entry would be 
blank -- which is I believe the same value as -h_addr.

NetSocketAddrINType saddr;
NetHostInfoPtr phe;
NetHostInfoBufType AppHostInfo;

if ((phe = NetLibGetHostByName(AppNetRefnum, host, AppHostInfo,
AppNetTimeout, errno)) != 0) {
/*
 * Sometimes the first address in the list is zero.  This
 * makes me have to search through them to find the first
 * non-zero address.
 */
for (i1=0; i1  netDNSMaxAddresses; i1++) {
if (phe-addrListP[i1] != NULL) {
if (*phe-addrListP[i1] != '\0') {
MemMove((char *) saddr.addr,
(char *) phe-addrListP[i1], phe-addrLen);
nameresolved = true;
break;
}
}
}
}

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Clipper 4.x build for OS 3.5?

2003-02-26 Thread Chris Faherty
I have a question I want to ask for completeness, just in case someone knows 
the answer.

I'm fond of using Clipper Library as a browser for embedded email URLs in my 
software.  It's quick and clean and has a way to return to the calling 
application via an arrow button.  However I find that the OS 3.5 Clipper 
appears to have a 16K hard limit on the page size.  I find also that OS 4.x 
Clipping does not have this limit, and also supports color.

I've been unable to get 4.x Clipping Library to work on an OS 3.5 device.. 
in particular the Treo 300.  Altering the version check yields something 
which almost works, but then it silently fails to retrieve any data.

So my question.  Is there a build of the 4.x Clipper Library which will run 
on an OS 3.5 device?  I also wonder about the Samsung I300/I330 which I 
believe has color Clipping and yet still runs OS 3.5.  Do they have some 
hybrid version?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/


Re: Re(2): free advice

2003-02-20 Thread Chris Faherty
On Wednesday 19 February 2003 03:36 pm, George Henne wrote:
 My favorite doc to refer people to is Eric Raymonds How to ask questions
 the smart way.

 You can find it here:
 http://www.catb.org/%7Eesr/faqs/smart-questions.html

And the 16th don't on the list is... :-)

  Don't flag your question as Urgent, even if it is for you

  That's your problem, not ours. Claiming urgency is very likely to be
  counter-productive: most hackers will simply delete such messages as rude
  and selfish attempts to elicit immediate and special attention.

Eric's doc is circa 2001.  Surely that should be in the top 10!

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: field with horizontal scrolling

2003-02-19 Thread Chris Faherty
On Monday 17 February 2003 10:07 am, Brian Smith wrote:
 On Mon, 17 Feb 2003, David Janssens wrote:
  The string to enter can be very large. The problem is that, to my
  knowledge, fields can't do horizontal scrolling. Anyone has ideas on how
  to input large strings?

 Multi-line field.  At least, that's what I've done in the past to get
 around that.

To expand on what Brian mentioned, multi-line field.  If you restrict a 
multi-line field to a single visible line, it will in essence be a 
horizontal scrolling field.  This is because when the end of the visible 
field is reached, it will scroll to a new blank line.  The visual clue is 
not so great, as it looks like it simply blanks out the line, though if you 
move left  right you can navigate it.  Perhaps you can place a visual 
indicator when it scrolls just as you would a larger memo field -- i.e. 
use code similar to how you would update a scrollbar.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: multisegmenting troubles

2003-02-18 Thread Chris Faherty
On Tuesday 18 February 2003 06:39 am, Rick Reynolds wrote:
 I've been using multilink to build up my app, and it has been working well
 up to now.  However, since debugging multilink'd apps in pose has
 problems, I'm now trying to make the switch over to the gcc segmenting
 scheme.

Which problems?  Just curious.  Is it just the gdb add-symbol-file issue?  
John has fixed that, according to the changelog.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: NetLib GenHostByName in Non Blocking Mode

2003-02-18 Thread Chris Faherty
On Wednesday 19 February 2003 02:03 am, Akhilesh Singh wrote:
 I am using NetLib in Non Blocking mode. It works great for a responsive UI
 while net activity goes on in the background simultaneously, EXCEPT for
 the call NetLibGetHostByName.

 This function call does not return until, either it is resolved or timeout
 occurs. So while this call is made my UI hangs and user cannot do
 anything.

 How can I make this process also UI friendly? Any suggestions?

I have a suggestion of something you can do to improve the UI.  It doesn't 
solve your problem, but if your IP isn't expected to change frequently you 
may be able to cache the response in a ftr.  It can really help if you are 
always going to the same host over and over again.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: NetLib sluggish keyboard response

2003-02-10 Thread Chris Faherty
On Monday 10 February 2003 01:41 pm, Brian Smith wrote:
 A few people using upIRC have been reporting sluggish keyboard response
 while it's connected to a server.  The latest reports the same behavior
 with some networked apps (like terminal emulation) have the same problem,
 but not others (like ICQ).

 My only theory is that the keyboard driver is latching into EvtGetEvent
 (and somehow doing the equivalent on OS 5, in the last case) and supplying
 the key events that way.  In my case, though, I'm using NetLibSelect to
 see if events are in the queue while I'm connected, and the keyboard
 driver may not be handling that correctly.  That's the only thing I can
 think of, since my Wireless Link keyboard doesn't give me the same
 problems... it works fine.

I have problems like that with my Treo 300.  It's when it goes in/out of 
coverage.  In my office the reception is right on the line, and I find that 
sometimes it will actually drop keys rather than just buffering them for a 
second or two.  Yeah, I just tested it again.. typing 
abcdefghijklmnopqrstuvwxyz while the light was blinking red, and during 
the transition between red-blink and green-blink it stalled and I wound up 
missing a character.  This was in a non-network related text field.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: pdb comparison tool

2003-01-23 Thread Chris Faherty
Ben Combee [EMAIL PROTECTED] wrote on 1/23/03 4:28 pm:

 par t file1.pdb  out1
 par t file2.pdb  out2
 
 then use a text diff tool to compare out1 and out2.

I use pilot-file's record dump in a similar manner.

-- 
/* Chris Faherty [EMAIL PROTECTED] */


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Fun Debugging Trick #4513

2003-01-20 Thread Chris Faherty
David McNab [EMAIL PROTECTED] wrote on 1/20/03 7:30 pm:

 When hunting bugs on-device which cause frequent crashes requiring a push
 to the soft-reset button...

Also try Crash Hack.  Not only does it have a timeout option for
autoresetting, but it copies the fatal error text to a log so you may review
it later.

-- 
/* Chris Faherty [EMAIL PROTECTED] */


-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Determining if LCD is on

2002-12-14 Thread Chris Faherty
On Friday 13 December 2002 11:39 am, Scott Gruby wrote:

 (I want to take different actions from an alarm if the LCD is on or off,
 so I need to know the state.)

I use NotifyMgr and sysNotifySleepNotifyEvent, sysNotifyLateWakeupEvent to 
flip a bit.  Can sorta imply from that whether the device is on/off, and 
hence, the LCD too.  But kinda iffy.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Treo 300 SimpleSMS equivalent

2002-12-09 Thread Chris Faherty
Hmmm.  I just began adding SMS (incoming) support to an app and I realized 
that Handspring's SimpleSMS doesn't work at all on the Treo 300.

I've searched everywhere I can think for the past few hours, and haven't dug 
up any information on how to register for SMS stuff.  I can't even find any 
active handspring developer lists.  A little disturbing..

Does anyone have experience with programmatically working with SMS on a Treo 
300?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Treo 300 SimpleSMS equivalent

2002-12-09 Thread Chris Faherty
On Monday 09 December 2002 07:57 pm, Steve Mann wrote:
 Yes. What do you need to know specifically? Also,  you might want to
 direct these types of questions to the handspring developer's forum.

I couldn't find one which was active.  The yahoo group has a last post in 
2001 etc etc.

I have a freeware email smtp/pop which I've been upgrading to do scheduled 
pops.  My device is a treo 300 but I'd of course like to do things 
appropriately as to not exclude other devices as well.

Currently I use a scheme whereby I wake the device up via AlmProc and bounce 
a udp packet off my server.  This tells me whether there is mail to be 
popped, so that I can do the more expensive pop operation only when needed.  
So far it's been great, and has improved battery life considerably.  Takes 
around 4 seconds typical for my udp probe to complete, but I'm not in great 
coverage.

It *almost* feels like a BlackBerry when I use a 10 minute poll interval :)  
I have some rules where I always yield my operations to the user, and I also 
have stuff where I auto-OK those annoying failure to connect messages.  It's 
not quite done in the background, but you know, surprisingly that hasn't 
been much of an issue as I rarely see it doing it's thing and I get ~200 
msg/day on the thing.  I have also modified the Palm Mail application to 
allow database sharing and dynamic screen updates, as well as hotkeys for 
the treo.

Of course I'll post a link to this stuff once I get my testing done, and 
finish up an smtp-auth code merge I'm doing right now.

Anyways, I'd like to also experiment with using SMS as a trigger.  This way 
I can have more flexibility from the server side as to when a pop is needed, 
and further improve battery life by not requiring data services to be 
enabled full-time on the device.

Sorry to be so long-winded above.  What I need specifically re: SMS, is that 
I need a way to register for incoming SMS notification and be able to; 
determine if the SMS is mine, and also silently consume it.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Treo 300 SimpleSMS equivalent

2002-12-09 Thread Chris Faherty
On Monday 09 December 2002 10:45 pm, Steve Mann wrote:
 You can sign up for the forum on the Palm dev web site, same as all
 the other Palm developer forums. Although there's not a flood of
 activity, there's a steady trickle. Last message I saw was yesterday.

Ahh ok.  I was looking at the archives.  Looked pretty dead, 20th century 
dead.  Though I'll take another look.

 My understanding is that the 300 SDK will be available fairly soon (a
 matter of weeks), but then, that's been publically stated before by
 people from HandSpring.

Aww, man.  Why do they do that stuff.  I have to cram everything into my 
time between contracts :)  In a few weeks I won't even be into Palm 
programming any more..

 ..T-Mobile GPRS service .. pretty inexpensive..

Sorry, but, Ahahahhahahahahahah! :P

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



I really love Multilink :)

2002-12-08 Thread Chris Faherty
Hi all.  I just wanted to write and say how much I love David Williams' 
Multilink: http://www.djw.org/product/palm/multilink/

I've come back to my old PalmOS programming after a few years and the 32K 
limits in my code were right where I left them, at 31.K.  So I read 
several very detailed documents on setting up multi-segments with prc-tools 
2.x.. but I just couldn't bring myself to use it.

It was then that I decided to use Multilink 0.3 with prc-tools 2.x.  Boy, it 
just doesn't get any sweeter than this!  I had one itty-bitty problem with 
gdb, which I've sent in a patch to debian btw, but other than that, it's 
been completely transparent to me that I'm using multi-segments.  Didn't 
have to change a single line of code, works with or without globals, and I 
don't even know it's there except for having to type 'load-segments' at my 
first breakpoint during debugging.

If I could ask anything, I would ask that Multilink be packaged up wherever 
prc-tools is so that more people can use it, and not have to build it (which 
can have a few sticking points).

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: I really love Multilink :)

2002-12-08 Thread Chris Faherty
On Sunday 08 December 2002 07:54 am, Florent Pillet wrote:

 Multilink seems to be very cool. Maybe it's time to resurrect it -- I
 have a LARGE code base that I'd like to move over to gcc, but modifying
 all the C++ classes to declare the segment into which each one should
 go is insane.

 I had not heard of Multilink before, but this is definitely something
 to check out.

I also had experienced Multilink a few years ago in playing with the Yanoff 
project.  IIRC it *had* a limitation on only being able to debug code in the 
first segment.  Now David has a clever method to fix that, and since he's 
released the 0.3 version which is prc-tools 2.x compatible, it was just the 
thing I needed.

I've attached a sample Makefile to help.  Lookit how tiny and simple it is 
with Multilink :)

Here's a little primer on debugging with Multilink..

The Makefile makes a little gdb script, named debug in my case.  After 
your initial breakpoint with gdb, you issue load-segments and it will take 
care of the symbols for segments  0.  From that point on, debugging is 
normal.

So I use:

m68k-palmos-gdb -x debug gnugotmail.out

See, the first segment's COFF object is specified on the gdb command line, 
and the gdb script uses add-symbol-file to load symbols for 
gnugotmail0001.out ... etc.  Neato.

There is ONE gotcha.  gdb-5.x's add-symbol-file command has been broken for 
a while, in that it only accepts a literal parameter.  I found a single-line 
patch from an ancient USENET post which is applicable, and I posted it to 
the debian prc-tools bug submission.  I've also attached it here.

My Makefile:

- BEGIN
## Makefile for gnugotmail

TARGET = gnugotmail
APPNAME = gnugotmail
APPID = GNGM

OBJS = $(TARGET).o timer.o md5c.o sockets.o pop.o smtp.o common.o
LIBS =

CC = m68k-palmos-gcc
LL =

CFLAGS = -Wall -g -O2

PILRC = pilrc -q
NM = m68k-palmos-nm
BUILDPRC = build-prc
PILOTXFER = pilot-xfer
MULTILINK = m68k-palmos-multilink

all: $(TARGET).prc

.S.o:
$(CC) $(TARGETFLAGS) -c $

.c.s:
$(CC) $(CSFLAGS) $

$(TARGET).prc:  $(TARGET) bin.res
$(BUILDPRC) $(TARGET).prc $(APPNAME) $(APPID) *.grc *.bin

bin.res: $(TARGET).rcp $(TARGET).pbm
$(PILRC) $(TARGET).rcp .
touch bin.res

$(TARGET): $(OBJS)
$(MULTILINK) -g -gdb-script debug -stdlib -fid $(APPID) -basename $(TARGET) 
$(OBJS)
! $(NM) -u $(TARGET)*.out

send: $(TARGET).prc
$(PILOTXFER) -i $(TARGET).prc

depend:
makedepend -Y -I. *.c

clean:
-rm -f *.[oa] $(TARGET) *.bin bin.res *.grc *.out Makefile.bak

veryclean: clean
-rm -f $(TARGET).prc pilot.ram pilot.scratch
- END

GDB-5.0 patch to fix add-symbol-file:

- BEGIN
--- orig-gdb-5.0/gdb/symfile.c  Tue Nov 19 21:49:35 2002
+++ gdb-5.0/gdb/symfile.c   Tue Nov 19 21:49:51 2002
@@ -1646,11 +1646,14 @@
 char *val = opt[i].value;
 char *sec = opt[i].name;
  
+/*
 val = opt[i].value;
 if (val[0] == '0'  val[1] == 'x')
   addr = strtoul (val+2, NULL, 16);
 else
   addr = strtoul (val, NULL, 10);
+*/
+addr = parse_and_eval_address(val);
  
 if (strcmp (sec, .text) == 0)
   section_addrs.text_addr = addr;
- END

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: I really love Multilink :)

2002-12-08 Thread Chris Faherty
On Sunday 08 December 2002 12:07 pm, Aaron Ardiri wrote:

 but really guys, whats the problem with the current multi-segment
 capabilities of prc-tools? if you do what most developers do, and,
 that is define function prototypes at the top of your files, it isn't
 rocket science to add the __attribute__ tags you need :)

I was going to try it, but then I started reading about needing assembler 
stubs  stuff.  Perhaps that's stuff I don't really need to know, but still, 
I really wanted a solution where I didn't have to touch my sources.

Let me ask you a question about capabilities though.  Does prc-tools 2.x 
native multi-segment support work without globals?  I'm doing lots of launch 
codes and alarm callbacks in my project.  So far I've had no issues with 
Multilink in this regard.

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: I really love Multilink :)

2002-12-08 Thread Chris Faherty
On Sunday 08 December 2002 12:32 pm, Aaron Ardiri wrote:

 globals :) eek :) hehe - you can get around them with good design
 (ie: use feature pointers to allocate a chunk of memory) :P in regards
 to multilink, i wonder how it could be adapted to support ARM code :)
 esp. if your solving these globals issues with hacks/launch codes

I believe Multilink uses FtrGet/Set when it's needed.  I guess the diff is 
that it does it automagically.

I've been having some fun/success with relaunching alarms with globals.  
What a change that makes.  I'm never going to try to do anything complicated 
without globals again!

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: I really love Multilink :)

2002-12-08 Thread Chris Faherty
On Sunday 08 December 2002 01:12 pm, Aaron Ardiri wrote:

 but, based on what chris was 'hinting' was that using multigen doesn't
 do so :) that makes it very interesting. especially for armlet builders.
 it has been a long time since i did use multigen, maybe chris can fill
 us in on the capabilities? :)

 [opens the floor to chris - explain boy] :P

From my reading of multilink.c, it uses FtrGet() (called in 
MultilinkGetCodeSegments) for old a4 based gcc, and it does something much 
simpler for a5 based gcc.

static int
write_dispatch_code_a4(FILE* fp, unsigned long cid)
{
fprintf(fp,
/* When we don't have globals, get jmptables from ftr land */
dispatch_noglobals:\n
move.l %%d0,-(%%sp)\n
move.l %%d1,-(%%sp)\n
move.l #0x%lx,-(%%sp)\n /* push creator id */
bsr.w MultilinkGetCodeSegments\n
lea 4(%%sp),%%sp\n
move.l (%%sp)+,%%d1\n
move.l (%%sp)+,%%d0\n
bra.b dispatch_really\n

/*
 * If the code from here to the jmp at the end changes,
 * then the value branch_count is set to must change to
 * match.
 */
dispatch:\n
/* do we have globals */
move.l %%a4,%%d2\n /* tst.l %a4 fatal resets */
beq.b dispatch_noglobals\n
/* yes, get the jmp table pointer */
move.l MultilinkSegmentJmpTables(%%a4),%%a0\n

dispatch_really:\n
/* get the segment table */
move.l (%%a0,%%d1.w),%%a0\n
/* get the offset from the table */
move.w (%%a0,%%d0.w),%%d2\n
jmp (%%a0,%%d2.w)\n
, cid);

return 20; /*FIXME*/
}

static int
write_dispatch_code_a5(FILE* fp)
{
fprintf(fp,
/*
 * If the code from here to the jmp at the end changes,
 * then the value branch_count is set to must change to
 * match.
 */
dispatch:\n
/* get the jmp table pointer */
move.l MultilinkSegmentJmpTables@END(%%a5),%%a0\n
/* get the segment table */
move.l (%%a0,%%d1.w),%%a0\n
/* get the offset from the table */
move.w (%%a0,%%d0.w),%%d2\n
/* jump to real function */
jmp (%%a0,%%d2.w)\n
);
return 16; /*FIXME*/
}

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: I really love Multilink :)

2002-12-08 Thread Chris Faherty
 On Sun, Dec 08, 2002 at 12:23:01PM -0500, Chris Faherty wrote:
  Does prc-tools 2.x native multi-segment support work without globals?

On Sunday 08 December 2002 01:00 pm, John Marshall wrote:
 The answer to this question is even to be found in the Palm OS Companion
 (under Responding to Other Launch Codes); though the text there is
 aimed at CodeWarrior, it is also applicable to prc-tools because both
 store various kinds of inter-section jump data with the global variables.

Well, I understood that this was a limitation in the past.  Just checking 
the current status.  Let me ask another question then :)  Does gdb cope with 
multi-segment debugging?  And yes, the prc-tools docs say it doesn't work 
well, but does that mean there is no way to do it?

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Datebook citizen

2002-09-25 Thread Chris Faherty

On Wednesday 25 September 2002 01:07 pm, Chris DiPierro wrote:

 I suspect they mean that direct access to the DB will no longer be
 supported, but there should be APIs to supplant that method. PalmSource
 has talked about this for a while now and has remarked that they're going
 to make APIs for all of the built-in apps.

Aww, man.  That never works when they do that.  The API is always missing 
the required features to write good third-party stuff.

Perhaps it would work if they also *force* the built-in apps to use the same 
API and not directly access their DB :)

-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/



Re: Why XML?

2001-07-09 Thread Chris Faherty

I wrote:

 That makes it very flexible in cut  paste situations, or at times when
 you want to shrink down an XML file which has too much information.

On Monday 09 July 2001 12:23 am, David A. Desrosiers wrote:

   An XML file which has too much information has absolutely no bearing
 on the use of that XML file at all. You can simply change the query for the
 information you require out of it.

An example.  RSS/RDF files which are provided on the web.  They have too much 
information for my pager.  My pager has a limit on the message size, and 
therefore I use software to compact the XML representation and remove 
elements which I don't need.

   When you do an SQL query for data, you can say:

Well, I am just grabbing XML content which has been generously provided.  I 
rarely have access to the main database, nor would I want to.  Isn't that 
pretty much the point of XML.. to encapsulate data in a fashion which is 
scalable due to its robust syntax.

   Saying the database has to much information is just a silly
 statement altogether.

Of course I never mentioned database, we were talking about XML files.

I wrote:
  You can often optimize XML files for character count if that is
  important; i.e. / endtags, scrap unneeded elements, get rid of
  whitespace, and other stuff.

   If you remove  / endtags, your XML parser will fail and your
 document will be flagged as an invalid XML document (thank god they finally
 added validation INTO the parser now). They were meant to fail like that.

Optimize.  / is an optimization for the space hogging /endtag, and that 
is what I meant, change /endtag to / or even more compact tag  / when 
applicable.  (I see below that you also mention this).  This is paramount in 
wireless situations like mine where every packet is an extra tick on the 
battery and flash storage.  So it is required to compact and exclude portions 
of existing XML documents to fit within an acceptable packet count.

 If you want to optimize your XML, you should consider changing un-essential
 tags to attributes.

I see your point, but I'm pretty sure I don't want to do that to a vendor's 
data because that pretty much breaks everything.  My premise was in 
optimizing existing XML documents such that it would be more compact for 
wireless transmission.

  Mostly I'd say that wireless benefits from XML. I use it all the time on
  the Blackberry; headlines, stock quotes.  The wmheadlines package also
  uses the same data so it is pretty awesome being able to pick up the
  same article listings from my PC as well as pager, such that when I get
  tired of reading an article on the pager I just go to the PC and it is
  in wmheadlines.

   Probably because you're dealing with the same exact 1's and 0's that
 were sent to your pager, not a copy of that data. It's the same exact
 data.

Actually no.  That was my point.  The beauty of an XML parser/tools is that 
you can interpret the document and create a new document which is a subset 
and yet adheres to the same DTD.  Often RSS/RDF headlines are up to 15K in 
length and include an ever expanding set of elements.  They can also be very 
wasteful in whitespace depending on the author.  Much like your SQL example, 
with XML tools you can easily obtain a subset of an XML document -- and you 
can choose to either slim it down whilst still conformant to the original 
DTD, or create an entirely new XML based on your optimization recommendations.


-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Why XML?

2001-07-08 Thread Chris Faherty

On Sunday 08 July 2001 10:25 am, Igor Mozolevsky wrote:

 I still can't see use for XML on palm... Would anyone care to point out one
 thing that would actually benefit, opposed to doing something in a
 different way, the users?

XML is used for rss/rdf headlines from thousands of web sites.  If you write 
a simple XML parser you can then get a nice screenful of wmheadlines-style 
articles updated throughout the day.

It's also useful for interchange of information, mostly because once you have 
an XML parser, you then only need to write a small amount of code to extract 
the information in a very robust way; i.e. element order and heiarchy is 
easily obtained.

That makes it very flexible in cut  paste situations, or at times when you 
want to shrink down an XML file which has too much information.  You can 
often optimize XML files for character count if that is important; i.e. / 
endtags, scrap unneeded elements, get rid of whitespace, and other stuff.

Mostly I'd say that wireless benefits from XML.  I use it all the time on the 
Blackberry; headlines, stock quotes.  The wmheadlines package also uses the 
same data so it is pretty awesome being able to pick up the same article 
listings from my PC as well as pager, such that when I get tired of reading 
an article on the pager I just go to the PC and it is in wmheadlines.


-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Why XML?

2001-07-08 Thread Chris Faherty

On Sunday 08 July 2001 04:59 pm, Igor Mozolevsky wrote:

 There are also a thousand of different ways of resolving a problem and
 while XML might be one of them, it does not have to be the right one or the
 most efficient one... XML requires a parser, and like most parsers, you
 need speed+memory, the exact two things that are limited on palm... Most
 importantly, watch out for defying the whole point by using a technology
 just because it exists... The most common example of such are people using
 Java Server Pages and/or Active Server Pages for serving static context...

A non-validating XML parser is very easy to code.  I use one I wrote 5 years 
ago and it is only 300 lines of C.  You only need as much memory as your 
largest element, and even then you will only be using pointers to the data so 
that isn't much memory.

The particular XML content may be a moving target or something of overkill.  
But it pays to use XML because you only need to write one parser, and 
assuming you've written a proper parser, it will provide a consistent view of 
the data to your application code regardless of whether it has extra 
attributes or different whitespace.

Using XML with wireless is fantastic!  It's nice to be able to add a line or 
two of code and be able to handle a subtle attribute buried 3 elements deep 
and not have to worry that you are breaking some legacy code in the field.  
That's because you keep the parser separate from the application, and from 
the application's point of view it just gets element callbacks and doesn't 
care that new attributes have been added.

I mean how cool is it to be able to retrieve any XML file/stream and know 
that your application can have the content spoon fed to it in a consistent 
manner.  You may not know what the heck to do with the elements, but at least 
you can programmatically test for its existence and get its attributes 
regardless of its location within a stream.. and with just a couple of lines 
of code.


-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Linux on the Palm

2001-06-14 Thread Chris Faherty

On Thursday 14 June 2001 01:42 am, Alan Ingleby wrote:

 Already tried that, too.  As far as I can see, it's not even Linux.  I
 personally think the whole thing was just a hoax.  How can you possibly
 emulate the whole PalmOS environment under Linux, and make is as
 transparent as that, and not using any PalmOS code, and still keep within
 the 2 Meg ROM limit?

Well, they did it back in the PalmOS 2 days :)  Dunno, I downloaded the ROMs 
a few years ago.. just haven't tried it.  Lemme see..

Dang!  That was easy as pie to test.  Just re-downloaded the ROM cuz I lost 
the old one, gunziped it and ran xcopilot like they said.  Instant Linux with 
WindStone!

Okay you are going to think I am making this up again..

The cool part is that it gives a uClinux shell prompt on my console, and and 
and it also has a pile of regular Palm apps loaded in a mounted RAM 
filesystem; AddressBkR, BigClock, BS Calc, LauncherIII v1.5.2, Datebk3, 
Digger, Galax, GR, HackMaster, Jot, LoadRunner I, PacMan, PocketChess, 
QwHack, Tetris, Viewer III, 

Hrm can't seem to load new apps into it with xcopilot.  But it's certainly 
not a hoax.  Oop wait, I was trying to use the GUI.  There are some bins in 
the /bin of the console, one of them is loadprc but I think it only will load 
from the RAM filesystem it has mounted.

At any rate, it is very cool and only took a few minutes to try out.  Very 
clever.  Here's the bootup on the console:

uClinux/MC68328
Flat model support (C) 1998 Kenneth Albanowski, D. Jeff Dionne, TSHG Ltd.
TRG SuperPilot FLASH card support [EMAIL PROTECTED]
Console driver (without boot console): mono mc68328 40x26, 1 virtual console 
(max 63)
Calibrating delay loop.. ok - 5.49 BogoMIPS
Memory available: 596k/800k RAM, 373k/800k ROM (268k kernel data, 427k code)
Swansea University Computer Society NET3.035 for Linux 2.0
NET3: Unix domain sockets 0.13 for Linux NET3.035.
Swansea University Computer Society TCP/IP for NET3.034
IP Protocols: ICMP, UDP, TCP
uClinux version 2.0.33 ([EMAIL PROTECTED]) (gcc version 2.7.2.3) #1920 Thu 
Nov 18 13:45:52 KST 1999
rs68328_init
MC68328 serial driver version 1.00
ttyS0 at 0x0001 (irq = 0) is a builtin MC68328 UART
MC68328 digitizer.
Ramdisk driver initialized : 16 ramdisks of 4096K size
Blkmem (C) 1998 D. Jeff Dionne, Kenneth Albanowski, TSHG Ltd.
loop: registered device at major 7
PPP: version 2.2.0 (dynamic channel allocation)
TCP compression code copyright 1989 Regents of the University of California
PPP Dynamic channel allocation code copyright 1995 Caldera, Inc.
PPP line discipline registered.
SLIP: version 0.8.4-NET3.019-NEWTTY (dynamic channels, max=256).
CSLIP: code copyright 1989 Regents of the University of California.
VFS: Mounted root (romfs filesystem) readonly.
reset hardware
interrupts enabled


=

Welcome to uClinux/Pilot!

uClinux release 2.0.33, build #1920 Thu Nov 18 13:45:52 KST 1999
uClinux/Pilot release 1.0.0, build #932 Thu Nov 18 13:19:57 KST 1999

=


Mounting proc on /proc
Expanding initial ramdisk image into /dev/ram0
Mounting /dev/ram0 on /var
Making /var/tmp
Attaching loopback device
Lauching WindStonePE!!!
Loading prc
Starting task manager
uClinux command shell (version 1.1)
 Loading prc complete
Starting UIAppShell




-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Linux on the Palm

2001-06-13 Thread Chris Faherty

On Thursday 14 June 2001 12:27 am, Alan Ingleby wrote:

 http://www.uclinux.com/

 Exactly... It *can* be done, but although these guys have a Linux kernel
 for the Dragonball, it's not possible to run it on a standard Palm device. 
 If you read into it a little more, you'll see that one guy actually got it
 up on a Palm Pro with a TRG board.  But who has one of those

Along those same lines.. remember this:

http://www.oski.co.kr/

They took a uClinux kernel and added a PalmOS clone called WindStone.  Their 
web page hasn't really changed in years though, and I don't think it was ever 
flashed into an actual device.  They have source and ROM images on their 
which you can load into CoPilot (maybe POSE also).


-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



Re: Urgent : Book for Developments

2001-04-18 Thread Chris Faherty

On Wednesday 18 April 2001 10:09 am, Jeff Wheeler wrote:

 My most useful reference now is the SDK.  I took the PDF file to Kinkos and
 had all 1250 pages printed (double-sided) and punched.  I keep it in a
 three-ring notebook.  You can buy the SDK in book form, but I find the
 binder to be very convenient.

I used psnup to do an 8-way on a 600dpi printer, the SDK is 1/2" thick 
single-sided.  Nowadays with better printer resolution and paper, you could 
probably do a 32-way and carry it in your pocket :)  Micro Fiche perhaps..

At the very least though, a 4-way double-sided is not hard to read at all.  
The SDK usually has jumbo type and it seemed a waste to print it full size.


-- 
/* Chris Faherty [EMAIL PROTECTED] */

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/



  1   2   >