152abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright/* 252abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * Copyright (c) 2012, The Android Open Source Project 352abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * All rights reserved. 452abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * 552abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * Redistribution and use in source and binary forms, with or without 652abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * modification, are permitted provided that the following conditions 752abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * are met: 852abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * * Redistributions of source code must retain the above copyright 952abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * notice, this list of conditions and the following disclaimer. 1052abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * * Redistributions in binary form must reproduce the above copyright 1152abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * notice, this list of conditions and the following disclaimer in 1252abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * the documentation and/or other materials provided with the 1352abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * distribution. 1452abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * * Neither the name of Google, Inc. nor the names of its contributors 1552abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * may be used to endorse or promote products derived from this 1652abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * software without specific prior written permission. 1752abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * 1852abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1952abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 2052abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 2152abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 2252abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 2352abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 2452abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 2552abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 2652abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 2752abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 2852abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2952abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * SUCH DAMAGE. 3052abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright */ 3152abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright 3252abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright#include <stdio.h> 3352abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright 3452abb4b1ef5f0a0939f1485433cf817523caf779Michael Wrightint clear_main(int argc, char **argv) { 3552abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright /* This prints the clear screen and move cursor to top-left corner control 3652abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * characters for VT100 terminals. This means it will not work on 3752abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * non-VT100 compliant terminals, namely Windows' cmd.exe, but should 3852abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright * work on anything unix-y. */ 3952abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright fputs("\x1b[2J\x1b[H", stdout); 4052abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright return 0; 4152abb4b1ef5f0a0939f1485433cf817523caf779Michael Wright} 42