editline.h (2208B)
1 /* $Revision: 1.5 $ 2 ** 3 ** Internal header file for editline library. 4 */ 5 6 #ifdef INCLUDE_EDITLINE 7 8 #include <sal/core/libc.h> 9 #include <sal/core/alloc.h> 10 #include <sal/appl/io.h> 11 12 #if defined(HAVE_STDLIB) 13 #include <stdlib.h> 14 #include <string.h> 15 #include <ctype.h> 16 #endif /* defined(HAVE_STDLIB) */ 17 18 #if defined(SYS_UNIX) 19 #include <sys/types.h> 20 #include <sys/stat.h> 21 #include <unistd.h> 22 #if defined(USE_DIRENT) 23 #include <dirent.h> 24 typedef struct dirent DIRENTRY; 25 #else 26 #include <sys/dir.h> 27 typedef struct direct DIRENTRY; 28 #endif /* defined(USE_DIRENT) */ 29 #if !defined(S_ISDIR) 30 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 31 #endif /* !defined(S_ISDIR) */ 32 #endif /* defined(SYS_UNIX) */ 33 34 #if defined(VXWORKS) 35 #include <sys/types.h> 36 #include <string.h> 37 #include <unistd.h> 38 #include <taskLib.h> 39 #define getpid() taskIdSelf() 40 #endif /* defined(VXWORKS) */ 41 42 #if !defined(SIZE_T) 43 #define SIZE_T unsigned int 44 #endif /* !defined(SIZE_T) */ 45 46 #define CRLF "\r\n" 47 #define FORWARD STATIC 48 49 typedef unsigned char CHAR; 50 51 #ifndef STATIC 52 #if defined(HIDE) 53 #define STATIC static 54 #else 55 #define STATIC /* NULL */ 56 #endif /* !defined(HIDE) */ 57 #endif 58 59 #define MEM_INC 64 60 #define SCREEN_INC 256 61 62 #define DISPOSE(p) sal_free((char *)(p)) 63 #define NEW(T, c) \ 64 ((T *)sal_alloc((unsigned int)(sizeof (T) * (c)), "editline")) 65 #define COPYFROMTO(new, p, len) \ 66 (void)memcpy((char *)(new), (char *)(p), (int)(len)) 67 /* 68 ** Variables and routines internal to this package. 69 */ 70 extern int rl_eof; 71 extern int rl_erase; 72 extern int rl_intr; 73 extern int rl_kill; 74 extern int rl_quit; 75 #if defined(DO_SIGTSTP) 76 extern int rl_susp; 77 #endif /* defined(DO_SIGTSTP) */ 78 extern char *(*rl_complete)(); 79 extern char *rl_complete_file(); 80 extern int (*rl_list_possib)(); 81 extern int rl_list_possib_file(); 82 extern void rl_ttyset(); 83 extern void rl_add_slash(); 84 void rl_prompt_set(CONST char *prompt); 85 86 extern void list_history(int count); 87 88 #if !defined(HAVE_STDLIB) 89 extern char *getenv(); 90 extern char *memcpy(); 91 extern char *strcat(); 92 extern char *strchr(); 93 extern char *strrchr(); 94 extern char *strcpy(); 95 extern int strcmp(); 96 extern int strlen(); 97 extern int strncmp(); 98 #endif /* !defined(HAVE_STDLIB) */ 99 100 #endif /* INCLUDE_EDITLINE */