- Timestamp:
- Jun 22, 2003, 1:45:23 PM (22 years ago)
- Branches:
- master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- e4eebe8
- Parents:
- e187445
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
context.c
recd5dc5 r53f421b 7 7 #define SET_MODE(ctx, new) ctx->mode = ((ctx->mode)&~OWL_CTX_MODE_BITS)|new 8 8 9 int owl_context_init(owl_context *ctx) { 9 int owl_context_init(owl_context *ctx) 10 { 10 11 ctx->mode = OWL_CTX_STARTUP; 11 12 ctx->data = NULL; … … 15 16 16 17 /* returns whether test matches the current context */ 17 int owl_context_matches(owl_context *ctx, int test) { 18 int owl_context_matches(owl_context *ctx, int test) 19 { 18 20 /*owl_function_debugmsg(", current: 0x%04x test: 0x%04x\n", ctx->mode, test);*/ 19 21 if ((((ctx->mode&OWL_CTX_MODE_BITS) & test) … … 28 30 } 29 31 30 void *owl_context_get_data(owl_context *ctx) { 32 void *owl_context_get_data(owl_context *ctx) 33 { 31 34 return ctx->data; 32 35 } 33 36 34 int owl_context_get_mode(owl_context *ctx) { 37 int owl_context_get_mode(owl_context *ctx) 38 { 35 39 return ctx->mode & OWL_CTX_MODE_BITS; 36 40 } 37 41 38 int owl_context_get_active(owl_context *ctx) { 42 int owl_context_get_active(owl_context *ctx) 43 { 39 44 return ctx->mode & OWL_CTX_ACTIVE_BITS; 40 45 } 41 46 42 int owl_context_is_startup(owl_context *ctx) { 47 int owl_context_is_startup(owl_context *ctx) 48 { 43 49 return (ctx->mode & OWL_CTX_STARTUP)?1:0; 44 50 } 45 51 46 int owl_context_is_interactive(owl_context *ctx) { 52 int owl_context_is_interactive(owl_context *ctx) 53 { 47 54 return(ctx->mode & OWL_CTX_INTERACTIVE)?1:0; 48 55 } 49 56 50 void owl_context_set_startup(owl_context *ctx) { 57 void owl_context_set_startup(owl_context *ctx) 58 { 51 59 SET_MODE(ctx, OWL_CTX_STARTUP); 52 60 } 53 61 54 void owl_context_set_readconfig(owl_context *ctx) { 62 void owl_context_set_readconfig(owl_context *ctx) 63 { 55 64 SET_MODE(ctx, OWL_CTX_READCONFIG); 56 65 } 57 66 58 void owl_context_set_interactive(owl_context *ctx) { 67 void owl_context_set_interactive(owl_context *ctx) 68 { 59 69 SET_MODE(ctx, OWL_CTX_INTERACTIVE); 60 70 } 61 71 62 void owl_context_set_popless(owl_context *ctx, owl_viewwin *vw) { 72 void owl_context_set_popless(owl_context *ctx, owl_viewwin *vw) 73 { 63 74 ctx->data = (void*)vw; 64 75 SET_ACTIVE(ctx, OWL_CTX_POPLESS); 65 76 } 66 77 67 void owl_context_set_recv(owl_context *ctx) { 78 void owl_context_set_recv(owl_context *ctx) 79 { 68 80 SET_ACTIVE(ctx, OWL_CTX_RECV); 69 81 } 70 82 71 void owl_context_set_editmulti(owl_context *ctx, owl_editwin *ew) { 83 void owl_context_set_editmulti(owl_context *ctx, owl_editwin *ew) 84 { 72 85 ctx->data = (void*)ew; 73 86 SET_ACTIVE(ctx, OWL_CTX_EDITMULTI); 74 87 } 75 88 76 void owl_context_set_editline(owl_context *ctx, owl_editwin *ew) { 89 void owl_context_set_editline(owl_context *ctx, owl_editwin *ew) 90 { 77 91 ctx->data = (void*)ew; 78 92 SET_ACTIVE(ctx, OWL_CTX_EDITLINE);
Note: See TracChangeset
for help on using the changeset viewer.