home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / happydays-src-1.37.tar.gz / happydays-src-1.37.tar / happydays-1.37 / util.h < prev   
C/C++ Source or Header  |  2000-05-17  |  2KB  |  45 lines

  1. /*
  2. HappyDays - A Birthdate displayer for the PalmPilot
  3. Copyright (C) 1999-2000 JaeMok Jeong
  4.  
  5. This program is free software; you can redistribute it and/or
  6. modify it under the terms of the GNU General Public License
  7. as published by the Free Software Foundation; either version 2
  8. of the License, or (at your option) any later version.
  9.  
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18. */
  19.  
  20. #ifndef UTIL_H__
  21. #define UTIL_H__
  22.  
  23. #include <PalmOS.h>
  24.  
  25. extern void * GetObjectPointer(FormPtr frm, UInt16 objID);
  26. extern FieldPtr SetFieldTextFromHandle(UInt16 fieldID, MemHandle txtH);
  27. extern FieldPtr SetFieldTextFromStr(UInt16 fieldID, Char * strP);
  28. extern FieldPtr ClearFieldText(UInt16 fieldID);
  29. extern Char * DateToAsciiLong(UInt8 months, UInt8 days, Int16 year,
  30.                             DateFormatType dateFormat, Char * pstring);
  31. extern UInt32 Hash(Char* name1, Char* name2);
  32.  
  33. extern MemPtr AppInfoGetPtr(DmOpenRef dbP);
  34.  
  35. Boolean FindNearLunar(DateType *dt, DateType base, Boolean leapyes);
  36. Int16 DateCompare (DateType d1, DateType d2);     // defined in datebook.c
  37.  
  38. // Extract the bit at position index from bitfield.  0 is the high bit.
  39. #define BitAtPosition(pos)                ((UInt32)1 << (pos))
  40. #define GetBitMacro(bitfield, index)      ((bitfield) & BitAtPosition(index))
  41. #define SetBitMacro(bitfield, index)      ((bitfield) |= BitAtPosition(index))
  42. #define RemoveBitMacro(bitfield, index)   ((bitfield) &= ~BitAtPosition(index))
  43.  
  44. #endif
  45.