[svn:parrot] r39177 - in trunk: . ports/cygwin runtime/parrot/include runtime/parrot/library t/tools/install
bacek at svn.parrot.org
bacek at svn.parrot.org
Tue May 26 12:44:03 UTC 2009
Author: bacek
Date: Tue May 26 12:44:01 2009
New Revision: 39177
URL: https://trac.parrot.org/parrot/changeset/39177
Log:
[cage] Remove obsoleted files. Closes TT#705
- runtime/parrot/include/sockets.pasm
- runtime/parrot/library/tcpstream.pir
Deleted:
trunk/runtime/parrot/include/sockets.pasm
trunk/runtime/parrot/library/tcpstream.pir
Modified:
trunk/MANIFEST
trunk/ports/cygwin/README
trunk/t/tools/install/overall.t
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Tue May 26 06:55:03 2009 (r39176)
+++ trunk/MANIFEST Tue May 26 12:44:01 2009 (r39177)
@@ -1141,7 +1141,6 @@
runtime/parrot/include/README []doc
runtime/parrot/include/fp_equality.pasm [library]
runtime/parrot/include/hllmacros.pir [library]
-runtime/parrot/include/sockets.pasm [library]
runtime/parrot/include/test_more.pir [library]
runtime/parrot/library/CGI/QueryHash.pir [library]
runtime/parrot/library/Config/JSON.pir [library]
@@ -1223,7 +1222,6 @@
runtime/parrot/library/postgres.pasm [library]
runtime/parrot/library/postgres.pir [library]
runtime/parrot/library/random_lib.pir [library]
-runtime/parrot/library/tcpstream.pir [library]
runtime/parrot/library/uuid.pir [library]
runtime/parrot/library/yaml_dumper.pir [library]
src/atomic/gcc_x86.c []
@@ -2028,7 +2026,6 @@
t/tools/install/testlib/parrot.pc [test]
t/tools/install/testlib/phony [test]
t/tools/install/testlib/phony.exe [test]
-t/tools/install/testlib/runtime/parrot/include/sockets.pasm [test]
t/tools/install/testlib/runtime/parrot/library/TGE.pbc [test]
t/tools/install/testlib/src/ops/ops.num [test]
t/tools/install/testlib/src/pmc/pmc_object.h [test]
Modified: trunk/ports/cygwin/README
==============================================================================
--- trunk/ports/cygwin/README Tue May 26 06:55:03 2009 (r39176)
+++ trunk/ports/cygwin/README Tue May 26 12:44:01 2009 (r39177)
@@ -190,7 +190,6 @@
/usr/lib/parrot/1.0.0/library/postgres.pasm
/usr/lib/parrot/1.0.0/library/postgres.pir
/usr/lib/parrot/1.0.0/library/random_lib.pir
- /usr/lib/parrot/1.0.0/library/tcpstream.pir
/usr/lib/parrot/1.0.0/library/uuid.pir
/usr/lib/parrot/1.0.0/library/yaml_dumper.pir
/usr/share/doc/parrot-1.0.0/LICENSE
@@ -738,7 +737,6 @@
/usr/lib/parrot/1.0.0/include/parrotlib.pbc
/usr/lib/parrot/1.0.0/include/pmctypes.pasm
/usr/lib/parrot/1.0.0/include/signal.pasm
- /usr/lib/parrot/1.0.0/include/sockets.pasm
/usr/lib/parrot/1.0.0/include/stat.pasm
/usr/lib/parrot/1.0.0/include/stdio.pasm
/usr/lib/parrot/1.0.0/include/stringinfo.pasm
@@ -1330,7 +1328,6 @@
/usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/libpcre.pir.html
/usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/parrotlib.pir.html
/usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/pcre.pir.html
- /usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/tcpstream.pir.html
/usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/uuid.pir.html
/usr/share/doc/parrot/1.0.0/html/runtime/parrot/library/yaml_dumper.pir.html
/usr/share/doc/parrot/1.0.0/html/scheme.html
Deleted: trunk/runtime/parrot/include/sockets.pasm
==============================================================================
--- trunk/runtime/parrot/include/sockets.pasm Tue May 26 12:44:01 2009 (r39176)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,31 +0,0 @@
-# Copyright (C) 2006-2009, Parrot Foundation.
-# $Id$
-
-# families
-.macro_const AF_UNSPEC 0 # unspecified
-.macro_const AF_UNIX 1 # local to host (pipes)
-.macro_const AF_INET 2 # internetwork: UDP, TCP, etc.
-.macro_const AF_INET6 30 # IPv6
-
-
-# types
-.macro_const SOCK_STREAM 1 # stream socket
-.macro_const SOCK_DGRAM 2 # datagram socket
-.macro_const SOCK_RAW 3 # raw-protocol interface
-.macro_const SCOK_SEQPACKET 5 # sequenced packet stream
-
-
-# protocols (RFC 1700)
-.macro_const IPPROTO_IP 0 # dummy for IP
-.macro_const IPPROTO_ICMP 1 # control message protocol
-.macro_const IPPROTO_TCP 6 # tcp
-.macro_const IPPROTO_UDP 17 # user datagram protocol
-.macro_const IPPROTO_IPV6 41 # IP6 header
-.macro_const IPPROTO_RAW 255 # raw IP packet
-.macro_const IPPROTO_MAX 256
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Deleted: trunk/runtime/parrot/library/tcpstream.pir
==============================================================================
--- trunk/runtime/parrot/library/tcpstream.pir Tue May 26 12:44:01 2009 (r39176)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,278 +0,0 @@
-# Copyright (C) 2006-2009, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-TCPStream
-
-=head1 SYNOPSIS
-
- .sub main :main
- load_bytecode 'tcpstream.pir'
-
- .local pmc stream
- stream = new 'TCPStream'
- stream.'connect'("www.google.com", 80)
-
- stream.'say'("GET / HTTP/1.0")
- stream.'say'("User-agent: Parrot")
- stream.'say'("")
-
- $S0 = stream.'slurp'()
- print $S0
-
- stream.'close'()
- .end
-
-=head1 DESCRIPTION
-
-This is a high-level sockets library designed to mimic Tcl's socket builtins. As
-such, it uses C<print> and C<say> instead of C<send> and C<readline> and
-C<slurp> instead of C<recv>.
-
-=head1 VTABLE FUNCTIONS
-
-=over 4
-
-=cut
-
-.namespace ['TCPStream']
-
-.include 'sockets.pasm'
-
-.sub class_init :load :init :anon
- .local pmc class
- class = newclass "TCPStream"
-
- addattribute class, '$.buffer'
- addattribute class, '$.socket'
-.end
-
-=item C<init>
-
-Initialize a TCPStream object (create a socket and a buffer).
-
-=cut
-
-.sub init :anon :vtable :method
- .local pmc buffer
- buffer = new 'String'
- buffer = ''
-
- .local pmc sock
- sock = socket .AF_INET, .SOCK_STREAM, .IPPROTO_IP
-
- setattribute self, '$.buffer', buffer
- setattribute self, '$.socket', sock
-.end
-
-=item C<init_pmc>
-
-Initialize a TCPStream object from an already pre-existing socket. This can be
-use to create servers, among other things.
-
-=cut
-
-.sub init_pmc :anon :vtable :method
- .param pmc sock
-
- .local pmc buffer
- buffer = new 'String'
- buffer = ''
-
- setattribute self, '$.buffer', buffer
- setattribute self, '$.socket', sock
-.end
-
-=item C<get_bool>
-
-Returns whether or not this socket has data waiting to be read.
-
-=cut
-
-.sub get_bool :anon :vtable :method
- .local pmc buffer
- buffer = getattribute self, '$.buffer'
- if buffer != "" goto true
-
- .local pmc sock
- .local int bytes
- sock = getattribute self, '$.socket'
- bytes = recv sock, $S0
- if bytes == 0 goto false
- buffer .= $S0
- goto true
-
-false:
- .return(0)
-
-true:
- .return(1)
-.end
-
-=back
-
-=head1 METHODS
-
-=over 4
-
-=item C<void close()>
-
-Closes the socket.
-
-=cut
-
-.sub close :method
- .local pmc sock
- sock = getattribute self, '$.socket'
-
- close sock
-.end
-
-=item C<void connect(string host, int port)>
-
-Connects to a host/port.
-
-Throws an exception if unable to connect.
-
-=cut
-
-.sub connect :method
- .param string host
- .param int port
-
- .local string address
- .local pmc sock
- address = sockaddr port, host
- sock = getattribute self, '$.socket'
-
- .local int ret
- ret = connect sock, address
- if ret == -1 goto cant_connect
-
- .return()
-
-cant_connect:
- .local pmc excep
- excep = new 'Exception'
- excep[0] = "Can't connect socket"
- throw excep
-.end
-
-=item C<void flush()>
-
-=cut
-
-.sub flush :method
-.end
-
-=item C<string readline()>
-
-Reads and returns up to (and excluding) an end-of-line character and discards
-the end-of-line character.
-
-=cut
-
-.sub readline :method
- .local int idx
- .local pmc buffer
- .local string strbuf
- buffer = getattribute self, '$.buffer'
- strbuf = buffer
- idx = index strbuf, "\n"
- if idx != -1 goto have_newline
-
- .local int ret, len, bytes
- .local pmc sock
- sock = getattribute self, '$.socket'
- len = length strbuf
-loop:
- ret = poll sock, 1, 0, 3
- unless ret goto done
-
- bytes = recv sock, $S0
- unless bytes goto done
- strbuf .= $S0
- idx = index strbuf, "\n", len
- if idx != -1 goto have_newline
- $I0 = length $S0
- len += $I0
- if bytes goto loop
-
-done:
- buffer = ""
- .return(strbuf)
-
-have_newline:
- inc idx
- $S0 = substr strbuf, 0, idx, ""
- buffer = strbuf
- chopn $S0, 1
- .return($S0)
-.end
-
-=item C<void say(string msg)>
-
-Print C<msg> and an end-of-line character to the socket.
-
-=cut
-
-.sub say :method
- .param string msg
-
- .local pmc sock
- sock = getattribute self, '$.socket'
-
- .local int ret
- msg .= "\n"
- ret = send sock, msg
- if ret == -1 goto cant_send
-
- .return()
-
-cant_send:
- .local pmc excep
- excep = new 'Exception'
- excep[0] = "Can't send to socket"
- throw excep
-.end
-
-=item C<string slurp()>
-
-Return all the data in the socket.
-
-=cut
-
-.sub slurp :method
- .local pmc sock, buffer
- sock = getattribute self, '$.socket'
- buffer = getattribute self, '$.buffer'
-
- .local int ret, bytes
-loop:
- ret = poll sock, 1, 0, 3
- unless ret goto done
-
- bytes = recv sock, $S0
- buffer .= $S0
- if bytes goto loop
-
-done:
- $S0 = buffer
- buffer = ""
- .return($S0)
-.end
-
-=back
-
-=head1 AUTHOR
-
-Matt Diephouse <matt at diephouse.com>.
-
-=cut
-
-# Local Variables:
-# mode: pir
-# fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4 ft=pir:
Modified: trunk/t/tools/install/overall.t
==============================================================================
--- trunk/t/tools/install/overall.t Tue May 26 06:55:03 2009 (r39176)
+++ trunk/t/tools/install/overall.t Tue May 26 12:44:01 2009 (r39177)
@@ -68,11 +68,6 @@
end => File::Spec->catfile(
$includedir, $versiondir, 'parrot', 'charset.h' ),
},
- 'runtime/parrot/include/sockets.pasm' => {
- start => File::Spec->catfile( qw| . runtime parrot include sockets.pasm | ),
- end => File::Spec->catfile(
- $libdir, $versiondir, 'include', 'sockets.pasm' ),
- },
'install_config.fpmc' => {
start => File::Spec->catfile( qw| . install_config.fpmc | ),
end => File::Spec->catfile(
More information about the parrot-commits
mailing list