Browse Source

Replaced addstr() call to tty_print_string() one.

Andrew Borodin 16 years ago
parent
commit
7a75f8723d
10 changed files with 56 additions and 59 deletions
  1. 1 1
      edit/editdraw.c
  2. 9 9
      src/achown.c
  3. 10 10
      src/chmod.c
  4. 8 8
      src/chown.c
  5. 2 2
      src/help.c
  6. 3 3
      src/info.c
  7. 1 1
      src/layout.c
  8. 14 14
      src/screen.c
  9. 4 4
      src/tree.c
  10. 4 7
      src/view.c

+ 1 - 1
edit/editdraw.c

@@ -340,7 +340,7 @@ print_to_widget (WEdit *edit, long row, int start_col, int start_col_real,
             } else {
                 str[res] = '\0';
             }
-            addstr ((char *)str);
+            tty_print_string ((char *) str);
         } else {
             addch(textchar);
         }

+ 9 - 9
src/achown.c

@@ -347,23 +347,23 @@ static void chown_refresh (void)
     tty_setcolor (COLOR_NORMAL);
 
     dlg_move (ch_dlg, BY - 1, 8);
-    addstr (_("owner"));
+    tty_print_string (_("owner"));
     dlg_move (ch_dlg, BY - 1, 16);
-    addstr (_("group"));
+    tty_print_string (_("group"));
     dlg_move (ch_dlg, BY - 1, 24);
-    addstr (_("other"));
+    tty_print_string (_("other"));
     
     dlg_move (ch_dlg, BY - 1, 35);
-    addstr (_("owner"));
+    tty_print_string (_("owner"));
     dlg_move (ch_dlg, BY - 1, 53);
-    addstr (_("group"));
+    tty_print_string (_("group"));
     
     dlg_move (ch_dlg, 3, 4);
-    addstr (_("On"));
+    tty_print_string (_("On"));
     dlg_move (ch_dlg, BY + 1, 4);
-    addstr (_("Flag"));
+    tty_print_string (_("Flag"));
     dlg_move (ch_dlg, BY + 2, 4);
-    addstr (_("Mode"));
+    tty_print_string (_("Mode"));
 
     if (!single_set){
 	dlg_move (ch_dlg, 3, 54);
@@ -382,7 +382,7 @@ static void chown_info_update (void)
     
     /* name && mode */
     dlg_move (ch_dlg, 3, 8);
-    addstr (str_fit_to_term (fname, 45, J_LEFT_FIT));
+    tty_print_string (str_fit_to_term (fname, 45, J_LEFT_FIT));
     dlg_move (ch_dlg, BY + 2, 9);
     tty_printf ("%12o", get_mode ());
     

+ 10 - 10
src/chmod.c

@@ -131,29 +131,29 @@ static void chmod_refresh (Dlg_head *h)
     draw_box (h, FY, FX, 10, 25);
 
     dlg_move (h, FY + 1, FX + 2);
-    addstr (_("Name"));
+    tty_print_string (_("Name"));
     dlg_move (h, FY + 3, FX + 2);
-    addstr (_("Permissions (Octal)"));
+    tty_print_string (_("Permissions (Octal)"));
     dlg_move (h, FY + 5, FX + 2);
-    addstr (_("Owner name"));
+    tty_print_string (_("Owner name"));
     dlg_move (h, FY + 7, FX + 2);
-    addstr (_("Group name"));
+    tty_print_string (_("Group name"));
     
     dlg_move (h, TY, TX);
-    addstr (_("Use SPACE to change"));
+    tty_print_string (_("Use SPACE to change"));
     dlg_move (h, TY + 1, TX);
-    addstr (_("an option, ARROW KEYS"));
+    tty_print_string (_("an option, ARROW KEYS"));
     dlg_move (h, TY + 2, TX);
-    addstr (_("to move between options"));
+    tty_print_string (_("to move between options"));
     dlg_move (h, TY + 3, TX);
-    addstr (_("and T or INS to mark"));
+    tty_print_string (_("and T or INS to mark"));
 
     tty_setcolor (COLOR_HOT_NORMAL);
 
     dlg_move (h, PY, PX + 1);
-    addstr (_(" Permission "));
+    tty_print_string (_(" Permission "));
     dlg_move (h, FY, FX + 1);
-    addstr (_(" File "));
+    tty_print_string (_(" File "));
 }
 
 static cb_ret_t

+ 8 - 8
src/chown.c

@@ -108,23 +108,23 @@ chown_refresh (Dlg_head *h)
     draw_box (h, TY, TX, 12, 19);
 
     dlg_move (h, TY + 1, TX + 1);
-    addstr (_(" Name "));
+    tty_print_string (_(" Name "));
     dlg_move (h, TY + 3, TX + 1);
-    addstr (_(" Owner name "));
+    tty_print_string (_(" Owner name "));
     dlg_move (h, TY + 5, TX + 1);
-    addstr (_(" Group name "));
+    tty_print_string (_(" Group name "));
     dlg_move (h, TY + 7, TX + 1);
