xref: /illumos-gate/usr/src/lib/krb5/ss/options.c (revision 1da57d55)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright 1987, 1988 by MIT Student Information Processing Board
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * For copyright information, see copyright.h.
5*7c478bd9Sstevel@tonic-gate  */
6*7c478bd9Sstevel@tonic-gate #include "copyright.h"
7*7c478bd9Sstevel@tonic-gate #include <stdio.h>
8*7c478bd9Sstevel@tonic-gate #include <ss/ss.h>
9*7c478bd9Sstevel@tonic-gate 
10*7c478bd9Sstevel@tonic-gate struct option {
11*7c478bd9Sstevel@tonic-gate      char *text;
12*7c478bd9Sstevel@tonic-gate      long value;
13*7c478bd9Sstevel@tonic-gate };
14*7c478bd9Sstevel@tonic-gate 
15*7c478bd9Sstevel@tonic-gate static struct option options[] = {
16*7c478bd9Sstevel@tonic-gate      { "dont_list", SS_OPT_DONT_LIST },
17*7c478bd9Sstevel@tonic-gate      { "^list", SS_OPT_DONT_LIST },
18*7c478bd9Sstevel@tonic-gate      { "dont_summarize", SS_OPT_DONT_SUMMARIZE },
19*7c478bd9Sstevel@tonic-gate      { "^summarize", SS_OPT_DONT_SUMMARIZE },
20*7c478bd9Sstevel@tonic-gate      { (char *)NULL, 0 }
21*7c478bd9Sstevel@tonic-gate };
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate long
flag_val(string)24*7c478bd9Sstevel@tonic-gate flag_val(string)
25*7c478bd9Sstevel@tonic-gate      register char *string;
26*7c478bd9Sstevel@tonic-gate {
27*7c478bd9Sstevel@tonic-gate      register struct option *opt;
28*7c478bd9Sstevel@tonic-gate      for (opt = options; opt->text; opt++)
29*7c478bd9Sstevel@tonic-gate 	  if (!strcmp(opt->text, string))
30*7c478bd9Sstevel@tonic-gate 	       return(opt->value);
31*7c478bd9Sstevel@tonic-gate      return(0);
32*7c478bd9Sstevel@tonic-gate }
33