Ejemplo n.º 1
0
static void file_stats(struct httpd_state *pstate, char *ptr)
{
  char buffer[16];
  char *pcount = strchr(ptr, ' ') + 1;
  snprintf(buffer, 16, "%5u", httpd_fs_count(pcount));
  (void)send(pstate->ht_sockfd, buffer, strlen(buffer), 0);
}
Ejemplo n.º 2
0
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
  char *f = (char *)arg;
  // Renesas -- return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
  return sprintf((char *)uip_appdata, "%5u", httpd_fs_count(f));
}
Ejemplo n.º 3
0
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
  char *f = (char *)arg;

  return snprintf((char *)uip_appdata, uip_mss(), "%5u", httpd_fs_count(f));
}
Ejemplo n.º 4
0
static u8_t
file_stats(void)
{
  /* We use sprintf() to print the number of file accesses to a
     particular file (given as an argument to the function in the
     script). We then use uip_send() to actually send the data. */
  if(uip_acked()) {
    return 1;
  }
  uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", httpd_fs_count(&hs->script[4])));
  return 0;
}
Ejemplo n.º 5
0
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
  char *f = (char *)arg;


/* TEST */
//  char teststring[10] = "250";
//  unsigned int sampleNumber = atoi(teststring);
//  return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u%d", httpd_fs_count(f), sampleNumber);


  return snprintf((char *)uip_appdata, UIP_APPDATA_SIZE, "%5u", httpd_fs_count(f));
}
Ejemplo n.º 6
0
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
  char *f = (char *)arg;
  int i;
  char tmp[20];
// for (i=0;i<20;i++) if (pgm_read_byte(f++)==' ') break;	//skip file-stats string
  for (i=0;i<19;i++) {
	tmp[i]=pgm_read_byte(f++);			//transfer "/filename" to RAM
	if (tmp[i]==' ') {
	  tmp[i]=0;
        break;
      }
  }
//  return sprintf_P((char *)uip_appdata, PSTR( "%s"), tmp); //show file name for debugging
  return snprintf_P((char *)uip_appdata, uip_mss(), PSTR("%5u"), httpd_fs_count(tmp));
//  return snprintf_P((char *)uip_appdata, uip_mss(), PSTR("%5u"), httpd_fs_count(f));
}
Ejemplo n.º 7
0
/*---------------------------------------------------------------------------*/
static unsigned short
generate_file_stats(void *arg)
{
    char *f = (char *)arg;
    return mon_sprintf((char *)uip_appdata, /*UIP_APPDATA_SIZE,*/ "%5u", httpd_fs_count(f));
}