index — thing @ 2c3a0ee83d01236273cc62964cd8f1b3788050a5

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;
}