[vte] pty: Remove deprecated _vte_pty_* functions



commit 19e2cbbe396ad4acdd3db65454fa39aa1bd9b6f5
Author: Christian Persch <chpe gnome org>
Date:   Mon May 2 20:35:57 2011 +0200

    pty: Remove deprecated _vte_pty_* functions
    
    Conflicts:
        src/pty.h

 src/Makefile.am |    5 +-
 src/pty.c       |  213 -------------------------------------------------------
 src/pty.h       |   52 -------------
 3 files changed, 2 insertions(+), 268 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 038c65a..ad9f1ef 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -5,7 +5,7 @@ EXTRA_DIST = iso2022.txt
 # The library
 
 headerdir = $(includedir)/vte-$(VTE_API_VERSION)/vte
-header_HEADERS = pty.h reaper.h vte.h vteaccess.h vtepty.h vtetypebuiltins.h vteversion.h vtedeprecated.h
+header_HEADERS = reaper.h vte.h vteaccess.h vtepty.h vtetypebuiltins.h vteversion.h vtedeprecated.h
 
 lib_LTLIBRARIES = libvte- VTE_API_MAJOR_VERSION@  VTE_API_MINOR_VERSION@.la
 
@@ -44,7 +44,6 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_SOURCES = \
        matcher.c \
        matcher.h \
        pty.c \
-       pty.h \
        reaper.c \
        reaper.h \
        ring.c \
@@ -106,7 +105,7 @@ libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LIBADD = $(VTE_LIBS)
 libvte_ VTE_API_MAJOR_VERSION@_ VTE_API_MINOR_VERSION@_la_LDFLAGS = \
        $(VTE_LDFLAGS) \
        -version-info $(LT_VERSION_INFO) \
-       -export-symbols-regex 
"^vte_terminal_.*|^vte_pty_.*|^vte_get_.*|^_vte_pty_.*|^vte_reaper_.*|_vte_debug_.*" \
+       -export-symbols-regex "^vte_terminal_.*|^vte_pty_.*|^vte_get_.*|^vte_reaper_.*|_vte_debug_.*" \
        @LIBTOOL_EXPORT_OPTIONS@ @LIBTOOL_FLAGS@ \
        $(AM_LDFLAGS)
 
diff --git a/src/pty.c b/src/pty.c
index 2233b7c..6da4f58 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -1926,216 +1926,3 @@ vte_pty_set_term (VtePty *pty,
         priv->term = emulation;
         g_object_notify(G_OBJECT(pty), "term");
 }
