home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 1 / ARM_CLUB_CD.iso / contents / apps / clib / progs / timslib / TimsLib / h / Lib < prev    next >
Encoding:
Text File  |  1993-01-21  |  2.1 KB  |  68 lines

  1. /* Lib.h */
  2. /*                           
  3.  
  4.   #####                 #         #
  5.     #    #              #      #  #
  6.     #                   #         #
  7.     #   ##  ####   #### #     ##  ####
  8.     #    #  # # # #     #      #  #   #
  9.     #    #  # # #  ###  #      #  #   #
  10.     #    #  # # #     # #      #  #   #
  11.     #   ### # # # ####  ##### ### ####
  12.  
  13. -----------------------------------------------------------------------------
  14.  
  15. This is source for use with the 'DeskLib' Wimp C programming library for
  16. Risc OS. I currently use v1.04 of DeskLib.  This source is FreeWare, which
  17. means you can use it to write commercial applications, but you may not charge
  18. *in any way* for the distribution of this source.  I (Tim Browse) retain
  19. all copyright on this source.
  20.  
  21. This source is provided 'as is' and I offer no guarantees that is useful,
  22. bug-free, commented, that it will compile, or even that it exists.
  23.  
  24. If it breaks in half, you own both pieces.
  25.  
  26. All source © Tim Browse 1993
  27.  
  28. -----------------------------------------------------------------------------
  29.  
  30. */
  31.  
  32.  
  33. /* ANSI includes */
  34. #include <string.h>
  35.  
  36. /* DeskLib includes */
  37. #include "DeskLib.Core.h"
  38.  
  39. #define MAX(x,y)   (x) > (y) ? (x) : (y)
  40. #define MIN(x,y)   (x) < (y) ? (x) : (y)
  41.  
  42. /* The following will copy a string, allocating the space for the destination.
  43.    If length is non-zero, length bytes are allocated, otherwise strlen is used
  44.    on src to determine how much space to allocate (including terminating 0).
  45. */
  46. extern char *save_str(const char *src, int length);
  47.  
  48. extern int set_bits(int src, int mask, int set_bits);
  49.  
  50. extern void asciiz_to_cr(char *s, int max_len);
  51.  
  52. extern int strlen_cr(const char *s);
  53.  
  54. #define CR (char) 13
  55.  
  56. /* The following does the same thing as strcmp, but interprets CRs as
  57.    string terminators as well as null characters.  This is because many wimp
  58.    strings are CR terminated.
  59. */
  60.  
  61. #define wimp_strcmp(s1, s2) strcmp(strtok((s1), "\r"), strtok((s2), "\r"))
  62.  
  63. extern int get_filetype(char *dirname, char *leafname);
  64. /*
  65.   This returns the filetype of the given file, or -1 if the string names
  66.   a non-existent file.
  67. */
  68.