]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
A few small changes to make the PuTTY source base more usable as a
authorSimon Tatham <anakin@pobox.com>
Fri, 9 Dec 2005 20:04:19 +0000 (20:04 +0000)
committerSimon Tatham <anakin@pobox.com>
Fri, 9 Dec 2005 20:04:19 +0000 (20:04 +0000)
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]

mac/macterm.c
macosx/osxwin.m
noprint.c [new file with mode: 0644]
notiming.c
putty.h
terminal.c
unix/gtkwin.c
windows/window.c

index 68d827607c1617dd117370a2c0ae09fde9295ed8..8cbf6cfe4a6195fbbbdcc45c768e8fe7f89eed08 100644 (file)
@@ -1488,7 +1488,7 @@ void sys_cursor(void *frontend, int x, int y)
  * may want to perform additional actions on any kind of bell (for
  * example, taskbar flashing in Windows).
  */
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
 {
     if (mode != BELL_VISUAL)
        SysBeep(30);
index ba3a08ecb93c6756123c6c24dc9584a3b6538370..737b0f72b0cd46bc28ec5648b84cc6ca981a8db2 100644 (file)
@@ -939,7 +939,7 @@ void update_specials_menu(void *frontend)
  * may want to perform additional actions on any kind of bell (for
  * example, taskbar flashing in Windows).
  */
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
 {
     //SessionWindow *win = (SessionWindow *)frontend;
     if (mode != BELL_VISUAL)
diff --git a/noprint.c b/noprint.c
new file mode 100644 (file)
index 0000000..b3e9da5
--- /dev/null
+++ b/noprint.c
@@ -0,0 +1,38 @@
+/*
+ * Stub implementation of the printing interface for PuTTY, for the
+ * benefit of non-printing terminal applications.
+ */
+
+#include <assert.h>
+#include <stdio.h>
+#include "putty.h"
+
+struct printer_job_tag {
+    int dummy;
+};
+
+printer_job *printer_start_job(char *printer)
+{
+    return NULL;
+}
+
+void printer_job_data(printer_job *pj, void *data, int len)
+{
+}
+
+void printer_finish_job(printer_job *pj)
+{
+}
+
+printer_enum *printer_start_enum(int *nprinters_ptr)
+{
+    *nprinters_ptr = 0;
+    return NULL;
+}
+char *printer_get_name(printer_enum *pe, int i)
+{
+    return NULL;
+}
+void printer_finish_enum(printer_enum *pe)
+{
+}
index 2d0fc5d5a7cf3545c7776a2a3e2e4c5bc4dff531..384fa670a8f7d02df45cc958c9613dfd9f8b033c 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * notiming.c: stub version of schedule_timer().
+ * notiming.c: stub version of timing API.
  * 
- * Used in key generation tools, which need the random number
- * generator but don't want the hassle of calling noise_regular()
- * at regular intervals - and don't _need_ it either, since they
+ * Used in any tool which needs a subsystem linked against the
+ * timing API but doesn't want to actually provide timing. For
+ * example, key generation tools need the random number generator,
+ * but they don't want the hassle of calling noise_regular() at
+ * regular intervals - and they don't _need_ it either, since they
  * have their own rigorous and different means of noise collection.
  */
 
@@ -13,3 +15,7 @@ long schedule_timer(int ticks, timer_fn_t fn, void *ctx)
 {
     return 0;
 }
+
+void expire_timer_context(void *ctx)
+{
+}
diff --git a/putty.h b/putty.h
index 1a2d7ecd03f3ea1985200466a7d0dbffc466eb1e..4e879aa5e57e5770052ac3ae4fcadaf9a78fb181 100644 (file)
--- a/putty.h
+++ b/putty.h
@@ -686,7 +686,7 @@ void modalfatalbox(char *, ...);
 #pragma noreturn(fatalbox)
 #pragma noreturn(modalfatalbox)
 #endif
-void beep(void *frontend, int);
+void do_beep(void *frontend, int);
 void begin_session(void *frontend);
 void sys_cursor(void *frontend, int x, int y);
 void request_paste(void *frontend);
index 7552e39d808b4abf9495c4e2fcb06edab2d9e3fa..2f7527cd97089371be247a92e9fab0b427b7c3b9 100644 (file)
@@ -2748,7 +2748,7 @@ static void term_out(Terminal *term)
                     * Perform an actual beep if we're not overloaded.
                     */
                    if (!term->cfg.bellovl || !term->beep_overloaded) {
-                       beep(term->frontend, term->cfg.beep);
+                       do_beep(term->frontend, term->cfg.beep);
 
                        if (term->cfg.beep == BELL_VISUAL) {
                            term_schedule_vbell(term, FALSE, 0);
index 6193a04d479b1a400fc160a5167b619a9f4943c7..584ff1ec82210ed9e0f71af035deff4a2725a4ad 100644 (file)
@@ -1848,7 +1848,7 @@ void sys_cursor(void *frontend, int x, int y)
  * may want to perform additional actions on any kind of bell (for
  * example, taskbar flashing in Windows).
  */
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
 {
     if (mode != BELL_VISUAL)
        gdk_beep();
index 43a5e24c6b2f05e42afd8a763177f14cef15191b..0f04bee0a668972f4f2d5c8a9e913e55eedb09eb 100644 (file)
@@ -4777,7 +4777,7 @@ static void flash_window(int mode)
 /*
  * Beep.
  */
-void beep(void *frontend, int mode)
+void do_beep(void *frontend, int mode)
 {
     if (mode == BELL_DEFAULT) {
        /*