Changeset 57609b3
- Timestamp:
- Feb 11, 2009, 12:20:21 PM (16 years ago)
- Branches:
- master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
- Children:
- c1d166b
- Parents:
- 28fa23c
- git-author:
- Nelson Elhage <nelhage@mit.edu> (02/10/09 18:30:04)
- git-committer:
- Nelson Elhage <nelhage@mit.edu> (02/11/09 12:20:21)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r2101a50 r57609b3 1433 1433 owl_message *m; 1434 1434 owl_fmtext fm, attrfm; 1435 char buff[10000];1436 1435 owl_view *v; 1437 1436 #ifdef HAVE_LIBZEPHYR … … 1449 1448 1450 1449 owl_fmtext_append_bold(&fm, "General Information:\n"); 1451 owl_fmtext_append_normal(&fm, " Msg Id : "); 1452 sprintf(buff, "%i", owl_message_get_id(m)); 1453 owl_fmtext_append_normal(&fm, buff); 1454 owl_fmtext_append_normal(&fm, "\n"); 1450 owl_fmtext_appendf_normal(&fm, " Msg Id : %i\n", owl_message_get_id(m)); 1455 1451 1456 1452 owl_fmtext_append_normal(&fm, " Type : "); … … 1468 1464 } 1469 1465 1470 owl_fmtext_append_normal(&fm, " Time : "); 1471 owl_fmtext_append_normal(&fm, owl_message_get_timestr(m)); 1472 owl_fmtext_append_normal(&fm, "\n"); 1466 owl_fmtext_appendf_normal(&fm, " Time : %s\n", owl_message_get_timestr(m)); 1473 1467 1474 1468 if (!owl_message_is_type_admin(m)) { 1475 owl_fmtext_append_normal(&fm, " Sender : "); 1476 owl_fmtext_append_normal(&fm, owl_message_get_sender(m)); 1477 owl_fmtext_append_normal(&fm, "\n"); 1478 1479 owl_fmtext_append_normal(&fm, " Recipient : "); 1480 owl_fmtext_append_normal(&fm, owl_message_get_recipient(m)); 1481 owl_fmtext_append_normal(&fm, "\n"); 1482 } 1483 1469 owl_fmtext_appendf_normal(&fm, " Sender : %s\n", owl_message_get_sender(m)); 1470 owl_fmtext_appendf_normal(&fm, " Recipient : %s\n", owl_message_get_recipient(m)); 1471 } 1472 1484 1473 if (owl_message_is_type_zephyr(m)) { 1485 1474 owl_fmtext_append_bold(&fm, "\nZephyr Specific Information:\n"); 1486 1475 1487 owl_fmtext_append_normal(&fm, " Class : "); 1488 owl_fmtext_append_normal(&fm, owl_message_get_class(m)); 1489 owl_fmtext_append_normal(&fm, "\n"); 1490 owl_fmtext_append_normal(&fm, " Instance : "); 1491 owl_fmtext_append_normal(&fm, owl_message_get_instance(m)); 1492 owl_fmtext_append_normal(&fm, "\n"); 1493 owl_fmtext_append_normal(&fm, " Opcode : "); 1494 owl_fmtext_append_normal(&fm, owl_message_get_opcode(m)); 1495 owl_fmtext_append_normal(&fm, "\n"); 1496 1497 owl_fmtext_append_normal(&fm, " Time : "); 1498 owl_fmtext_append_normal(&fm, owl_message_get_timestr(m)); 1499 owl_fmtext_append_normal(&fm, "\n"); 1476 owl_fmtext_appendf_normal(&fm, " Class : %s\n", owl_message_get_class(m)); 1477 owl_fmtext_appendf_normal(&fm, " Instance : %s\n", owl_message_get_instance(m)); 1478 owl_fmtext_appendf_normal(&fm, " Opcode : %s\n", owl_message_get_opcode(m)); 1500 1479 #ifdef HAVE_LIBZEPHYR 1501 1480 if (owl_message_is_direction_in(m)) { … … 1529 1508 } 1530 1509 } 1531 owl_fmtext_append_normal(&fm, " Host : "); 1532 owl_fmtext_append_normal(&fm, owl_message_get_hostname(m)); 1510 owl_fmtext_appendf_normal(&fm, " Host : %s\n", owl_message_get_hostname(m)); 1533 1511 1534 1512 if (!owl_message_is_pseudo(m)) { 1535 1513 owl_fmtext_append_normal(&fm, "\n"); 1536 sprintf(buff, " Port : %i\n", ntohs(n->z_port)); 1537 owl_fmtext_append_normal(&fm, buff); 1538 1539 owl_fmtext_append_normal(&fm, " Auth : "); 1540 owl_fmtext_append_normal(&fm, owl_zephyr_get_authstr(n)); 1541 owl_fmtext_append_normal(&fm, "\n"); 1542 1543 /* fix this */ 1544 sprintf(buff, " Checkd Ath: %i\n", n->z_checked_auth); 1545 sprintf(buff + strlen(buff), " Multi notc: %s\n", n->z_multinotice); 1546 sprintf(buff + strlen(buff), " Num other : %i\n", n->z_num_other_fields); 1547 sprintf(buff + strlen(buff), " Msg Len : %i\n", n->z_message_len); 1548 owl_fmtext_append_normal(&fm, buff); 1549 1550 sprintf(buff, " Fields : %i\n", owl_zephyr_get_num_fields(n)); 1551 owl_fmtext_append_normal(&fm, buff); 1552 1514 owl_fmtext_appendf_normal(&fm, " Port : %i\n", ntohs(n->z_port)); 1515 owl_fmtext_appendf_normal(&fm, " Auth : %s\n", owl_zephyr_get_authstr(n)); 1516 1517 /* FIXME make these more descriptive */ 1518 owl_fmtext_appendf_normal(&fm, " Checkd Ath: %i\n", n->z_checked_auth); 1519 owl_fmtext_appendf_normal(&fm, " Multi notc: %s\n", n->z_multinotice); 1520 owl_fmtext_appendf_normal(&fm, " Num other : %i\n", n->z_num_other_fields); 1521 owl_fmtext_appendf_normal(&fm, " Msg Len : %i\n", n->z_message_len); 1522 1553 1523 fields=owl_zephyr_get_num_fields(n); 1524 owl_fmtext_appendf_normal(&fm, " Fields : %i\n", fields); 1525 1554 1526 for (i=0; i<fields; i++) { 1555 sprintf(buff, " Field %i : ", i+1);1556 1557 1527 ptr=owl_zephyr_get_field_as_utf8(n, i+1); 1558 1528 len=strlen(ptr); … … 1566 1536 } 1567 1537 owl_free(ptr); 1568 1538 1569 1539 for (j=0; j<strlen(tmpbuff); j++) { 1570 1540 if (tmpbuff[j]=='\n') tmpbuff[j]='~'; 1571 1541 if (tmpbuff[j]=='\r') tmpbuff[j]='!'; 1572 1542 } 1573 1574 strcat(buff, tmpbuff); 1575 strcat(buff, "\n"); 1576 owl_fmtext_append_normal(&fm, buff); 1543 1544 owl_fmtext_appendf_normal(&fm, " Field %i : %s\n", i+1, tmpbuff); 1577 1545 } 1578 owl_fmtext_append_normal(&fm, " Default Fm:"); 1579 owl_fmtext_append_normal(&fm, n->z_default_format); 1546 owl_fmtext_appendf_normal(&fm, " Default Fm: %s\n", n->z_default_format); 1580 1547 } 1581 1582 } 1583 #endif 1548 1549 } 1550 #endif 1584 1551 } 1585 1552
Note: See TracChangeset
for help on using the changeset viewer.