-
-/* Reimplementation of the ugly deprecated APIs _vte_pty_*() */
-
-#ifndef VTE_DISABLE_DEPRECATED_SOURCE
-
-static GHashTable *fd_to_pty_hash = NULL;
-
-static VtePty *
-get_vte_pty_for_fd (int fd)
-{
-        VtePty *pty;
-
-        if (fd_to_pty_hash != NULL &&
-            (pty = g_hash_table_lookup(fd_to_pty_hash, &fd)) != NULL)
-                return pty;
-
-        g_warning("No VtePty found for fd %d!\n", fd);
-        return NULL;
-}
-
-/**
- * _vte_pty_open:
- * @child: location to store the new process's ID
- * @env_add: a list of environment variables to add to the child's environment
- * @command: name of the binary to run
- * @argv: arguments to pass to @command
- * @directory: directory to start the new command in, or %NULL
- * @columns: desired window columns
- * @rows: desired window rows
- * @lastlog: %TRUE if the lastlog should be updated
- * @utmp: %TRUE if the utmp or utmpx log should be updated
- * @wtmp: %TRUE if the wtmp or wtmpx log should be updated
- *
- * Starts a new copy of @command running under a psuedo-terminal, optionally in
- * the supplied @directory, with window size set to @rows x @columns
- * and variables in @env_add added to its environment.  If any combination of
- * @lastlog, @utmp, and @wtmp is set, then the session is logged in the
- * corresponding system files.
- *
- * Returns: an open file descriptor for the pty master, -1 on failure
- *
- * Deprecated: 0.26: Use #VtePty together with fork() or the g_spawn_async() family of functions instead
- */
-int
-_vte_pty_open(pid_t *child,
-              char **env_add,
-              const char *command,
-              char **argv,
-              const char *directory,
-              int columns,
-              int rows,
-              gboolean lastlog,
-              gboolean utmp,
-              gboolean wtmp)
-{
-        VtePty *pty;
-        GPid pid;
-        gboolean ret;
-
-        pty = vte_pty_new(__vte_pty_get_pty_flags (lastlog, utmp, wtmp), NULL);
-        if (pty == NULL)
-                return -1;
-
-        if (command != NULL) {
-                char **real_argv;
-                GSpawnFlags spawn_flags;
-
-                spawn_flags = G_SPAWN_CHILD_INHERITS_STDIN |
-                              G_SPAWN_SEARCH_PATH;
-                real_argv = __vte_pty_get_argv(command, argv, &spawn_flags);
-                ret = __vte_pty_spawn(pty,
-                                      directory,
-                                      real_argv,
-                                      env_add,
-                                      spawn_flags,
-                                      NULL, NULL,
-                                      &pid,
-                                      NULL);
-                g_strfreev(real_argv);
-        } else {
-                ret = __vte_pty_fork(pty, &pid, NULL);
-        }
-
-        if (!ret) {
-                g_object_unref(pty);
-                return -1;
-        }
-
-        vte_pty_set_size(pty, rows, columns, NULL);
-
-        /* Stash the pty in the hash so we can later retrieve it by FD */
-        if (fd_to_pty_hash == NULL) {
-                fd_to_pty_hash = g_hash_table_new_full(g_int_hash,
-                                                       g_int_equal,
-                                                       NULL,
-                                                       (GDestroyNotify) g_object_unref);
-        }
-
-        g_hash_table_insert(fd_to_pty_hash, &pty->priv->pty_fd, pty /* adopt refcount */);
-
-        if (child)
-                *child = (pid_t) pid;
-
-        return vte_pty_get_fd(pty);
-}
-
-/**
- * _vte_pty_get_size:
- * @master: the file descriptor of the PTY master
- * @columns: a place to store the number of columns
- * @rows: a place to store the number of rows
- *
- * Attempts to read the pseudo terminal's window size.
- *
- * Returns: 0 on success, -1 on failure.
- *
- * Deprecated: 0.26: Use #VtePty and vte_pty_get_size() instead
- */
-int
-_vte_pty_get_size(int master,
-                  int *columns,
-                  int *rows)
-{
-        VtePty *pty;
-
-        if ((pty = get_vte_pty_for_fd(master)) == NULL)
-                return -1;
-
-        if (vte_pty_get_size(pty, rows, columns, NULL))
-                return 0;
-
-        return -1;
-}
-
-/**
- * _vte_pty_set_size:
- * @master: the file descriptor of the PTY master
- * @columns: the desired number of columns
- * @rows: the desired number of rows
- *
- * Attempts to resize the pseudo terminal's window size.  If successful, the
- * OS kernel will send #SIGWINCH to the child process group.
- *
- * Returns: 0 on success, -1 on failure.
- *
- * Deprecated: 0.26: Use #VtePty and vte_pty_set_size() instead
- */
-int
-_vte_pty_set_size(int master,
-                  int columns,
-                  int rows)
-{
-        VtePty *pty;
-
-        if ((pty = get_vte_pty_for_fd(master)) == NULL)
-                return -1;
-
-        if (vte_pty_set_size(pty, rows, columns, NULL))
-                return 0;
-
-        return -1;
-}
-
-/**
- * _vte_pty_set_utf8:
- * @pty: The pty master descriptor.
- * @utf8: Whether or not the pty is in UTF-8 mode.
- *
- * Tells the kernel whether the terminal is UTF-8 or not, in case it can make
- * use of the info.  Linux 2.6.5 or so defines IUTF8 to make the line
- * discipline do multibyte backspace correctly.
- *
- * Deprecated: 0.26: Use #VtePty and vte_pty_set_utf8() instead
- */
-void _vte_pty_set_utf8(int master,
-                       gboolean utf8)
-{
-        VtePty *pty;
-
-        if ((pty = get_vte_pty_for_fd(master)) == NULL)
-                return;
-
-        vte_pty_set_utf8(pty, utf8, NULL);
-}
-
-/**
- * _vte_pty_close:
- * @pty: the pty master descriptor.
- *
- * Cleans up the PTY associated with the descriptor, specifically any logging
- * performed for the session.  The descriptor itself remains open.
- *
- * Deprecated: 0.26: Use #VtePty and vte_pty_close() instead
- */
-void _vte_pty_close(int master)
-{
-        VtePty *pty;
-
-        if ((pty = get_vte_pty_for_fd(master)) == NULL)
-                return;
-
-        /* Prevent closing the FD */
-        pty->priv->pty_fd = -1;
-
-        g_hash_table_remove(fd_to_pty_hash, &master);
-
-        if (g_hash_table_size(fd_to_pty_hash) == 0) {
-                g_hash_table_destroy(fd_to_pty_hash);
-                fd_to_pty_hash = NULL;
-        }
-}
-
-#endif /* !VTE_DISABLE_DEPRECATED_SOURCE */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]