/**********************************************************************
 * luc_flgset.c -- translate user-readable string into set flags
 *
 * $Author: brlewis $
 * $Source: /afs/athena.mit.edu/astaff/project/lucydev/src/lib/RCS/luc_flgset.c,v $
 * $Header: /afs/athena.mit.edu/astaff/project/lucydev/src/lib/RCS/luc_flgset.c,v 1.1 91/09/24 14:34:23 brlewis Exp Locker: brlewis $
 *
 * Copyright 1991 by the Massachusetts Institute of Technology.
 *
 * For copying and distribution information, please see the file
 * <mit-copyright.h>.
 **********************************************************************/
#include <mit-copyright.h>

#ifndef lint
static char rcsid_luc_flgset_c[] = "$Header: /afs/athena.mit.edu/astaff/project/lucydev/src/lib/RCS/luc_flgset.c,v 1.1 91/09/24 14:34:23 brlewis Exp Locker: brlewis $";
#endif /* lint */

#include <strings.h>
#include <lucy/lucy.h>

/**********************************************************************
 * luc_flgset(char *s)
 *	caller sets s to flag string
 *
 * - returns flags set in string s
 **********************************************************************/

int
luc_flgset(s)
     register char *s;
{
  int n=0;

  while (*s)
    switch (*s++) {
    case 'F':
      n |= LUCY_FORWARDED;
      break;
    case 'f':
      n |= LUCY_WANT_FORWARD;
      break;
    case 'A':
      n |= LUCY_ANSWERED;
      break;
    case 'a':
      n |= LUCY_WANT_ANSWER;
      break;
    case 'P':
      n |= LUCY_POSTED;
      break;
    case 'p':
      n |= LUCY_WANT_POST;
      break;
    case 'R':
      n |= LUCY_REPLIED;
      break;
    case 'r':
      n |= LUCY_WANT_REPLY;
      break;
    }
  return(n);
}