-    addstr (_(" Size "));
+    tty_print_string (_(" Size "));
     dlg_move (h, TY + 9, TX + 1);
-    addstr (_(" Permission "));
+    tty_print_string (_(" Permission "));
     
     tty_setcolor (COLOR_HOT_NORMAL);
     dlg_move (h, UY, UX + 1);
-    addstr (_(" User name "));
+    tty_print_string (_(" User name "));
     dlg_move (h, GY, GX + 1);
-    addstr (_(" Group name "));
+    tty_print_string (_(" Group name "));
     dlg_move (h, TY, TX + 1);
-    addstr (_(" File "));
+    tty_print_string (_(" File "));
 }
 
 static char *

+ 2 - 2
src/help.c

@@ -400,7 +400,7 @@ static void help_show (Dlg_head *h, const char *paint_start)
 		break;
 	    case CHAR_VERSION:
 		dlg_move (h, line+2, col+2);
-		addstr (VERSION);
+		tty_print_string (VERSION);
 		col += str_term_width1 (VERSION);
 		break;
 	    case CHAR_FONT_BOLD:
@@ -437,7 +437,7 @@ static void help_show (Dlg_head *h, const char *paint_start)
 			SLsmg_draw_object (h->y + line + 2, h->x + col + 2, c);
 #endif
 		} else {
-		    addstr (buff);
+		    tty_print_string (buff);
                 }
                 col+= w;
 		break;

+ 3 - 3
src/info.c

@@ -113,7 +113,7 @@ info_show_info (struct WInfo *info)
 		    ? 100 * myfs_stats.nfree / myfs_stats.nodes : 0,
 		    myfs_stats.nodes);
 	else
-	    addstr (_("No node information"));
+	    tty_print_string (_("No node information"));
 
     case 15:
 	widget_move (&info->widget, 15, 3);
@@ -125,7 +125,7 @@ info_show_info (struct WInfo *info)
 		    (int)(100 * (double)myfs_stats.avail / myfs_stats.total) : 0,
 		    buffer2);
 	} else
-	    addstr (_("No space information"));
+	    tty_print_string (_("No space information"));
 
     case 14:
 	widget_move (&info->widget, 14, 3);
@@ -211,7 +211,7 @@ info_show_info (struct WInfo *info)
 				    info->widget.cols - i18n_adjust));
             tty_print_string (buff->str);
 	} else
-	    addstr (_("File:       None"));
+	    tty_print_string (_("File:       None"));
 
     case 2:
     case 1:

+ 1 - 1
src/layout.c

@@ -853,7 +853,7 @@ void print_vfs_message (const char *msg, ...)
 
 	tty_gotoyx (0, 0);
 	tty_setcolor (NORMAL_COLOR);
-	addstr (str_fit_to_term (str, COLS - 1, J_LEFT));
+	tty_print_string (str_fit_to_term (str, COLS - 1, J_LEFT));
 
 	/* Restore cursor position */
 	tty_gotoyx (row, col);

+ 14 - 14
src/screen.c

