Skip to content

Commit 0a4b661

Browse files
committed
A few small changes to make the PuTTY source base more usable as a
basis for other terminal-involving applications: a stub implementation of the printing interface, an additional function in notiming.c, and also I've renamed the front-end function beep() to do_beep() so as not to clash with beep() in lib[n]curses. [originally from svn r6479]
1 parent 5d5abbf commit 0a4b661

File tree

8 files changed

+54
-10
lines changed

8 files changed

+54
-10
lines changed

mac/macterm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1488,7 +1488,7 @@ void sys_cursor(void *frontend, int x, int y)
14881488
* may want to perform additional actions on any kind of bell (for
14891489
* example, taskbar flashing in Windows).
14901490
*/
1491-
void beep(void *frontend, int mode)
1491+
void do_beep(void *frontend, int mode)
14921492
{
14931493
if (mode != BELL_VISUAL)
14941494
SysBeep(30);

macosx/osxwin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,7 @@ void update_specials_menu(void *frontend)
939939
* may want to perform additional actions on any kind of bell (for
940940
* example, taskbar flashing in Windows).
941941
*/
942-
void beep(void *frontend, int mode)
942+
void do_beep(void *frontend, int mode)
943943
{
944944
//SessionWindow *win = (SessionWindow *)frontend;
945945
if (mode != BELL_VISUAL)

noprint.c

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/*
2+
* Stub implementation of the printing interface for PuTTY, for the
3+
* benefit of non-printing terminal applications.
4+
*/
5+
6+
#include <assert.h>
7+
#include <stdio.h>
8+
#include "putty.h"
9+
10+
struct printer_job_tag {
11+
int dummy;
12+
};
13+
14+
printer_job *printer_start_job(char *printer)
15+
{
16+
return NULL;
17+
}
18+
19+
void printer_job_data(printer_job *pj, void *data, int len)
20+
{
21+
}
22+
23+
void printer_finish_job(printer_job *pj)
24+
{
25+
}
26+
27+
printer_enum *printer_start_enum(int *nprinters_ptr)
28+
{
29+
*nprinters_ptr = 0;
30+
return NULL;
31+
}
32+
char *printer_get_name(printer_enum *pe, int i)
33+
{
34+
return NULL;
35+
}
36+
void printer_finish_enum(printer_enum *pe)
37+
{
38+
}

notiming.c

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
/*
2-
* notiming.c: stub version of schedule_timer().
2+
* notiming.c: stub version of timing API.
33
*
4-
* Used in key generation tools, which need the random number
5-
* generator but don't want the hassle of calling noise_regular()
6-
* at regular intervals - and don't _need_ it either, since they
4+
* Used in any tool which needs a subsystem linked against the
5+
* timing API but doesn't want to actually provide timing. For
6+
* example, key generation tools need the random number generator,
7+
* but they don't want the hassle of calling noise_regular() at
8+
* regular intervals - and they don't _need_ it either, since they
79
* have their own rigorous and different means of noise collection.
810
*/
911

@@ -13,3 +15,7 @@ long schedule_timer(int ticks, timer_fn_t fn, void *ctx)
1315
{
1416
return 0;
1517
}
18+
19+
void expire_timer_context(void *ctx)
20+
{
21+
}

putty.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ void modalfatalbox(char *, ...);
686686
#pragma noreturn(fatalbox)
687687
#pragma noreturn(modalfatalbox)
688688
#endif
689-
void beep(void *frontend, int);
689+
void do_beep(void *frontend, int);
690690
void begin_session(void *frontend);
691691
void sys_cursor(void *frontend, int x, int y);
692692
void request_paste(void *frontend);

terminal.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2748,7 +2748,7 @@ static void term_out(Terminal *term)
27482748
* Perform an actual beep if we're not overloaded.
27492749
*/
27502750
if (!term->cfg.bellovl || !term->beep_overloaded) {
2751-
beep(term->frontend, term->cfg.beep);
2751+
do_beep(term->frontend, term->cfg.beep);
27522752

27532753
if (term->cfg.beep == BELL_VISUAL) {
27542754
term_schedule_vbell(term, FALSE, 0);

unix/gtkwin.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1848,7 +1848,7 @@ void sys_cursor(void *frontend, int x, int y)
18481848
* may want to perform additional actions on any kind of bell (for
18491849
* example, taskbar flashing in Windows).
18501850
*/
1851-
void beep(void *frontend, int mode)
1851+
void do_beep(void *frontend, int mode)
18521852
{
18531853
if (mode != BELL_VISUAL)
18541854
gdk_beep();

windows/window.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4777,7 +4777,7 @@ static void flash_window(int mode)
47774777
/*
47784778
* Beep.
47794779
*/
4780-
void beep(void *frontend, int mode)
4780+
void do_beep(void *frontend, int mode)
47814781
{
47824782
if (mode == BELL_DEFAULT) {
47834783
/*

0 commit comments

Comments
 (0)