From 07e246c51644d9790f2eaf4001ff4ffd40e3274f Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Tue, 22 Sep 1998 11:57:43 -0400 Subject: snapshot of project "lynx", label v2-8-1pre_1 --- src/HTAlert.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/HTAlert.c') diff --git a/src/HTAlert.c b/src/HTAlert.c index a4c57b8f..d305cbb4 100644 --- a/src/HTAlert.c +++ b/src/HTAlert.c @@ -93,7 +93,7 @@ PUBLIC void HTReadProgress ARGS2( static long kb_units = 1024; static time_t first, last; static long bytes_last; - long transfer_rate; + long transfer_rate, divisor; char line[80]; time_t now = time((time_t *)0); /* once per second */ char *units = "bytes"; @@ -115,18 +115,21 @@ PUBLIC void HTReadProgress ARGS2( last = now; bytes_last = bytes; } - if (total >= kb_units || bytes >= kb_units) { - bytes /= 1024; - if (total > 0) total /= 1024; + divisor = 1; + if (LYshow_kb_rate + && (total >= kb_units || bytes >= kb_units)) { + divisor = 1024; + bytes /= divisor; + if (total > 0) total /= divisor; units = "KB"; } if (total > 0) sprintf (line, "Read %ld of %ld %s of data.", bytes, total, units); - if (total <= 0) + else sprintf (line, "Read %ld %s of data.", bytes, units); - if (transfer_rate > 0) - sprintf (line + strlen(line), " %ld KB/sec.", transfer_rate / 1024); + if (transfer_rate > 0) + sprintf (line + strlen(line), ", %ld %s/sec.", transfer_rate / divisor, units); if (total < 0) { if (total < -1) strcat(line, " (Press 'z' to abort)"); -- cgit 1.4.1-2-gfad0 lynx-snapshots/diff/src/LYStyle.h?id=00405b6d018cc5689beb1b274592802b1efb724b'>diff stats
path: root/src/LYStyle.h
blob: d1cf9db183eef3d521cf81db9b4f2f02833ef788 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                             


                 

                    

                      
                     
                    
 



                                                      

                                   
                                                      
 
                                                       
                                       
 
                                              
 
                                              
 


                                                    
 




                                                                                
                                                
 



                                                                               
   

                                        
 
                                



                                                                             
                                  



                                                                          
                                       


                                                                          
   





                                                         








                                                             



                                                     

                          
                      
/* $LynxId: LYStyle.h,v 1.15 2007/07/23 19:21:54 tom Exp $ */
#ifndef LYSTYLE_H
#define LYSTYLE_H

#include <HTUtils.h>

#ifdef USE_COLOR_STYLE

#include <AttrList.h>
#include <HTMLDTD.h>

#ifdef __cplusplus
extern "C" {
#endif
/* list of elements */ extern const SGML_dtd HTML_dtd;

/* array of currently set styles */
    extern HTCharStyle displayStyles[DSTYLE_ELEMENTS];

/* Set all the buckets in the hash table to be empty */
    extern void parse_userstyles(void);

    extern void style_defaultStyleSheet(void);

    extern int style_readFromFile(char *file);

    extern void TrimColorClass(const char *tagname,
			       char *styleclassname,
			       int *phcode);

/* this is an array of styles for tags that don't specify 'class' - the values
 * from that array will be suggested by SGML.c by setting the following
 * variable.  Value of -1 means that style value should be calculated honestly. 
 * -HV
 */
    extern int cached_tag_styles[HTML_ELEMENTS];

/* the style for current tag is suggested in current_tag_style.  If
 * force_current_tag_style =TRUE, then no attempts to calculate the color style
 * for current tag should be made - the value of 'current_tag_style' must be
 * used.
 */
    extern int current_tag_style;
    extern BOOL force_current_tag_style;

    extern BOOL force_classname;

/* if force_current_tag_style =TRUE, then here will be the classname (this is
 * done to avoid copying the class name to the buffer class_name.
 */
    extern char *forced_classname;

/* This is called each time lss styles are read.  It will fill each elt of
 * 'cached_tag_styles' -HV
 */
    extern void cache_tag_styles(void);

/* this is global var - it can be used for reading the end of string found
 * during last invokation of TrimColorClass.
 */
    extern void FastTrimColorClass(const char *tag_name,
				   int name_len,
				   char *stylename,
				   char **pstylename_end,
				   int *hcode);

/*
 * Functions for cached-styles
 */
    extern BOOL ValidCachedStyle(int y, int x);
    extern unsigned GetCachedStyle(int y, int x);
    extern void FreeCachedStyles(void);
    extern void ResetCachedStyles(void);
    extern void SetCachedStyle(int y, int x, unsigned value);

#ifdef __cplusplus
}
#endif
#endif				/* USE_COLOR_STYLE */
extern int lynx_has_color;

#endif /* LYSTYLE_H */