Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • cont-frb/moberg-review
  • v0.9.20
  • v0.9.19
  • v0.9.18
  • v0.9.17
  • v0.9.16
  • v0.9.15
  • v0.9.14
  • v0.9.13
  • v0.9.12
  • v0.9.11
  • v0.9.10
  • v0.9.9
  • v0.9.8
  • v0.9.7
  • v0.9.6
  • v0.9.5
  • v0.9.4
  • v0.9.3
  • v0.9.2
  • v0.9.1
22 results

moberg_tool.c

Blame
  • Forked from Anders Blomdell / moberg
    66 commits behind the upstream repository.
    moberg_tool.c 751 B
    #include <stdlib.h>
    #include <stdio.h>
    #include <string.h>
    #include <moberg.h>
    
    void usage(char *prog) {
      fprintf(stderr, "%s [ --start | --stop | -h | --help ]\n", prog);
    }
    
    int main(int argc, char *argv[])
    {
      
      if (argc == 2 && strcmp(argv[1], "--start") == 0) {
        struct moberg *moberg = moberg_new(NULL);
        moberg_start(moberg, stdout);
        moberg_free(moberg);    
      } else if (argc == 2 && strcmp(argv[1], "--stop") == 0) {
        struct moberg *moberg = moberg_new(NULL);
        moberg_stop(moberg, stdout);
        moberg_free(moberg);    
      } else if (argc == 2 && strcmp(argv[1], "-h") == 0) {
        usage(argv[0]);
      } else if (argc == 2 && strcmp(argv[1], "--help") == 0) {
        usage(argv[0]);
      } else {
        usage(argv[0]);
        exit(1);
      }
    }