Blame android/client/terminal.h

Packit 34410b
/*
Packit 34410b
 * Copyright (C) 2013 Intel Corporation
Packit 34410b
 *
Packit 34410b
 * Licensed under the Apache License, Version 2.0 (the "License");
Packit 34410b
 * you may not use this file except in compliance with the License.
Packit 34410b
 * You may obtain a copy of the License at
Packit 34410b
 *
Packit 34410b
 *      http://www.apache.org/licenses/LICENSE-2.0
Packit 34410b
 *
Packit 34410b
 * Unless required by applicable law or agreed to in writing, software
Packit 34410b
 * distributed under the License is distributed on an "AS IS" BASIS,
Packit 34410b
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Packit 34410b
 * See the License for the specific language governing permissions and
Packit 34410b
 * limitations under the License.
Packit 34410b
 *
Packit 34410b
 */
Packit 34410b
Packit 34410b
#include <stdarg.h>
Packit 34410b
Packit 34410b
/* size of supported line */
Packit 34410b
#define LINE_BUF_MAX 1024
Packit 34410b
Packit 34410b
enum key_codes {
Packit 34410b
	KEY_BACKSPACE = 0x7F,
Packit 34410b
	KEY_INSERT = 1000, /* arbitrary value */
Packit 34410b
	KEY_DELETE,
Packit 34410b
	KEY_HOME,
Packit 34410b
	KEY_END,
Packit 34410b
	KEY_PGUP,
Packit 34410b
	KEY_PGDOWN,
Packit 34410b
	KEY_LEFT,
Packit 34410b
	KEY_RIGHT,
Packit 34410b
	KEY_UP,
Packit 34410b
	KEY_DOWN,
Packit 34410b
	KEY_CLEFT,
Packit 34410b
	KEY_CRIGHT,
Packit 34410b
	KEY_CUP,
Packit 34410b
	KEY_CDOWN,
Packit 34410b
	KEY_SLEFT,
Packit 34410b
	KEY_SRIGHT,
Packit 34410b
	KEY_SUP,
Packit 34410b
	KEY_SDOWN,
Packit 34410b
	KEY_MLEFT,
Packit 34410b
	KEY_MRIGHT,
Packit 34410b
	KEY_MUP,
Packit 34410b
	KEY_MDOWN,
Packit 34410b
	KEY_STAB,
Packit 34410b
	KEY_M_p,
Packit 34410b
	KEY_M_n
Packit 34410b
};
Packit 34410b
Packit 34410b
typedef void (*line_callback)(char *);
Packit 34410b
Packit 34410b
void terminal_setup(void);
Packit 34410b
int terminal_print(const char *format, ...);
Packit 34410b
int terminal_vprint(const char *format, va_list args);
Packit 34410b
void terminal_process_char(int c, line_callback process_line);
Packit 34410b
void terminal_insert_into_command_line(const char *p);
Packit 34410b
void terminal_draw_command_line(void);
Packit 34410b
void terminal_prompt_for(const char *s, line_callback process_line);
Packit 34410b
Packit 34410b
void process_tab(const char *line, int len);