Thu 13 May 2004

C fiddling

Because I have nothing better to do at this moment, and I'm frankly ashamed of the quality of code I just released, I'm rewriting (with the added benefit of shorter code and handling of sent messages).

Because C uses null-terminated strings, I can't use the C string library to find delimiters — so I reinvented the wheel. How's this for a substring finder?
int locate(const char *message, const char sub[], int mSize, char type) {
  int i, j, s;
  j = 0;
  s = sizeof(sub);
  for (i=0; i<mSize; ++i) {
    if(message[i] == sub[j]) {
      for(j=1; j<s; ++j) {
        if(message[i+j] != sub[j]) {
          j=0;
          break;
        }
      }
      if(j != 0) {
        return i;
      }
    }
  }
  return -1;
}

Posted at 2004-05-13 14:12:57 by RichardLink to C fiddling
Comments, trackbacks.

grabp800 and sent messages

I should probably note: sent messages are distinguished only by their sender, which is your number! The destination is actually present, so I'll work on getting that out, too.

Posted at 2004-05-13 11:41:06 by RichardLink to grabp800 and sent …
Comments, trackbacks.

P800 SMS

It's up on the code page. If you have a P800, and you want to archive your messages in some kind of open way, have a look.

Posted at 2004-05-13 06:12:24 by RichardLink to P800 SMS
Comments, trackbacks.

P800 text messages

I have finally got round to writing a small app to extract SMSes from a P800 backup. I have nearly 800 messages on the phone (that's after losing some and deleting loads), so it's about time!

I'll post instructions, code (after neatening and commenting!), and a download later. Now you don't have to go out and buy a Windows machine and Desktop Message!

Time for a haircut now…

Posted at 2004-05-13 02:28:00 by RichardLink to P800 text messages
Comments, trackbacks.

Google
Web holygoat.co.uk
  • richard is: