Changes in owl.h [b9517cf:ca1fb26a]
Legend:
- Unmodified
- Added
- Removed
-
owl.h
rb9517cf rca1fb26a 10 10 #define INC_BARNOWL_OWL_H 11 11 12 #include "config.h"12 #include <config.h> 13 13 14 14 #include "compat/compat.h" … … 47 47 /* Perl and curses don't play nice. */ 48 48 #ifdef OWL_PERL 49 typedef voidWINDOW;50 typedef voidPANEL;49 typedef struct _owl_fake_WINDOW WINDOW; 50 typedef struct _owl_fake_PANEL PANEL; 51 51 /* logout is defined in FreeBSD. */ 52 52 #define logout logout_ … … 57 57 #include "XSUB.h" 58 58 #else 59 typedef voidSV;60 typedef voidAV;61 typedef voidHV;59 typedef struct _owl_fake_SV SV; 60 typedef struct _owl_fake_AV AV; 61 typedef struct _owl_fake_HV HV; 62 62 #endif 63 63 64 64 #include "window.h" 65 65 66 #ifndef OWL_VERSION_STRING 67 #ifdef GIT_VERSION 68 #define stringify(x) __stringify(x) 69 #define __stringify(x) #x 70 #define OWL_VERSION_STRING stringify(GIT_VERSION) 71 #else 72 #define OWL_VERSION_STRING PACKAGE_VERSION 73 #endif 74 #endif /* !OWL_VERSION_STRING */ 66 extern const char *version; 75 67 76 68 /* Feature that is being tested to redirect stderr through a pipe. … … 235 227 char *name; 236 228 int type; /* OWL_VARIABLE_* */ 237 void *pval_default; /* for types other and string */ 238 int ival_default; /* for types int and bool */ 239 const char *validsettings; /* documentation of valid settings */ 229 char *default_str; /* the default value as a string */ 230 char *validsettings; /* documentation of valid settings */ 240 231 char *summary; /* summary of usage */ 241 232 char *description; /* detailed description */ 242 void *val; /* current value */ 243 int (*validate_fn)(const struct _owl_variable *v, const void *newval); 233 bool takes_on_off; /* allow passing on/off in argument-less set/unset */ 234 GClosure *set_fromstring_fn; 235 /* sets the variable to a value 236 * of the appropriate type. 237 * unless documented, this 238 * should make a copy. 239 * returns 0 on success. */ 240 GClosure *get_tostring_fn; 241 /* converts val to a string; 242 * caller must free the result */ 243 244 /* These are only valid for OWL_VARIABLE_{INT,BOOL,STRING} */ 245 GValue val; /* current value, if default get_fn/set_fn */ 246 247 GCallback get_fn; 248 /* returns a reference to the current value. 249 * WARNING: this approach is hard to make 250 * thread-safe... */ 251 GCallback validate_fn; 244 252 /* returns 1 if newval is valid */ 245 int (*set_fn)(struct _owl_variable *v, const void *newval);253 GCallback set_fn; 246 254 /* sets the variable to a value 247 * of the appropriate type. 248 * unless documented, this 249 * should make a copy. 250 * returns 0 on success. */ 251 int (*set_fromstring_fn)(struct _owl_variable *v, const char *newval); 252 /* sets the variable to a value 253 * of the appropriate type. 254 * unless documented, this 255 * should make a copy. 256 * returns 0 on success. */ 257 const void *(*get_fn)(const struct _owl_variable *v); 258 /* returns a reference to the current value. 259 * WARNING: this approach is hard to make 260 * thread-safe... */ 261 CALLER_OWN char *(*get_tostring_fn)(const struct _owl_variable *v, const void *val); 262 /* converts val to a string; 263 * caller must free the result */ 264 void (*delete_fn)(struct _owl_variable *v); 265 /* frees val as needed */ 255 * of the appropriate type. 256 * unless documented, this 257 * should make a copy. 258 * returns 0 on success. */ 266 259 } owl_variable; 260 267 261 268 262 typedef struct _owl_input { … … 452 446 char *name; 453 447 owl_filter *filter; 454 owl_messagelist ml;448 owl_messagelist *ml; 455 449 const owl_style *style; 456 450 int cachedmsgid; … … 533 527 534 528 typedef struct _owl_global { 535 owl_mainwin mw;529 owl_mainwin *mw; 536 530 owl_popwin *pw; 537 531 owl_msgwin msgwin; … … 551 545 int curmsg_vert_offset; 552 546 owl_view current_view; 553 owl_messagelist msglist;547 owl_messagelist *msglist; 554 548 WINDOW *input_pad; 555 549 owl_mainpanel mainpanel; … … 569 563 time_t starttime; 570 564 time_t lastinputtime; 565 time_t last_wakeup_time; 571 566 char *startupargs; 572 567 int nextmsgid; … … 596 591 char *kill_buffer; 597 592 int interrupt_count; 593 #if GLIB_CHECK_VERSION(2, 31, 0) 594 GMutex interrupt_lock; 595 #else 598 596 GMutex *interrupt_lock; 597 #endif 599 598 } owl_global; 600 599 … … 602 601 extern owl_global g; 603 602 604 #include "owl_prototypes.h"603 #include <owl_prototypes.h> 605 604 606 605 /* These were missing from the Zephyr includes before Zephyr 3. */ … … 610 609 #endif 611 610 611 /* We have to dynamically bind these ourselves */ 612 extern gboolean (*gvalue_from_sv) (GValue * value, SV * sv); 613 extern SV * (*sv_from_gvalue) (const GValue * value); 614 extern GClosure * (*perl_closure_new) (SV * callback, SV * data, gboolean swap); 615 616 612 617 #endif /* INC_BARNOWL_OWL_H */
Note: See TracChangeset
for help on using the changeset viewer.