Commit 6a9479ec authored by Bill Meier's avatar Bill Meier

Add editor modelines and/or adjust whilespace.

Change-Id: I626b7bd8ac6e4b91c57cc9152e7ce038754e7278
Reviewed-on: https://code.wireshark.org/review/4658Reviewed-by: default avatarBill Meier <wmeier@newsguy.com>
parent 63faad68
......@@ -45,24 +45,24 @@ typedef struct _afpstat_t {
static int
afpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)
{
afpstat_t *ss=(afpstat_t *)pss;
const afp_request_val *request_val=(const afp_request_val *)prv;
afpstat_t *ss = (afpstat_t *)pss;
const afp_request_val *request_val = (const afp_request_val *)prv;
nstime_t t, deltat;
timestat_t *sp=NULL;
timestat_t *sp = NULL;
/* if we havnt seen the request, just ignore it */
if(!request_val){
if (!request_val) {
return 0;
}
sp=&(ss->proc[request_val->command]);
sp = &(ss->proc[request_val->command]);
/* calculate time delta between request and reply */
t=pinfo->fd->abs_ts;
t = pinfo->fd->abs_ts;
nstime_delta(&deltat, &t, &request_val->req_time);
if(sp){
time_stat_update(sp,&deltat, pinfo);
if (sp) {
time_stat_update(sp, &deltat, pinfo);
}
return 1;
......@@ -71,35 +71,35 @@ afpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const voi
static void
afpstat_draw(void *pss)
{
afpstat_t *ss=(afpstat_t *)pss;
afpstat_t *ss = (afpstat_t *)pss;
guint32 i;
guint64 td;
printf("\n");
printf("===================================================================\n");
printf("AFP SRT Statistics:\n");
printf("Filter: %s\n",ss->filter?ss->filter:"");
printf("Filter: %s\n", ss->filter ? ss->filter : "");
printf("Commands Calls Min SRT Max SRT Avg SRT\n");
for(i=0;i<256;i++){
for (i=0; i<256; i++) {
/* nothing seen, nothing to do */
if(ss->proc[i].num==0){
if (ss->proc[i].num == 0) {
continue;
}
/* scale it to units of 10us.*/
td=ss->proc[i].tot.secs;
td=td*100000+(int)ss->proc[i].tot.nsecs/10000;
if(ss->proc[i].num){
td/=ss->proc[i].num;
td = ss->proc[i].tot.secs;
td = td*100000+(int)ss->proc[i].tot.nsecs/10000;
if (ss->proc[i].num) {
td /= ss->proc[i].num;
} else {
td=0;
td = 0;
}
printf("%-25s %6d %3d.%05d %3d.%05d %3" G_GINT64_MODIFIER "u.%05" G_GINT64_MODIFIER "u\n",
val_to_str_ext(i, &CommandCode_vals_ext, "Unknown (%u)"),
ss->proc[i].num,
(int)ss->proc[i].min.secs,ss->proc[i].min.nsecs/10000,
(int)ss->proc[i].max.secs,ss->proc[i].max.nsecs/10000,
td/100000, td%100000
val_to_str_ext(i, &CommandCode_vals_ext, "Unknown (%u)"),
ss->proc[i].num,
(int)ss->proc[i].min.secs, ss->proc[i].min.nsecs/10000,
(int)ss->proc[i].max.secs, ss->proc[i].max.nsecs/10000,
td/100000, td%100000
);
}
printf("===================================================================\n");
......@@ -107,40 +107,40 @@ afpstat_draw(void *pss)
static void
afpstat_init(const char *opt_arg, void* userdata _U_)
afpstat_init(const char *opt_arg, void *userdata _U_)
{
afpstat_t *ss;
guint32 i;
const char *filter=NULL;
const char *filter = NULL;
GString *error_string;
if(!strncmp(opt_arg,"afp,srt,",8)){
filter=opt_arg+8;
if (!strncmp(opt_arg, "afp,srt,", 8)) {
filter = opt_arg+8;
} else {
filter=NULL;
filter = NULL;
}
ss=g_new(afpstat_t,1);
if(filter){
ss->filter=g_strdup(filter);
ss = g_new(afpstat_t, 1);
if (filter) {
ss->filter = g_strdup(filter);
} else {
ss->filter=NULL;
ss->filter = NULL;
}
for(i=0;i<256;i++){
ss->proc[i].num=0;
ss->proc[i].min_num=0;
ss->proc[i].max_num=0;
ss->proc[i].min.secs=0;
ss->proc[i].min.nsecs=0;
ss->proc[i].max.secs=0;
ss->proc[i].max.nsecs=0;
ss->proc[i].tot.secs=0;
ss->proc[i].tot.nsecs=0;
for (i=0; i<256; i++) {
ss->proc[i].num = 0;
ss->proc[i].min_num = 0;
ss->proc[i].max_num = 0;
ss->proc[i].min.secs = 0;
ss->proc[i].min.nsecs = 0;
ss->proc[i].max.secs = 0;
ss->proc[i].max.nsecs = 0;
ss->proc[i].tot.secs = 0;
ss->proc[i].tot.nsecs = 0;
}
error_string=register_tap_listener("afp", ss, filter, 0, NULL, afpstat_packet, afpstat_draw);
if(error_string){
error_string = register_tap_listener("afp", ss, filter, 0, NULL, afpstat_packet, afpstat_draw);
if (error_string) {
/* error, we failed to attach to the tap. clean up */
g_free(ss->filter);
g_free(ss);
......@@ -155,5 +155,18 @@ afpstat_init(const char *opt_arg, void* userdata _U_)
void
register_tap_listener_afpstat(void)
{
register_stat_cmd_arg("afp,srt", afpstat_init,NULL);
register_stat_cmd_arg("afp,srt", afpstat_init, NULL);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
......@@ -42,37 +42,37 @@
void register_tap_listener_ansi_astat(void);
typedef struct _ansi_a_stat_t {
int bsmap_message_type[0xff];
int dtap_message_type[0xff];
int bsmap_message_type[0xff];
int dtap_message_type[0xff];
} ansi_a_stat_t;
static int
ansi_a_stat_packet(
void *tapdata,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *data)
void *tapdata,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *data)
{
ansi_a_stat_t *stat_p = (ansi_a_stat_t *)tapdata;
const ansi_a_tap_rec_t *tap_p = (const ansi_a_tap_rec_t *)data;
ansi_a_stat_t *stat_p = (ansi_a_stat_t *)tapdata;
const ansi_a_tap_rec_t *tap_p = (const ansi_a_tap_rec_t *)data;
switch (tap_p->pdu_type)
{
case BSSAP_PDU_TYPE_BSMAP:
stat_p->bsmap_message_type[tap_p->message_type]++;
break;
stat_p->bsmap_message_type[tap_p->message_type]++;
break;
case BSSAP_PDU_TYPE_DTAP:
stat_p->dtap_message_type[tap_p->message_type]++;
break;
stat_p->dtap_message_type[tap_p->message_type]++;
break;
default:
/*
* unknown PDU type !!!
*/
return(0);
/*
* unknown PDU type !!!
*/
return(0);
}
return(1);
......@@ -81,10 +81,10 @@ ansi_a_stat_packet(
static void
ansi_a_stat_draw(
void *tapdata)
void *tapdata)
{
ansi_a_stat_t *stat_p = (ansi_a_stat_t *)tapdata;
guint8 i;
ansi_a_stat_t *stat_p = (ansi_a_stat_t *)tapdata;
guint8 i;
printf("\n");
......@@ -95,15 +95,15 @@ ansi_a_stat_draw(
i = 0;
while (ansi_a_ios401_bsmap_strings[i].strptr)
{
if (stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value] > 0)
{
printf("0x%02x %-50s%d\n",
ansi_a_ios401_bsmap_strings[i].value,
ansi_a_ios401_bsmap_strings[i].strptr,
stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value]);
}
i++;
if (stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value] > 0)
{
printf("0x%02x %-50s%d\n",
ansi_a_ios401_bsmap_strings[i].value,
ansi_a_ios401_bsmap_strings[i].strptr,
stat_p->bsmap_message_type[ansi_a_ios401_bsmap_strings[i].value]);
}
i++;
}
printf("\nDTAP\n");
......@@ -112,15 +112,15 @@ ansi_a_stat_draw(
i = 0;
while (ansi_a_ios401_dtap_strings[i].strptr)
{
if (stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value] > 0)
{
printf("0x%02x %-50s%d\n",
ansi_a_ios401_dtap_strings[i].value,
ansi_a_ios401_dtap_strings[i].strptr,
stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value]);
}
i++;
if (stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value] > 0)
{
printf("0x%02x %-50s%d\n",
ansi_a_ios401_dtap_strings[i].value,
ansi_a_ios401_dtap_strings[i].strptr,
stat_p->dtap_message_type[ansi_a_ios401_dtap_strings[i].value]);
}
i++;
}
printf("==============================================================\n");
......@@ -128,27 +128,27 @@ ansi_a_stat_draw(
static void
ansi_a_stat_init(const char *opt_arg _U_, void* userdata _U_)
ansi_a_stat_init(const char *opt_arg _U_, void *userdata _U_)
{
ansi_a_stat_t *stat_p;
GString *err_p;
ansi_a_stat_t *stat_p;
GString *err_p;
stat_p = (ansi_a_stat_t *)g_malloc(sizeof(ansi_a_stat_t));
memset(stat_p, 0, sizeof(ansi_a_stat_t));
err_p =
register_tap_listener("ansi_a", stat_p, NULL, 0,
NULL,
ansi_a_stat_packet,
ansi_a_stat_draw);
register_tap_listener("ansi_a", stat_p, NULL, 0,
NULL,
ansi_a_stat_packet,
ansi_a_stat_draw);
if (err_p != NULL)
{
g_free(stat_p);
g_string_free(err_p, TRUE);
g_free(stat_p);
g_string_free(err_p, TRUE);
exit(1);
exit(1);
}
}
......@@ -156,5 +156,18 @@ ansi_a_stat_init(const char *opt_arg _U_, void* userdata _U_)
void
register_tap_listener_ansi_astat(void)
{
register_stat_cmd_arg("ansi_a,", ansi_a_stat_init,NULL);
register_stat_cmd_arg("ansi_a,", ansi_a_stat_init, NULL);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
......@@ -32,7 +32,7 @@
void register_tap_listener_gtkdhcpstat(void);
typedef const char* bootp_info_value_t;
typedef const char *bootp_info_value_t;
/* used to keep track of the statictics for an entire program interface */
typedef struct _dhcp_stats_t {
......@@ -69,30 +69,30 @@ dhcp_reset_hash(gchar *key _U_ , dhcp_message_type_t *data, gpointer ptr _U_ )
static void
dhcp_draw_message_type(gchar *key _U_, dhcp_message_type_t *data, gchar * format )
{
if ((data==NULL) || (data->packets==0))
if ((data == NULL) || (data->packets == 0))
return;
printf( format, data->name, data->packets);
}
static void
dhcpstat_reset(void *psp)
{
dhcpstat_t *sp=(dhcpstat_t *)psp;
dhcpstat_t *sp = (dhcpstat_t *)psp;
g_hash_table_foreach( sp->hash, (GHFunc)dhcp_reset_hash, NULL);
}
static int
dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, const void *pri)
{
dhcpstat_t *sp=(dhcpstat_t *)psp;
const bootp_info_value_t value=(const bootp_info_value_t)pri;
dhcpstat_t *sp = (dhcpstat_t *)psp;
const bootp_info_value_t value = (const bootp_info_value_t)pri;
dhcp_message_type_t *sc;
if (sp==NULL)
if (sp == NULL)
return 0;
sc = (dhcp_message_type_t *)g_hash_table_lookup(
sp->hash,
value);
if (!sc) {
sc = g_new(dhcp_message_type_t,1);
sc = g_new(dhcp_message_type_t, 1);
sc -> packets = 1;
sc -> name = value;
sc -> sp = sp;
......@@ -111,12 +111,12 @@ dhcpstat_packet(void *psp, packet_info *pinfo _U_, epan_dissect_t *edt _U_, cons
static void
dhcpstat_draw(void *psp)
{
dhcpstat_t *sp=(dhcpstat_t *)psp;
dhcpstat_t *sp = (dhcpstat_t *)psp;
printf("\n");
printf("===================================================================\n");
if (sp->filter==NULL)
if (sp->filter == NULL)
printf("BOOTP Statistics\n");
else
printf("BOOTP Statistics with filter %s\n", sp->filter);
......@@ -134,24 +134,24 @@ dhcpstat_draw(void *psp)
/* When called, this function will create a new instance of tap-boopstat.
*/
static void
dhcpstat_init(const char *opt_arg, void* userdata _U_)
dhcpstat_init(const char *opt_arg, void *userdata _U_)
{
dhcpstat_t *sp;
const char *filter=NULL;
const char *filter = NULL;
GString *error_string;
if (!strncmp (opt_arg, "bootp,stat,", 11)){
filter=opt_arg+11;
if (!strncmp (opt_arg, "bootp,stat,", 11)) {
filter = opt_arg+11;
} else {
filter=NULL;
filter = NULL;
}
sp = g_new(dhcpstat_t,1);
sp = g_new(dhcpstat_t, 1);
sp->hash = g_hash_table_new( g_str_hash, g_str_equal);
if(filter){
sp->filter=g_strdup(filter);
if (filter) {
sp->filter = g_strdup(filter);
} else {
sp->filter=NULL;
sp->filter = NULL;
}
sp->index = 0; /* Nothing to display yet */
......@@ -163,7 +163,7 @@ dhcpstat_init(const char *opt_arg, void* userdata _U_)
dhcpstat_reset,
dhcpstat_packet,
dhcpstat_draw);
if (error_string){
if (error_string) {
/* error, we failed to attach to the tap. clean up */
g_free(sp->filter);
g_free(sp);
......@@ -179,6 +179,18 @@ dhcpstat_init(const char *opt_arg, void* userdata _U_)
void
register_tap_listener_gtkdhcpstat(void)
{
register_stat_cmd_arg("bootp,stat,", dhcpstat_init,NULL);
register_stat_cmd_arg("bootp,stat,", dhcpstat_init, NULL);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
......@@ -49,16 +49,16 @@ struct camelcounter_t {
static void camelcounter_reset(void *phs)
{
struct camelcounter_t * p_counter= ( struct camelcounter_t *) phs;
memset(p_counter,0,sizeof(struct camelcounter_t));
memset(p_counter, 0, sizeof(struct camelcounter_t));
}
static int camelcounter_packet(void *phs,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi)
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi)
{
struct camelcounter_t * p_counter =(struct camelcounter_t *)phs;
const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)phi;
const struct camelsrt_info_t * pi = (const struct camelsrt_info_t *)phi;
if (pi->opcode != 255)
p_counter->camel_msg[pi->opcode]++;
......@@ -74,45 +74,45 @@ static void camelcounter_draw(void *phs)
printf("CAMEL Message and Response Status Counter:\n");
printf("------------------------------------------\n");
for(i=0;i<camel_MAX_NUM_OPR_CODES;i++) {
for (i=0; i<camel_MAX_NUM_OPR_CODES; i++) {
/* Message counter */
if(p_counter->camel_msg[i]!=0) {
printf("%30s ", val_to_str(i,camel_opr_code_strings,"Unknown message "));
if (p_counter->camel_msg[i] != 0) {
printf("%30s ", val_to_str(i, camel_opr_code_strings, "Unknown message "));
printf("%6d\n", p_counter->camel_msg[i]);
}
} /* Message Type */
printf("------------------------------------------\n");
}
static void camelcounter_init(const char *opt_arg, void* userdata _U_)
static void camelcounter_init(const char *opt_arg, void *userdata _U_)
{
struct camelcounter_t *p_camelcounter;
GString *error_string;
p_camelcounter = g_new(struct camelcounter_t,1);
if(!strncmp(opt_arg,"camel,counter,",13)){
p_camelcounter->filter=g_strdup(opt_arg+13);
p_camelcounter = g_new(struct camelcounter_t, 1);
if (!strncmp(opt_arg, "camel,counter,", 13)) {
p_camelcounter->filter = g_strdup(opt_arg+13);
} else {
p_camelcounter->filter=NULL;
p_camelcounter->filter = NULL;
}
camelcounter_reset(p_camelcounter);
error_string=register_tap_listener("CAMEL",
p_camelcounter,
p_camelcounter->filter,
0,
NULL,
camelcounter_packet,
camelcounter_draw);
error_string = register_tap_listener("CAMEL",
p_camelcounter,
p_camelcounter->filter,
0,
NULL,
camelcounter_packet,
camelcounter_draw);
if(error_string){
if (error_string) {
/* error, we failed to attach to the tap. clean up */
g_free(p_camelcounter->filter);
g_free(p_camelcounter);
fprintf(stderr, "tshark: Couldn't register camel,counter tap: %s\n",
error_string->str);
error_string->str);
g_string_free(error_string, TRUE);
exit(1);
}
......@@ -124,3 +124,16 @@ register_tap_listener_camelcounter(void)
{
register_stat_cmd_arg("camel,counter", camelcounter_init, NULL);
}
/*
* Editor modelines - http://www.wireshark.org/tools/modelines.html
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
......@@ -57,33 +57,33 @@ struct camelsrt_t {
/* Reset the counter */
static void camelsrt_reset(void *phs)
{
struct camelsrt_t *hs=(struct camelsrt_t *)phs;
memset(hs,0,sizeof(struct camelsrt_t));
struct camelsrt_t *hs = (struct camelsrt_t *)phs;
memset(hs, 0, sizeof(struct camelsrt_t));
}
static int camelsrt_packet(void *phs,
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi)
packet_info *pinfo _U_,
epan_dissect_t *edt _U_,
const void *phi)
{
struct camelsrt_t *hs=(struct camelsrt_t *)phs;
const struct camelsrt_info_t * pi=(const struct camelsrt_info_t *)phi;
struct camelsrt_t *hs = (struct camelsrt_t *)phs;
const struct camelsrt_info_t * pi = (const struct camelsrt_info_t *)phi;
int i;
for (i=0; i<NB_CAMELSRT_CATEGORY; i++) {
if (pi->bool_msginfo[i] &&
pi->msginfo[i].is_delta_time
&& pi->msginfo[i].request_available
&& !pi->msginfo[i].is_duplicate ) {
pi->msginfo[i].is_delta_time
&& pi->msginfo[i].request_available
&& !pi->msginfo[i].is_duplicate ) {
time_stat_update(&(hs->stats[i]),
&(pi->msginfo[i].delta_time),
pinfo);
&(pi->msginfo[i].delta_time),
pinfo);
if (hs->count[i] < NUM_RAS_STATS) {
hs->delta_time[i][hs->count[i]++]
= pi->msginfo[i].delta_time;
hs->delta_time[i][hs->count[i]++]
= pi->msginfo[i].delta_time;
}
}
}
......@@ -93,13 +93,13 @@ static int camelsrt_packet(void *phs,
static void camelsrt_draw(void *phs)
{
struct camelsrt_t *hs=(struct camelsrt_t *)phs;
guint j,z;
struct camelsrt_t *hs = (struct camelsrt_t *)phs;
guint j, z;
guint32 li;
int somme,iteration=0;
int somme, iteration = 0;
timestat_t *rtd_temp;
double x,delay,delay_max,delay_min,delta;
double criteria[NB_CRITERIA]={ 5.0, 10.0, 75.0, 90.0, 95.0,99.0,99.90 };
double x, delay, delay_max, delay_min, delta;
double criteria[NB_CRITERIA] = { 5.0, 10.0, 75.0, 90.0, 95.0, 99.0, 99.90 };
double delay_criteria[NB_CRITERIA];
printf("\n");
......@@ -108,33 +108,33 @@ static void camelsrt_draw(void *phs)
printf("| Category | Measure | Min SRT | Max SRT | Avg SRT | Min frame | Max frame |\n");
printf("|-------------------------|---------|-----------|-----------|-----------|-----------|-----------|\n");
j=1;
j = 1;
printf("|%24s |%8u |%8.2f s |%8.2f s |%8.2f s |%10u |%10u |\n",
val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"),
hs->stats[j].num,
nstime_to_sec(&(hs->stats[j].min)),
nstime_to_sec(&(hs->stats[j].max)),
get_average(&(hs->stats[j].tot),hs->stats[j].num)/1000.0,
hs->stats[j].min_num,
hs->stats[j].max_num
);
for(j=2; j<NB_CAMELSRT_CATEGORY; j++) {
if(hs->stats[j].num==0){
val_to_str(j, camelSRTtype_naming, "Unknown Message 0x%02x"),
hs->stats[j].num,
nstime_to_sec(&(hs->stats[j].min)),
nstime_to_sec(&(hs->stats[j].max)),
get_average(&(hs->stats[j].tot), hs->stats[j].num)/1000.0,
hs->stats[j].min_num,
hs->stats[j].max_num
);
for (j=2; j<NB_CAMELSRT_CATEGORY; j++) {
if (hs->stats[j].num == 0) {
printf("|%24s |%8u |%8.2f ms|%8.2f ms|%8.2f ms|%10u |%10u |\n",
val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"),
0, 0.0, 0.0, 0.0, 0, 0);
val_to_str(j, camelSRTtype_naming, "Unknown Message 0x%02x"),
0, 0.0, 0.0, 0.0, 0, 0);
continue;
}
printf("|%24s |%8u |%8.2f ms|%8.2f ms|%8.2f ms|%10u |%10u |\n",
val_to_str(j,camelSRTtype_naming,"Unknown Message 0x%02x"),
hs->stats[j].num,
MIN(9999,nstime_to_msec(&(hs->stats[j].min))),
MIN(9999,nstime_to_msec(&(hs->stats[j].max))),
MIN(9999,get_average(&(hs->stats[j].tot),hs->stats[j].num)),
hs->stats[j].min_num,
hs->stats[j].max_num
);
val_to_str(j, camelSRTtype_naming, "Unknown Message 0x%02x"),
hs->stats[j].num,
MIN(9999, nstime_to_msec(&(hs->stats[j].min))),
MIN(9999, nstime_to_msec(&(hs->stats[j].max))),
MIN(9999, get_average(&(hs->stats[j].tot), hs->stats[j].num)),
hs->stats[j].min_num,
hs->stats[j].max_num
);
} /* j category */
printf("=================================================================================================\n");
......@@ -143,89 +143,89 @@ static void camelsrt_draw(void *phs)
*/
printf("| Category/Criteria |");
for(z=0; z<NB_CRITERIA; z++) printf("%7.2f%% |", criteria[z]);
for (z=0; z<NB_CRITERIA; z++) printf("%7.2f%% |", criteria[z]);
printf("\n");
printf("|-------------------------|");
for(z=0; z<NB_CRITERIA; z++) printf("---------|");
for (z=0; z<NB_CRITERIA; z++) printf("---------|");
printf("\n");