Changeset cf83b7a for keybinding.c


Ignore:
Timestamp:
Jun 30, 2003, 6:12:40 PM (17 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
453bd70
Parents:
c9334b1
Message:
Started adding code to do question/response stuff
File:
1 edited

Legend:

Unmodified
Added
Removed
  • keybinding.c

    r1aee7d9 rcf83b7a  
    1414
    1515/* sets up a new keybinding for a command */
    16 int owl_keybinding_init(owl_keybinding *kb, char *keyseq, char *command, void (*function_fn)(void), char *desc) {
     16int owl_keybinding_init(owl_keybinding *kb, char *keyseq, char *command, void (*function_fn)(void), char *desc)
     17{
    1718  char **ktokens;
    1819  int    nktokens, i;
     
    5253
    5354/* Releases data associated with a keybinding */
    54 void owl_keybinding_free(owl_keybinding *kb) {
     55void owl_keybinding_free(owl_keybinding *kb)
     56{
    5557  if (kb->j) owl_free(kb->j);
    5658  if (kb->desc) owl_free(kb->desc);
     
    5961
    6062/* Releases data associated with a keybinding, and the kb itself */
    61 void owl_keybinding_free_all(owl_keybinding *kb) {
     63void owl_keybinding_free_all(owl_keybinding *kb)
     64{
    6265  owl_keybinding_free(kb);
    6366  owl_free(kb);
     
    6568
    6669/* executes a keybinding */
    67 void owl_keybinding_execute(owl_keybinding *kb, int j) {
     70void owl_keybinding_execute(owl_keybinding *kb, int j)
     71{
    6872  if (kb->type == OWL_KEYBINDING_COMMAND && kb->command) {
    6973    owl_function_command_norv(kb->command);
     
    7478
    7579/* returns 0 on success */
    76 int owl_keybinding_stack_tostring(int *j, char *buff, int bufflen) {
     80int owl_keybinding_stack_tostring(int *j, char *buff, int bufflen)
     81{
    7782  char *pos = buff;
    7883  int   rem = bufflen;
     
    9095
    9196/* returns 0 on success */
    92 int owl_keybinding_tostring(owl_keybinding *kb, char *buff, int bufflen) {
     97int owl_keybinding_tostring(owl_keybinding *kb, char *buff, int bufflen)
     98{
    9399  return owl_keybinding_stack_tostring(kb->j, buff, bufflen);
    94100}
    95101
    96 char *owl_keybinding_get_desc(owl_keybinding *kb) {
     102char *owl_keybinding_get_desc(owl_keybinding *kb)
     103{
    97104  return kb->desc;
    98105}
    99106
    100107/* returns 0 on no match, 1 on subset match, and 2 on complete match */
    101 int owl_keybinding_match(owl_keybinding *kb, int *kpstack) {
     108int owl_keybinding_match(owl_keybinding *kb, int *kpstack)
     109{
    102110  int *kbstack = kb->j;
    103111 
     
    118126
    119127/* returns 1 if keypress sequence is the same */
    120 int owl_keybinding_equal(owl_keybinding *kb1, owl_keybinding *kb2) {
     128int owl_keybinding_equal(owl_keybinding *kb1, owl_keybinding *kb2)
     129{
    121130  int *j1 = kb1->j;
    122131  int *j2 = kb2->j;
Note: See TracChangeset for help on using the changeset viewer.