您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ tputs函数代码示例

51自学网 2021-06-03 08:56:04
  C++
这篇教程C++ tputs函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中tputs函数的典型用法代码示例。如果您正苦于以下问题:C++ tputs函数的具体用法?C++ tputs怎么用?C++ tputs使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了tputs函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: show_topics

static void show_topics(void){	TOPIC *topic;	USER  *user;	tputs("Topics in the RoundTable are:/n");	for (topic = topic_hd; topic; topic = topic->next)	{		tprintf("%s/n", topic->name);		if (topic->refcnt)		{			tputs("  ");			for (user = user_hd; user; user = user->next)				if (user->topic is topic) tprintf(" %s", user->call);			tputc('/n');		}	}}
开发者ID:g8bpq,项目名称:BPQ32,代码行数:20,


示例2: deal_with_col

void		deal_with_col(t_struct *info){	if (info->nb_item == 0)	{		info->coeff += 1;		info->nb_item = (info->node->length) / info->nb_col;		if (((info->node->length) % info->nb_col) != 0)			info->nb_item += 1;		tputs(tgoto(tgetstr("RI", NULL), 0,					(info->size_w + 2) * info->coeff), 1, ft_putchar_int);		tputs(tgoto(tgetstr("UP", NULL), 0, info->nb_item), 1, ft_putchar_int);	}	else if (info->coeff > 0)		tputs(tgoto(tgetstr("RI", NULL), 0,					(info->size_w + 2) * info->coeff), 1, ft_putchar_int);	if (info->count <= info->nb_item)		info->size_last += 1;	info->nb_item -= 1;	info->count--;}
开发者ID:Zethir,项目名称:ft_select,代码行数:20,


示例3: ft_move_right

void			ft_move_right(int *position, char *str){	if (*position == (int)ft_strlen(str))	{		ft_putchar(07);		return ;	}	if (*(str + *position) == '/n')	{		tputs(tgetstr("sf", NULL), 1, ft_putchar);		(*position)++;	}	else if (*(str + *position))	{		tputs(tgetstr("nd", NULL), 1, ft_putchar);		(*position)++;	}	if ((*position + g_prompt_len + 1) % g_ws.ws_col == 1)		tputs(tgetstr("sf", NULL), 1, ft_putchar);}
开发者ID:ColDReaVeR,项目名称:42sh,代码行数:20,


示例4: return

char	*bell_for_tab(char *buff, int j){	if (j >= 2 && ((buff[j - 1] == ' ' && buff[j - 2] != ' ') ||		(buff[j - 1] == '/t' && buff[j - 2] != '/t')))		return ("/0");	else	{		tputs(tgetstr("bl", NULL), 0, ft_outc);		return (NULL);	}}
开发者ID:vcourtin,项目名称:42.sh,代码行数:11,


示例5: go_inverse

void			go_inverse(void){	char		a[2];	a[0] = ' ';	a[1] = '/n';	tputs(tgetstr("mr", NULL), 0, tputs_putchar);	press_home_key();	press_printable_char(a);	press_backspace_key();}
开发者ID:cvrmj,项目名称:bidon,代码行数:11,


示例6: terminal_goto_xy

/* Move the cursor to the terminal location of X and Y. */voidterminal_goto_xy (int x, int y){  if (terminal_goto_xy_hook)    (*terminal_goto_xy_hook) (x, y);  else    {      if (term_goto)        tputs (tgoto (term_goto, x, y), 1, output_character_function);    }}
开发者ID:samdmarshall,项目名称:info,代码行数:12,


示例7: get_winsize

void		get_winsize(){  int		width;  int		height;  width = tgetnum("co");  height = tgetnum("li");  tputs(tgetstr("cl", NULL), 1, my_putchar);  if (height < 500 || width < 500)    my_putstr("Winsize too small !/n");}
开发者ID:Kafei59,项目名称:epitech-projects,代码行数:11,


示例8: ft_go_end

void				ft_go_end(int cols){	int				i;	i = 0;	while (i < cols - 1)	{		tputs(tgetstr("nd", NULL), 1, ft_putput);		++i;	}}
开发者ID:Apercu,项目名称:42sh,代码行数:11,


示例9: meta

