index — thing @ 7a2b1e0c05f690291f01dcfa0560bbd8acc01ad1

A little something I'm working on

main.c (view raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
#include <stdio.h>
#include <termios.h>

#include "menu.h"
#include "term.h"

int main() {
  uint8_t ret = 0;
  struct termios old_term;
  setup_term(&old_term);

  static char *elements[] = {"hi", "hello", "what's up", "dang",
                             "this is cool"};

  int seli = menu(elements, 5);
  if (seli < 0) {
    printf("ERROR: menu failed");
    ret = 1;
  }

  return_term(&old_term);
  if (ret == 0) {
    printf("%s", elements[seli]);
  }

  return ret;
}