fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / src / pmc / handle.pmc
blobfc4ad705fc3d62a3f8ea922e7aa3f53d4c46a235
1 /*
2 Copyright (C) 2008-2010, Parrot Foundation.
3 $Id$
5 =head1 NAME
7 src/pmc/handle.pmc - IO Handle PMC
9 =head1 DESCRIPTION
11 This is the base-class for all IO-related PMCs.
13 =head2 Vtable Functions
15 =over 4
17 =item C<init>
19 =item C<init_pmc>
21 Handle shouldn't be directly instantiated, init and init_pmc throws
22 EXCEPTION_INVALID_OPERATION.
24 =cut
28 #include "parrot/parrot.h"
29 #include "../src/io/io_private.h"
31 /* HEADERIZER HFILE: none */
32 /* HEADERIZER BEGIN: static */
33 /* HEADERIZER END: static */
35 pmclass Handle provides Handle manual_attrs {
36     /* TODO: Consider encapsulating PIOHANDLE as a PMC type, for subclassing */
37     ATTR PIOHANDLE os_handle;         /* Low level OS descriptor      */
39     VTABLE void init() {
40         Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
41             "Handle cannot be instantiated directly.");
42     }
44     VTABLE void init_pmc(PMC * init) {
45         Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INVALID_OPERATION,
46             "Handle cannot be instantiated directly.");
47     }
51 =back
53 =head2 Methods
55 =over 4
57 =item C<METHOD isatty()>
59 Returns a boolean value indicating whether C<SELF> is a console/tty.
60 This default implementation always return false. Override it in
61 subtypes that are or can be tty.
63 =cut
67     METHOD isatty() {
68         RETURN(INTVAL 0);
69     }
74  * Local variables:
75  *   c-file-style: "parrot"
76  * End:
77  * vim: expandtab shiftwidth=4:
78  */