/* * meta -- *    Turn on or off the terminal meta mode. */intmeta(/*ARGSUSED*/ WINDOW *win, bool bf){	(void)win;	if (bf == TRUE) {		if (meta_on != NULL) {			tputs(meta_on, 0, __cputchar);			_cursesi_screen->meta_state = TRUE;			fflush(_cursesi_screen->outfd);		}	} else {		if (meta_off != NULL) {			tputs(meta_off, 0, __cputchar);			_cursesi_screen->meta_state = FALSE;			fflush(_cursesi_screen->outfd);		}	}	return OK;}
开发者ID:M6PIC,项目名称:curses,代码行数:24,


示例10: ft_key_end

void	ft_key_end(t_cmd_line *line){	int	len;	len = ft_strlen(line->str);	while (line->pos < len)	{		tputs(tgetstr("nd", NULL), 1, ft_put_term_char);		++(line->pos);	}}
开发者ID:Peter-West,项目名称:42sh,代码行数:11,


示例11: do_even_more_shit

void		do_even_more_shit(char **env, char **path){	int			i;	t_print		*print;/*	char		**commands;*/	(void)env;	(void)path;	print = (t_print*)malloc(sizeof(t_print));	print->line = NULL;	print->histo = NULL;	while (create_prompt(NULL))	{		change_term_info(malloc_struct());		i = -1;		wait_and_read(print);		build_history_list(print);/* ************************************************************************** *//*  STRSPLIT SUR LES ; A REMPLACER PAR LE PARSER ? *//*  LA LIGNE DE COMMANDE EST STOCKEE DANS LA STRUCTURE PRINT : PRINT->LINE */		/*commands = ft_strsplit(print->line, ';');*//* ************************************************************************** *//**************************************************************************** *//*  JE FAIS UN STRCMP-exit POUR QUITTER EN ATTENDANT LA GESTION DES BUILTINS  *//*  CE BLOC DEVRA ETRE SUPPRIME                                               */		if (ft_strcmp(print->line, "exit") == 0)		{			change_back_term_info(NULL);			exit(-1);		}/* ************************************************************************** *//* ************************************************************************** *//*  REMISE A ZERO DES PARAMETRES DU SHELL AVANT L'EXECUTION D'UNE COMMANDE    */		if (print->line != NULL)			free(print->line);		FP("/n");		tputs(tgetstr("ei", NULL), 1, out);		change_back_term_info(NULL);/* ************************************************************************** *//* ************************************************************************** *//*  EXECUTION DES COMMANDES SEPAREES PAR LES ;                                */		/*while (++i, commands[i] != NULL)			start_commands(commands[i], &env, path);			delete_char_tab_tab(commands);*//* ************************************************************************** */		revers_insert_mode(print);	}	free(print);}
开发者ID:Succubae,项目名称:42,代码行数:54,


示例12: show_circuits

static void show_circuits(void){	CIRCUIT *circuit;	NODE    *node;	int     len;	tprintf("Here %-6.6s <- ", Node->aliass);	len = 0;	for (node = node_hd; node; node = node->next) if (node->refcnt)	{		len += strlen(node->alias) + 1;		if (len > 60) { len = strlen(node->alias) + 1; tputs(xxx); }		tputs(node->alias);		tputc(' ');	}	tputc('/n');	for (circuit = circuit_hd; circuit; circuit = circuit->next)	if (circuit->flags & p_linked)	{		tprintf("Link %-6.6s <- ", circuit->u.link->alias);		len = 0;		for (node = node_hd; node; node = node->next)		if (node->refcnt && !cn_find(circuit, node))		{			len += strlen(node->alias) + 1;			if (len > 60) { len = strlen(node->alias) + 1; tputs(xxx); }			tputs(node->alias);			tputc(' ');		}		tputc('/n');	}	else if (circuit->flags & p_user)		tprintf("User %-6.6s/n", circuit->u.user->call);	else if (circuit->flags & p_linkini)		tprintf("Link %-6.6s (setup)/n", circuit->u.link->alias);}
开发者ID:g8bpq,项目名称:BPQ32,代码行数:41,


示例13: write

