[51445] trunk/base/src/pextlib1.0/tty.c
toby at macports.org
toby at macports.org
Mon May 25 01:41:31 PDT 2009
Revision: 51445
http://trac.macports.org/changeset/51445
Author: toby at macports.org
Date: 2009-05-25 01:41:31 -0700 (Mon, 25 May 2009)
Log Message:
-----------
fix indentation
Modified Paths:
--------------
trunk/base/src/pextlib1.0/tty.c
Modified: trunk/base/src/pextlib1.0/tty.c
===================================================================
--- trunk/base/src/pextlib1.0/tty.c 2009-05-25 08:08:18 UTC (rev 51444)
+++ trunk/base/src/pextlib1.0/tty.c 2009-05-25 08:41:31 UTC (rev 51445)
@@ -47,80 +47,82 @@
#include "tty.h"
-int IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+int
+IsattyCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
- Tcl_Obj *tcl_result;
- Tcl_Channel chan;
- int dir;
- int fd;
- int rval;
+ Tcl_Obj *tcl_result;
+ Tcl_Channel chan;
+ int dir;
+ int fd;
+ int rval;
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "channel");
- return TCL_ERROR;
- }
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "channel");
+ return TCL_ERROR;
+ }
- chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
- if (chan == NULL) {
- Tcl_SetResult(interp, "no such channel", TCL_STATIC);
- return TCL_ERROR;
- }
+ chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
+ if (chan == NULL) {
+ Tcl_SetResult(interp, "no such channel", TCL_STATIC);
+ return TCL_ERROR;
+ }
- if (Tcl_GetChannelHandle(chan,
- dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
- (ClientData*) &fd) == TCL_ERROR) {
- return TCL_ERROR;
- }
+ if (Tcl_GetChannelHandle(chan,
+ dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
+ (ClientData*) &fd) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
- rval = isatty(fd);
+ rval = isatty(fd);
- tcl_result = Tcl_NewIntObj(rval);
- Tcl_SetObjResult(interp, tcl_result);
+ tcl_result = Tcl_NewIntObj(rval);
+ Tcl_SetObjResult(interp, tcl_result);
- return TCL_OK;
+ return TCL_OK;
}
-int TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
+int
+TermGetSizeCmd(ClientData clientData UNUSED, Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
{
- Tcl_Obj *tcl_result;
- Tcl_Channel chan;
- int dir;
- int fd;
- Tcl_Obj *robjv[2];
- struct winsize ws = {0, 0, 0, 0};
+ Tcl_Obj *tcl_result;
+ Tcl_Channel chan;
+ int dir;
+ int fd;
+ Tcl_Obj *robjv[2];
+ struct winsize ws = {0, 0, 0, 0};
- if (objc != 2) {
- Tcl_WrongNumArgs(interp, 1, objv, "channel");
- return TCL_ERROR;
- }
+ if (objc != 2) {
+ Tcl_WrongNumArgs(interp, 1, objv, "channel");
+ return TCL_ERROR;
+ }
- chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
- if (chan == NULL) {
- Tcl_SetResult(interp, "no such channel", TCL_STATIC);
- return TCL_ERROR;
- }
+ chan = Tcl_GetChannel(interp, Tcl_GetString(objv[1]), &dir);
+ if (chan == NULL) {
+ Tcl_SetResult(interp, "no such channel", TCL_STATIC);
+ return TCL_ERROR;
+ }
- if (Tcl_GetChannelHandle(chan,
- dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
- (ClientData*) &fd) == TCL_ERROR) {
- return TCL_ERROR;
- }
+ if (Tcl_GetChannelHandle(chan,
+ dir & TCL_READABLE ? TCL_READABLE : TCL_WRITABLE,
+ (ClientData*) &fd) == TCL_ERROR) {
+ return TCL_ERROR;
+ }
- if (!isatty(fd)) {
- Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
- return TCL_ERROR;
- }
+ if (!isatty(fd)) {
+ Tcl_SetResult(interp, "channel is not connected to a tty", TCL_STATIC);
+ return TCL_ERROR;
+ }
- if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
- Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
- return TCL_ERROR;
- }
+ if (ioctl(fd, TIOCGWINSZ, &ws) == -1) {
+ Tcl_SetResult(interp, "ioctl failed", TCL_STATIC);
+ return TCL_ERROR;
+ }
- robjv[0] = Tcl_NewIntObj(ws.ws_row);
- robjv[1] = Tcl_NewIntObj(ws.ws_col);
+ robjv[0] = Tcl_NewIntObj(ws.ws_row);
+ robjv[1] = Tcl_NewIntObj(ws.ws_col);
- tcl_result = Tcl_NewListObj(2, robjv);
- Tcl_SetObjResult(interp, tcl_result);
+ tcl_result = Tcl_NewListObj(2, robjv);
+ Tcl_SetObjResult(interp, tcl_result);
- return TCL_OK;
+ return TCL_OK;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090525/bdcf7e2e/attachment.html>
More information about the macports-changes
mailing list