@@ -559,7 +559,7 @@ format_file (char *dest, int limit, WPanel *panel, int file_index, int width, in
                 add_permission_string (preperad_text, format->field_len, fe,
                                        attr, color, perm - 1);
             else
-                addstr (preperad_text);
+                tty_print_string (preperad_text);
 
             length+= len;
 	} else {
@@ -632,8 +632,8 @@ display_mini_info (WPanel *panel)
 
     if (panel->searching){
 	tty_setcolor (INPUT_COLOR);
-        addstr ("/");
-        addstr (str_fit_to_term (panel->search_buffer, 
+        tty_print_string ("/");
+        tty_print_string (str_fit_to_term (panel->search_buffer, 
                 panel->widget.cols - 3, J_LEFT));
 	tty_setcolor (NORMAL_COLOR);
 	return;
@@ -651,18 +651,18 @@ display_mini_info (WPanel *panel)
 	g_free (link);
 	if (len > 0){
 	    link_target[len] = 0;
-            addstr ("-> ");
-            addstr (str_fit_to_term (link_target, panel->widget.cols - 5, 
+            tty_print_string ("-> ");
+            tty_print_string (str_fit_to_term (link_target, panel->widget.cols - 5, 
                     J_LEFT_FIT));
 	} else
-            addstr (str_fit_to_term (_("<readlink failed>"), 
+            tty_print_string (str_fit_to_term (_("<readlink failed>"), 
                     panel->widget.cols - 2, J_LEFT));
     } else if (strcmp (panel->dir.list [panel->selected].fname, "..") == 0) {
 	/* FIXME:
 	 * while loading directory (do_load_dir() and do_reload_dir(),
 	 * the actual stat info about ".." directory isn't got;
 	 * so just don't display incorrect info about ".." directory */
-	addstr (str_fit_to_term (_("UP--DIR"), panel->widget.cols - 2, J_LEFT));
+	tty_print_string (str_fit_to_term (_("UP--DIR"), panel->widget.cols - 2, J_LEFT));
     } else
 	/* Default behavior */
 	repaint_file (panel, panel->selected, 0, STATUS, 1);
@@ -790,7 +790,7 @@ show_free_space (WPanel *panel)
 	widget_move (&panel->widget, panel->widget.lines - 1,
 				     panel->widget.cols - 2 - (int) strlen (tmp));
 	tty_setcolor (NORMAL_COLOR);
-	addstr (tmp);
+	tty_print_string (tmp);
     }
 }
 
@@ -819,15 +819,15 @@ show_dir (WPanel *panel)
 
     addch (' ');
     len = min (max (panel->widget.cols - 9, 0), panel->widget.cols); 
-    addstr (str_term_trim (strip_home_and_password (panel->cwd), len));
+    tty_print_string (str_term_trim (strip_home_and_password (panel->cwd), len));
     addch (' ');
 
     widget_move (&panel->widget, 0, 1);
-    addstr ("<");
+    tty_print_string ("<");
     widget_move (&panel->widget, 0, panel->widget.cols - 2);
-    addstr (">");
+    tty_print_string (">");
     widget_move (&panel->widget, 0, panel->widget.cols - 3);
-    addstr ("v");
+    tty_print_string ("v");
 
     if (!show_mini_info) {
 	if (panel->marked == 0) {
@@ -839,7 +839,7 @@ show_dir (WPanel *panel)
 			    size_trunc_sep (panel->dir.list [panel->selected].st.st_size));
 		tty_setcolor (NORMAL_COLOR);
 		widget_move (&panel->widget, panel->widget.lines - 1, 2);
-		addstr (buffer);
+		tty_print_string (buffer);
 	    }
 	} else {
 	    /* Show total size of marked files
@@ -1244,7 +1244,7 @@ paint_frame (WPanel *panel)
 		    header_len = format->field_len;
 
                 tty_setcolor (MARKED_COLOR);
-                addstr (str_fit_to_term (txt, format->field_len, J_CENTER_LEFT));
+                tty_print_string (str_fit_to_term (txt, format->field_len, J_CENTER_LEFT));
                 g_free(txt);
                 width -= format->field_len;
 	    } else {

+ 4 - 4
src/tree.c

@@ -183,13 +183,13 @@ static void tree_show_mini_info (WTree *tree, int tree_lines, int tree_cols)
 	tty_setcolor (DLG_FOCUSC (h));
 	addch (PATH_SEP);
 
-	addstr (str_fit_to_term (tree->search_buffer, 
+	tty_print_string (str_fit_to_term (tree->search_buffer, 
 		tree_cols - 2, J_LEFT_FIT));
 	addch (' ');
 	tty_setcolor (DLG_FOCUSC (h));
     } else {
 	/* Show full name of selected directory */
-	addstr (str_fit_to_term (tree->selected_ptr->name, 
+	tty_print_string (str_fit_to_term (tree->selected_ptr->name, 
 		tree_cols, J_LEFT_FIT));
     }
 }
@@ -276,7 +276,7 @@ static void show_tree (WTree *tree)
 	    }
 
 	    /* Show full name */
-	    addstr (str_fit_to_term (current->name, tree_cols - 6, J_LEFT_FIT));
+	    tty_print_string (str_fit_to_term (current->name, tree_cols - 6, J_LEFT_FIT));
 	} else{
 	    /* Sub level directory */
 
@@ -310,7 +310,7 @@ static void show_tree (WTree *tree)
 
 	    /* Show sub-name */
 	    addch (' ');
-	    addstr (str_fit_to_term (current->subname, 
+	    tty_print_string (str_fit_to_term (current->subname, 
 		    tree_cols - 2 - 4 - 3 * j, J_LEFT_FIT));
 	}
 	addch (' ');

+ 4 - 7
src/view.c

@@ -2130,7 +2130,6 @@ view_display_status (WView *view)
     const char *file_label, *file_name;
     screen_dimen file_label_width;
     int i;
-    char *tmp;
 
     if (height < 1)
 	return;
@@ -2146,13 +2145,11 @@ view_display_status (WView *view)
 	: "";
 
     if (width < file_label_width + 6)
-	addstr (str_fit_to_term (file_name, width, J_LEFT_FIT));
+	tty_print_string (str_fit_to_term (file_name, width, J_LEFT_FIT));
     else {
 	i = (width > 22 ? 22 : width) - file_label_width;
-        
-        tmp = g_strdup_printf (file_label, str_fit_to_term (file_name, i, J_LEFT_FIT));
-        addstr (tmp);
-        g_free (tmp);
+        tty_printf (file_label, str_fit_to_term (file_name, i, J_LEFT_FIT));
+
 	if (width > 46) {
 	    widget_move (view, top, left + 24);
 	    /* FIXME: the format strings need to be changed when offset_type changes */
@@ -2282,7 +2279,7 @@ view_display_hex (WView *view)
     struct hexedit_change_node *curr = view->change_list;
     size_t i;
 
-    char hex_buff[10];	/* A temporary buffer for sprintf and mvwaddstr */
+    char hex_buff[10];	/* A temporary buffer for sprintf */
     int bytes;		/* Number of bytes already printed on the line */
 
     view_display_clean (view);

Some files were not shown because too many files changed in this diff