/*
 * Copyright 1988, 1989, 1990, 1991 Massachusetts Institute of Technology
 */
#ifdef SAMPLE
#include "structs.h"

sample_ext_ctrl(cmd, data)
     int cmd;
     caddr_t data;
{
  switch (cmd) {
  case EXT_INIT:  /* Initialize */
    if (DEBUG) printf("Sample extension initialized.\n");
    return 0;
    break;
  case EXT_PREBUILD:   /* Just before a volume list rebuild */
    if (DEBUG) printf("Sample extension prebuild.\n");
    return 0;
    break;
  case EXT_POSTBUILD:   /* Just after a volume list rebuild */
    if (DEBUG) printf("Sample extension postbuild.\n");
    return 0;
    break;
  case EXT_PERIODIC:       /* Every QUERYTIME seconds of idle time */
/*    if (DEBUG) printf("Sample extension periodic.\n");*/
    return 0;
    break;
  case EXT_SHUTOFF:      /* Just before server shutoff */
    if (DEBUG) printf("Sample extension shutoff.\n");
    return 0;
    break;
  default:
    bsdsyslog(LOG_NOTICE, "sample_ext_ctl: bad command: %d", cmd);
    return -1;
  }
}

sample_ext_dofuncs(msgsock, hostcommand, clinum)
     int msgsock, clinum;
     Galatea_packet *hostcommand;
{
/*  parm[0] is used to find the extension, like the major protocol number in
    X11.  The extension is free to use the other parm's for whatever it wants.
    Using parm[1] for the extension's dispatch will probably be typical, but 
    who knows? */

  switch (hostcommand->parm[1]) {
  case 0:
    if (DEBUG) printf("sample_ext_dofuncs: called with minor # 0\n");
    break;
  case 1:
    if (DEBUG) printf("sample_ext_dofuncs: called with minor # 1\n");
    break;
  default:
    if (DEBUG) printf("sample_ext_dofuncs: ERROR: called with minor # %d\n",
		      hostcommand->parm[1]);
    return -1;
  }
  return 0;
}


#endif /* SAMPLE */
