Changeset e778351 for variable.c


Ignore:
Timestamp:
Mar 25, 2011, 10:58:23 PM (13 years ago)
Author:
Jason Gross <jgross@mit.edu>
Parents:
f27b044
Message:
Ability to set exposure arbitrarily (like "zctl set exposure")

A zephyr variable 'exposure' has been added.  It defaults to the value
in ~/.zephyr.vars, if there is one, or to realm-visible.  Setting this
variable does not affect the value in ~/.zephyr.vars.

Additionally, OWLVAR_STRING_FULL has been modified to allow custom
setting of validset.

This fixes ticket # 65.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • variable.c

    rf27b044 re778351  
    3030        NULL, NULL, NULL, NULL, NULL, NULL }
    3131
    32 #define OWLVAR_STRING_FULL(name,default,summary,description,validate,set,get) \
    33         { name, OWL_VARIABLE_STRING, default, 0, "<string>", summary,description, NULL, \
     32#define OWLVAR_STRING_FULL(name,default,validset,summary,description,validate,set,get) \
     33        { name, OWL_VARIABLE_STRING, default, 0, validset, summary,description, NULL, \
    3434        validate, set, NULL, get, NULL, NULL }
    3535
     
    266266                 "" ),
    267267
    268   OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "tty name for zephyr location", "",
     268  OWLVAR_STRING_FULL( "tty" /* %OwlVarStub */, "", "<string>", "tty name for zephyr location", "",
    269269                      NULL, owl_variable_tty_set, NULL),
    270270
     
    370370               "delete a message right as it came in.\n" ),
    371371
     372  OWLVAR_STRING_FULL( "exposure" /* %OwlVarStub */, "",
     373                      "none,opstaff,realm-visible,realm-announced,net-visible,net-announced",
     374                      "controls who can zlocate you",
     375                      "The exposure-level defaults realm-visible, unless configured otherwise\n"
     376                      "in ~/.zephyr.vars, and can be one of the following\n"
     377                      "(listed from least exposure to widest exposure, as listed in zctl(1)):\n"
     378                      "   none            - This completely disables Zephyr for the user. \n"
     379                      "                     The user is not registered with Zephyr.  No user\n"
     380                      "                     location information is retained by Zephyr.  No\n"
     381                      "                     login or logout announcements will be sent.  No\n"
     382                      "                     subscriptions will be entered for the user, and\n"
     383                      "                     no notices will be displayed by zwgc(1).\n"
     384                      "   opstaff         - The user is registered with Zephyr.  No login or\n"
     385                      "                     logout announcements will be sent, and location\n"
     386                      "                     information will only be visible to Operations\n"
     387                      "                     staff.  Default subscriptions and any additional\n"
     388                      "                     personal subscriptions will be entered for the\n"
     389                      "                     user.\n"
     390                      "   realm-visible   - The user is registered with Zephyr.  User\n"
     391                      "                     location information is retained by Zephyr and\n"
     392                      "                     made available only to users within the user’s\n"
     393                      "                     Kerberos realm.  No login or logout\n"
     394                      "                     announcements will be sent.  This is the system\n"
     395                      "                     default.  Default subscriptions and any\n"
     396                      "                     additional personal subscriptions will be\n"
     397                      "                     entered for the user.\n"
     398                      "   realm-announced - The user is registered with Zephyr.  User\n"
     399                      "                     location information is retained by Zephyr and\n"
     400                      "                     made available only to users authenticated\n"
     401                      "                     within the user’s Kerberos realm.  Login and\n"
     402                      "                     logout announcements will be sent, but only to\n"
     403                      "                     users within the user’s Kerberos realm who have\n"
     404                      "                     explicitly requested such via subscriptions. \n"
     405                      "                     Default subscriptions and any additional\n"
     406                      "                     personal subscriptions will be entered for the\n"
     407                      "                     user.\n"
     408                      "   net-visible     - The user is registered with Zephyr.  User\n"
     409                      "                     location information is retained by Zephyr and\n"
     410                      "                     made available to any authenticated user who\n"
     411                      "                     requests such.  Login and logout announcements\n"
     412                      "                     will be sent only to users within the user’s\n"
     413                      "                     Kerberos realm who have explicitly requested\n"
     414                      "                     such via subscriptions.  Default subscriptions\n"
     415                      "                     and any additional personal subscriptions will\n"
     416                      "                     be entered for the user.\n"
     417                      "   net-announced   - The user is registered with Zephyr.  User\n"
     418                      "                     location information is retained by Zephyr and\n"
     419                      "                     made available to any authenticated user who\n"
     420                      "                     requests such.  Login and logout announcements\n"
     421                      "                     will be sent to any user has requested such. \n"
     422                      "                     Default subscriptions and any additional\n"
     423                      "                     personal subscriptions will be entered for the\n"
     424                      "                     user.\n",
     425                      NULL, owl_variable_exposure_set, owl_variable_exposure_get ),
     426
    372427  /* This MUST be last... */
    373428  { NULL, 0, NULL, 0, NULL, NULL, NULL, NULL,
     
    470525}
    471526
     527int owl_variable_exposure_set(owl_variable *v, const void *newval)
     528{
     529  return owl_zephyr_set_exposure(newval);
     530}
     531
     532const void *owl_variable_exposure_get(const owl_variable *v)
     533{
     534  return owl_zephyr_get_exposure();
     535}
    472536
    473537/**************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.