home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / fed0217s.zip / include / keycoll.h < prev    next >
C/C++ Source or Header  |  1998-04-10  |  935b  |  49 lines

  1. /*
  2. ** Module   :KEYCOLL.H
  3. ** Abstract :Key bindings container
  4. **
  5. ** Copyright (C) Sergey I. Yevtushenko
  6. **
  7. ** Log: Fri  27/03/1998     Created
  8. */
  9.  
  10. #include <collect.h>
  11. #include <vio.h>
  12. #include <common.h>
  13. #include <dict.h>
  14.  
  15. #ifndef __KEYCOLL_H
  16. #define __KEYCOLL_H
  17.  
  18. class FunctionDictionary: public Dictionary
  19. {
  20.     public:
  21.         FunctionDictionary();
  22. };
  23.  
  24. struct keydef_pair
  25. {
  26.     char key[KEY_NAME_LEN];
  27.     char prog[1];
  28. };
  29.  
  30. int macro_len(char *macro);
  31.  
  32. class KeyDefCollection:public SortedCollection
  33. {
  34.         FunctionDictionary Func_DIC;
  35.         int compile_keydef(char *str, char *out);
  36.     public:
  37.         KeyDefCollection():SortedCollection(),Func_DIC() {bDuplicates = 0;}
  38.  
  39.         virtual int Compare(Ptr p1, Ptr p2);
  40.  
  41.         void InsKey(char *buf, int namelen);
  42.         void AddAssignment(char *keyname, char *prog);
  43.  
  44.         char *GetDef(char *key);
  45. };
  46.  
  47. #endif  /* __KEYCOLL_H */
  48.  
  49.