home *** CD-ROM | disk | FTP | other *** search
- /* Lib.h */
- /*
-
- ##### # #
- # # # # #
- # # #
- # ## #### #### # ## ####
- # # # # # # # # # #
- # # # # # ### # # # #
- # # # # # # # # # #
- # ### # # # #### ##### ### ####
-
- -----------------------------------------------------------------------------
-
- This is source for use with the 'DeskLib' Wimp C programming library for
- Risc OS. I currently use v1.04 of DeskLib. This source is FreeWare, which
- means you can use it to write commercial applications, but you may not charge
- *in any way* for the distribution of this source. I (Tim Browse) retain
- all copyright on this source.
-
- This source is provided 'as is' and I offer no guarantees that is useful,
- bug-free, commented, that it will compile, or even that it exists.
-
- If it breaks in half, you own both pieces.
-
- All source © Tim Browse 1993
-
- -----------------------------------------------------------------------------
-
- */
-
-
- /* ANSI includes */
- #include <string.h>
-
- /* DeskLib includes */
- #include "DeskLib.Core.h"
-
- #define MAX(x,y) (x) > (y) ? (x) : (y)
- #define MIN(x,y) (x) < (y) ? (x) : (y)
-
- /* The following will copy a string, allocating the space for the destination.
- If length is non-zero, length bytes are allocated, otherwise strlen is used
- on src to determine how much space to allocate (including terminating 0).
- */
- extern char *save_str(const char *src, int length);
-
- extern int set_bits(int src, int mask, int set_bits);
-
- extern void asciiz_to_cr(char *s, int max_len);
-
- extern int strlen_cr(const char *s);
-
- #define CR (char) 13
-
- /* The following does the same thing as strcmp, but interprets CRs as
- string terminators as well as null characters. This is because many wimp
- strings are CR terminated.
- */
-
- #define wimp_strcmp(s1, s2) strcmp(strtok((s1), "\r"), strtok((s2), "\r"))
-
- extern int get_filetype(char *dirname, char *leafname);
- /*
- This returns the filetype of the given file, or -1 if the string names
- a non-existent file.
- */
-