… | |
… | |
22 | * summary that appears at the end of this file was taken from there. |
22 | * summary that appears at the end of this file was taken from there. |
23 | *----------------------------------------------------------------------*/ |
23 | *----------------------------------------------------------------------*/ |
24 | |
24 | |
25 | #include "../config.h" /* NECESSARY */ |
25 | #include "../config.h" /* NECESSARY */ |
26 | |
26 | |
27 | #include <stdlib.h> |
27 | #include <cstdlib> |
28 | |
28 | |
29 | #include "rxvt.h" /* NECESSARY */ |
29 | #include "rxvt.h" /* NECESSARY */ |
30 | #ifdef MENUBAR |
30 | #ifdef MENUBAR |
31 | #include "version.h" |
31 | #include "version.h" |
32 | #include "menubar.h" |
32 | #include "menubar.h" |
… | |
… | |
1407 | if (bar == NULL || fp == NULL) |
1407 | if (bar == NULL || fp == NULL) |
1408 | return; |
1408 | return; |
1409 | time (&t); |
1409 | time (&t); |
1410 | |
1410 | |
1411 | fprintf (fp, |
1411 | fprintf (fp, |
1412 | "# " APL_SUBCLASS " (%s) Pid: %u\n# Date: %s\n\n", |
1412 | "# " RESCLASS " (%s) Pid: %u\n# Date: %s\n\n", |
1413 | rs[Rs_name], (unsigned int)getpid (), ctime (&t)); |
1413 | rs[Rs_name], (unsigned int)getpid (), ctime (&t)); |
1414 | |
1414 | |
1415 | /* dump in reverse order */ |
1415 | /* dump in reverse order */ |
1416 | bar = CurrentBar->prev; |
1416 | bar = CurrentBar->prev; |
1417 | do |
1417 | do |
… | |
… | |
1706 | } |
1706 | } |
1707 | } |
1707 | } |
1708 | else if ((n = rxvt_Str_match (str, "pixmap:")) != 0) |
1708 | else if ((n = rxvt_Str_match (str, "pixmap:")) != 0) |
1709 | { |
1709 | { |
1710 | str += n; |
1710 | str += n; |
1711 | xterm_seq (XTerm_Pixmap, str, CHAR_ST); |
1711 | process_xterm_seq (XTerm_Pixmap, str, CHAR_ST); |
1712 | } |
1712 | } |
1713 | #if (MENUBAR_MAX > 1) |
1713 | #if (MENUBAR_MAX > 1) |
1714 | else if ((n = rxvt_Str_match (str, "rm")) != 0) |
1714 | else if ((n = rxvt_Str_match (str, "rm")) != 0) |
1715 | { |
1715 | { |
1716 | str += n; |
1716 | str += n; |
… | |
… | |
1754 | FILE *fp; |
1754 | FILE *fp; |
1755 | |
1755 | |
1756 | /* enough space to hold the results */ |
1756 | /* enough space to hold the results */ |
1757 | char buffer[32]; |
1757 | char buffer[32]; |
1758 | |
1758 | |
1759 | sprintf (buffer, "/tmp/" APL_SUBCLASS "-%u", |
1759 | sprintf (buffer, "/tmp/" RESCLASS "-%u", |
1760 | (unsigned int)getpid ()); |
1760 | (unsigned int)getpid ()); |
1761 | |
1761 | |
1762 | if ((fp = fopen (buffer, "wb")) != NULL) |
1762 | if ((fp = fopen (buffer, "wb")) != NULL) |
1763 | { |
1763 | { |
1764 | xterm_seq (XTerm_title, buffer, CHAR_ST); |
1764 | process_xterm_seq (XTerm_title, buffer, CHAR_ST); |
1765 | menubar_dump (fp); |
1765 | menubar_dump (fp); |
1766 | fclose (fp); |
1766 | fclose (fp); |
1767 | } |
1767 | } |
1768 | } |
1768 | } |
1769 | else if (!STRCMP (str, "next")) |
1769 | else if (!STRCMP (str, "next")) |
… | |
… | |
1846 | if (name != NULL || str != NULL) |
1846 | if (name != NULL || str != NULL) |
1847 | { |
1847 | { |
1848 | if (name == NULL || str == NULL || str <= (name + 1) |
1848 | if (name == NULL || str == NULL || str <= (name + 1) |
1849 | || (name > path && name[-1] != '/')) |
1849 | || (name > path && name[-1] != '/')) |
1850 | { |
1850 | { |
1851 | rxvt_print_error ("menu error <%s>\n", path); |
1851 | rxvt_warn ("menu error A<%s>, continuing.\n", path); |
1852 | break; |
1852 | break; |
1853 | } |
1853 | } |
1854 | if (str[1] == MENUITEM_BEG) |
1854 | if (str[1] == MENUITEM_BEG) |
1855 | { |
1855 | { |
1856 | name2 = (str + 2); |
1856 | name2 = (str + 2); |
1857 | str = STRCHR (name2, MENUITEM_END); |
1857 | str = STRCHR (name2, MENUITEM_END); |
1858 | |
1858 | |
1859 | if (str == NULL) |
1859 | if (str == NULL) |
1860 | { |
1860 | { |
1861 | rxvt_print_error ("menu error <%s>\n", path); |
1861 | rxvt_warn ("menu error B<%s>, continuing.\n", path); |
1862 | break; |
1862 | break; |
1863 | } |
1863 | } |
1864 | name2[-2] = '\0'; /* remove prev MENUITEM_END */ |
1864 | name2[-2] = '\0'; /* remove prev MENUITEM_END */ |
1865 | } |
1865 | } |
1866 | if (name > path && name[-1] == '/') |
1866 | if (name > path && name[-1] == '/') |