examples/pager.c
static int pager_notify_open(struct fusd_file_info *file)
{
  /* create state for this client */
  struct pager_client *c = malloc(sizeof(struct pager_client));

  if (c == NULL)
    return -ENOBUFS;

  /* initialize fields of this client state */
  memset(c, 0, sizeof(struct pager_client));
  c->last_page_seen = last_page;

  /* save the pointer to this state so it gets returned to us later */
  file->private_data = c;

  /* add this client to the client list */
  c->next = client_list;
  client_list = c;
  
  return 0;
}
/* EXAMPLE START pager-open.c */
/* open on /dev/pager/notify: create state for this client */
EXAMPLE START pager-open.c
open on /dev/pager/notify: create state for this client
EXAMPLE START pager - open . c open on / dev / pager / notify : create state for this client
static int pager_notify_open(struct fusd_file_info *file)
{
  struct pager_client *c = malloc(sizeof(struct pager_client));
  if (c == NULL)
    return -ENOBUFS;
  memset(c, 0, sizeof(struct pager_client));
  c->last_page_seen = last_page;
  file->private_data = c;
  c->next = client_list;
  client_list = c;
  return 0;
}
static int pager_notify_open ( struct fusd_file_info * file ) { struct pager_client * c = malloc ( sizeof ( struct pager_client ) ) ; if ( c == NULL ) return - ENOBUFS ; memset ( c , 0 , sizeof ( struct pager_client ) ) ; c -> last_page_seen = last_page ; file -> private_data = c ; c -> next = client_list ; client_list = c ; return 0 ; }
EXAMPLE START pager-open.c
open on /dev/pager/notify: create state for this client
EXAMPLE START pager - open . c open on / dev / pager / notify : create state for this client
/* create state for this client */ /* initialize fields of this client state */ /* save the pointer to this state so it gets returned to us later */ /* add this client to the client list */