home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Texteditors / Origami / Sources / src / lib / ori_add_lib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-27  |  3.0 KB  |  108 lines

  1. #ifndef ORI_ADD_LIB_READ
  2. #  define ORI_ADD_LIB_READ
  3. #  include <stdio.h>
  4. #  include <unistd.h>
  5. #  include <h/os.h>
  6. #  include <lib/ori_bool.h>
  7.    /*{{{}}}*/
  8.    /*{{{  string stuff*/
  9. #   ifdef UNSIGNED_FUNC
  10.       unsigned char *ustrcpy(unsigned char*,const unsigned char*);
  11.       unsigned char *ustrcat(unsigned char*,const unsigned char*);
  12.       unsigned char *ustrstr(const unsigned char*,const unsigned char*);
  13.       int ustrcmp(const unsigned char*,const unsigned char*);
  14.       size_t ustrlen(const unsigned char*);
  15. #   else
  16. #     define ustrcpy ((unsigned char *(*)(unsigned char*,const unsigned char*))strcpy)
  17. #     define ustrcat ((unsigned char *(*)(unsigned char*,const unsigned char*))strcat)
  18. #     define ustrstr ((unsigned char *(*)(const unsigned char*,const unsigned char*))strstr)
  19. #     define ustrcmp ((int (*)(const unsigned char*,const unsigned char*))strcmp)
  20. #     define ustrlen ((size_t (*)(const unsigned char*))strlen)
  21. #   endif
  22.    /*}}}  */
  23.    /*{{{  stdio stuff*/
  24.    /*{{{  constants, can be defined outside too!*/
  25.    /*{{{  HOME_CHAR*/
  26. #   ifndef HOME_CHAR
  27. #     define HOME_CHAR '~'
  28. #   endif
  29.    /*}}}  */
  30.    /*{{{  path data*/
  31. #   ifndef PATH_SEP
  32. #     define PATH_SEP "/"
  33. #     define PATH_C '/'
  34. #   endif
  35. #   ifndef LIST_SEP
  36. #     define LIST_SEP ":"
  37. #     define LIST_C ':'
  38. #     define LIST_C_1 '\001'
  39. #   endif
  40. #   ifndef CURR_DIR
  41. #     define CURR_DIR "."
  42. #   endif
  43. #   ifndef PREV_DIR
  44. #     define PREV_DIR ".."
  45. #   endif
  46.    /*}}}  */
  47.    /*{{{  root test*/
  48. #   ifndef IS_ROOT
  49. #     define IS_ROOT(s) ((s)[0]=='/')
  50. #   endif
  51.    /*}}}  */
  52.    /*{{{  OS_NULL_DEVICE*/
  53. #   ifndef OS_NULL_DEVICE
  54. #     define OS_NULL_DEVICE "/dev/null"
  55. #   endif
  56.    /*}}}  */
  57.    /*{{{  CHMOD_PRIVATE*/
  58. #   ifndef CHMOD_PRIVATE
  59. #     define CHMOD_PRIVATE(f) chmod(f,0600)
  60. #   endif
  61.    /*}}}  */
  62.    /*{{{  OS_READPERM*/
  63. #   ifndef OS_READPERM
  64. #     define OS_READPERM(fn,bp) 0
  65. #   endif
  66.    /*}}}  */
  67.    /*}}}  */
  68.    /*{{{  functions*/
  69.    extern unsigned char *dir_name(unsigned char*const,unsigned char const*);
  70.    extern unsigned char *join_fd(unsigned char*const,unsigned char const*const);
  71.    extern boolean is_file(FILE*const,char const*const);
  72. #   define is_dir(f,s) (!is_file(f,s))
  73.    /*}}}  */
  74.    /*}}}  */
  75.    /*{{{  pwent-stuff*/
  76.    extern char *home_expand(char*const);
  77.    extern void start_getpwent(void);
  78.    extern char const *next_getpwent(void);
  79.    extern void end_getpwent(void);
  80.    /*}}}  */
  81.    /*{{{  origami project malloc*/
  82. #   include <stdlib.h>
  83. #   ifdef MALLOC_PAKET
  84. #     define ORImalloc(x) malloc(MALLOC_PAKET(x))
  85. #     define ORIrealloc(p,x) realloc(p,MALLOC_PAKET(x))
  86. #     define ORIfree(p) free(p)
  87. #   else
  88. #     define ORImalloc(x) malloc(x)
  89. #     define ORIrealloc(p,x) realloc(p,x)
  90. #     define ORIfree(p) free(p)
  91. #   endif
  92.    /*}}}  */
  93.    /*{{{  ori_assert*/
  94. #   ifdef ASSERT
  95. #     define ori_assert(check,com) \
  96.       ((check)\
  97.         ?0\
  98.         :(fprintf(stderr,"assertation failed (%s) in %s %d\n",com,__FILE__,__LINE__),\
  99.           abort(),\
  100.           0\
  101.          )\
  102.       )
  103. #   else
  104. #     define ori_assert(check,str)
  105. #   endif
  106.    /*}}}  */
  107. #endif
  108.