, 1 min read
Possible Enhancements to J-Pilot
Original post is here eklausmeier.goip.de/blog/2013/02-27-enhancements-to-j-pilot.
Here are some thoughts about possible enhancements for J-Pilot.
- Convert pdb's and pc3's to SQLite. This makes it easier to analyze data according some criteria, e.g., find how many addresses have the same telephone numbers, how many entries in datebook contain the same substring, etc.
- Convert and transform pdb's and pc3's to Google GData (shut down or deprecated). The Google id, which is returned after transmitting data, is then possibly stored in pdb/pc3.
- Use
mmap()
instead of all itsfread()
andmalloc()
's inside pilot-link and J-Pilot. - When J-Pilot searches for strings in the case-insensitive case, then it copies all elements and uses
malloc()
for each element, see routinejp_strstr()
. Instead, just use eitherstrcasestr()
or a home-brewedstrstr()
which takes care of case. Newjp_strstr()
is thus:
const char *jp_strstr(const char *haystack, const char *needle, int case_sense) {
if (haystack == NULL) return NULL;
if (needle == NULL) return haystack;
return case_sense ? strstr(haystack, needle) : strcasestr(haystack, needle);
}