t_dlist_node	*ft_select_arg(t_dlist *arg, t_dlist_node *node){	if (node->sel == 1)	{		node->sel = 0;		write(arg->fd, " ", 1);	}	else	{		node->sel = 1;		write(arg->fd, "X", 1);	}	tputs(tgetstr("le", NULL), 1, ft_putchar);	ft_underline(arg, node);	ft_desunderline(arg, node);	node = node->next;	tputs(tgoto(tgetstr("cm", NULL), node->pos_x, node->pos_y),			1, ft_putchar);	ft_underline(arg, node);	return (node);}
开发者ID:vikingeff,项目名称:ft_select,代码行数:21,


示例14: ft_backspace

int		ft_backspace(t_data *d){	char	*tmp;	if (d->line && d->line->index > 0)	{		tmp = ft_strnew(d->line->len);		ft_strncpy(tmp, d->line->str, d->line->index - 1);		ft_strcat(tmp, d->line->str + d->line->index);		ft_strdel(&d->line->str);		d->line->str = tmp;		d->line->index--;		d->line->len--;		tputs(tgetstr("le", NULL), 1, ft_int_putchar);		tputs(tgetstr("dm", NULL), 1, ft_int_putchar);		tputs(tgetstr("dc", NULL), 1, ft_int_putchar);		tputs(tgetstr("ed", NULL), 1, ft_int_putchar);	}	ft_print_list(d);	return (1);}
开发者ID:matt2905,项目名称:Minishell,代码行数:21,


示例15: terminal_delete_lines

/* At the line START, delete COUNT lines from the terminal display. */static voidterminal_delete_lines (int start, int count){  int lines;  /* Normalize arguments. */  if (start < 0)    start = 0;  lines = screenheight - start;  terminal_goto_xy (0, start);  if (term_DL)    tputs (tgoto (term_DL, 0, count), lines, output_character_function);  else    {      while (count--)        tputs (term_dl, lines, output_character_function);    }  fflush (stdout);}
开发者ID:ajinkya93,项目名称:OpenBSD,代码行数:22,


示例16: ft_home

int		ft_home(t_data *d){	if (d->line)	{		while (d->line->index > 0)		{			tputs(tgetstr("le", NULL), 1, ft_int_putchar);			d->line->index--;		}	}	return (1);}
开发者ID:matt2905,项目名称:Minishell,代码行数:12,


示例17: endwin

intendwin(){	__restore_stophandler();	if (curscr != NULL) {		if (curscr->flags & __WSTANDOUT) {			tputs(SE, 0, __cputchar);			curscr->flags &= ~__WSTANDOUT;		}		__mvcur(curscr->cury, curscr->curx, curscr->maxy - 1, 0, 0);	}	(void)tputs(VE, 0, __cputchar);	(void)tputs(TE, 0, __cputchar);	(void)fflush(stdout);	(void)setvbuf(stdout, NULL, _IOLBF, 0);	return (tcsetattr(STDIN_FILENO, __tcaction ?	    TCSASOFT | TCSADRAIN : TCSADRAIN, &__orig_termios) ? ERR : OK);}
开发者ID:aosm,项目名称:Libcurses,代码行数:21,


示例18: tvi

int					tvi(void){	char			*str;	if ((str = tgetstr("vi", NULL)) == NULL)	{		ft_putendl("Cursor invisible mode activated");		return (-1);	}	tputs(str, 1, ft_outc);	return (0);}
开发者ID:Magatte,项目名称:ft_select,代码行数:12,


示例19: knowresize

void	knowresize(int sig){	struct winsize	wn;	t_coor			cr;	(void)sig;	tputs(tgetstr("cl", NULL), 1, tputs_putchar);	ioctl(0, TIOCGWINSZ, &wn);	cr.y = wn.ws_row;	cr.x = wn.ws_col;	ft_print_list(NULL, NULL, &cr);}
开发者ID:jalcim,项目名称:42sh,代码行数:12,


示例20: po_tmcp

void	po_tmcp(t_data *data, t_opt *opt, t_game *game){  int	xi;  int	yi;  game->end = 1;  game->lpoal = opt->size / 2;  game->lpoar = 0;  xi = data->x;  while (game->end != 0)    {      yi = data->y;      tputs(tgetstr("ho", NULL), 1, f_putc);      tputs(tgetstr("cd", NULL), 1, f_putc);      aff_pyramide(data, opt);      aff_promp_2p_cl(data, game, xi, yi);      tputs(tgoto(tgetstr("cm", NULL), data->x, data->y), 1, f_putc);      my_printf("
C++ tr函数代码示例
C++ tprints函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。