You can subscribe to this list here.
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
(43) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2007 |
Jan
(34) |
Feb
(58) |
Mar
(8) |
Apr
(23) |
May
(9) |
Jun
(23) |
Jul
|
Aug
(15) |
Sep
(7) |
Oct
(10) |
Nov
(2) |
Dec
(3) |
| 2008 |
Jan
(14) |
Feb
(12) |
Mar
(9) |
Apr
(6) |
May
(13) |
Jun
(2) |
Jul
(18) |
Aug
(5) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
(9) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(1) |
| 2010 |
Jan
|
Feb
(4) |
Mar
(3) |
Apr
(4) |
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
(3) |
Oct
(1) |
Nov
(4) |
Dec
(1) |
| 2011 |
Jan
|
Feb
(14) |
Mar
(5) |
Apr
|
May
|
Jun
(2) |
Jul
(2) |
Aug
(2) |
Sep
|
Oct
(7) |
Nov
(2) |
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
(6) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2013 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
|
Nov
(8) |
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(3) |
Oct
(6) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
(1) |
2
(1) |
|
3
(1) |
4
|
5
(2) |
6
|
7
(10) |
8
(6) |
9
(2) |
|
10
|
11
|
12
|
13
|
14
|
15
|
16
|
|
17
|
18
|
19
|
20
|
21
|
22
|
23
|
|
24
|
25
|
26
|
27
|
28
|
29
|
30
|
|
From: walter h. <wh...@bf...> - 2007-06-09 16:25:20
|
Hi, looks nice, but static global vars are ALWAYS initialised to 0, it somewhere down in the C Standard. And i feel there is a misunderstanding, i do not want to *remove* the lpf, just move it into a separate package. It does not share code with lpd unlike lpc,lpq etc. So i see no need to keep it there. Maybe we can find someone willing to maintain it independently. re, wh Bernhard R. Link wrote: > * walter harms <wh...@bf...> [070608 15:17]: >> since lpf.c depends only on plp_sprint() should we set it free in the next release ? >> I thing by using getopt() sprinf() and so on it will become much shorter and >> can have it own tree. (is ANYONE still using it ?) > > as it is quite small, and is also suiteable to debug the options a > filter gets, I'd vote for keeping it in. > > I've applied to attached patch, which should have all the cleaning of > the code of your patch and some more to quiet some more warnings. > (Especially -Wunreachable-code noticed that having spaced between > options and their arguments was buggy as ++i and i++ are different). > Additionally I gave some variables default values. (Looks like they > were always initialized to zero by pure luck). > > Hochachtungsvoll, > Bernhard R. Link > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Lprng-devel mailing list > Lpr...@li... > https://lists.sourceforge.net/lists/listinfo/lprng-devel |
|
From: Bernhard R. L. <br...@de...> - 2007-06-09 13:46:14
|
* walter harms <wh...@bf...> [070608 15:17]: > since lpf.c depends only on plp_sprint() should we set it free in the next release ? > I thing by using getopt() sprinf() and so on it will become much shorter and > can have it own tree. (is ANYONE still using it ?) as it is quite small, and is also suiteable to debug the options a filter gets, I'd vote for keeping it in. I've applied to attached patch, which should have all the cleaning of the code of your patch and some more to quiet some more warnings. (Especially -Wunreachable-code noticed that having spaced between options and their arguments was buggy as ++i and i++ are different). Additionally I gave some variables default values. (Looks like they were always initialized to zero by pure luck). Hochachtungsvoll, Bernhard R. Link |
|
From: walter h. <wh...@bf...> - 2007-06-08 14:35:29
|
Bernhard R. Link wrote: > * walter harms <wh...@bf...> [070607 17:30]: >> --- lpd.c.org 2007-06-07 15:32:56.000000000 +0200 >> +++ lpd.c 2007-06-07 15:37:25.000000000 +0200 >> @@ -994,7 +994,7 @@ >> if( pid < 0 ){ >> LOGERR(LOG_INFO) _("lpd: fork() failed") ); >> if( lpd_socket ){ >> - Write_fd_str( newsock, "\002Server load too high\n"); >> + Write_fd_str( newsock, _("\002Server load too high\n")); > > I've commited it as > + safefprintf(newsock, "\002%s\n", _("Server load too high")); > > That way no \002 ends up in the .pot and .po files. > really, i am wondering since \002 should be seems as string. ntl. nice solution (i should set up a page with hints for translations :)) re, wh |
|
From: Bernhard R. L. <br...@de...> - 2007-06-08 14:23:35
|
* walter harms <wh...@bf...> [070607 17:30]: > --- lpd.c.org 2007-06-07 15:32:56.000000000 +0200 > +++ lpd.c 2007-06-07 15:37:25.000000000 +0200 > @@ -994,7 +994,7 @@ > if( pid < 0 ){ > LOGERR(LOG_INFO) _("lpd: fork() failed") ); > if( lpd_socket ){ > - Write_fd_str( newsock, "\002Server load too high\n"); > + Write_fd_str( newsock, _("\002Server load too high\n")); I've commited it as + safefprintf(newsock, "\002%s\n", _("Server load too high")); That way no \002 ends up in the .pot and .po files. Hochachtungsvoll, Bernhard R. Link |
|
From: walter h. <wh...@bf...> - 2007-06-08 14:16:23
|
Bernhard R. Link wrote: > * walter harms <wh...@bf...> [070607 21:11]: >> translations are always very crude. imho it makes no sense to spend time to check all the >> different plural forms of the languages. Given the fact that some languages have very 'exotic' >> ideas about plural/gender etc. i feel this attempt will fail. If someone really need it he may >> choose something like "job(s)". > > Isn't it the sole purpose of ngettext to deal with those exotic plural forms? > yes, and it adds an extra layer of complexity. We should concentrate on the current translation effort and fix problems coming with it. The whole i18n stuff is ill defined (look xlocale.h). For now hands of, the "simple" translation my be clumsy in same cases but we do not need to be perfect now. re, wh |
|
From: walter h. <wh...@bf...> - 2007-06-08 13:16:44
|
you are right,
we can rename lpf_time_str(int shortform, time_t t) to lpf_time_str(void)
since it is used only once and we know what we want.
Additional my brain followed the wrong path in if() (arg!)
nice catch.
since lpf.c depends only on plp_sprint() should we set it free in the next release ?
I thing by using getopt() sprinf() and so on it will become much shorter and
can have it own tree. (is ANYONE still using it ?)
re,
wh
Bernhard R. Link wrote:
> * walter harms <wh...@bf...> [070607 21:01]:
>> -char *Time_str(int shortform, time_t t);
>> +
>> +static char *lpf_time_str(int shortform, time_t t)
>> +{
>> + static char buffer[99];
>> + struct tm *tmptr;
>> + struct timeval tv={0,0};
>> +
>> +
>> + if ( gettimeofday( &tv, 0 ) == -1 ){
>> + logerr_die( "Time_str: gettimeofday failed");
>> + }
>> +
>> + tmptr = localtime( &tv.tv_sec );
>> + SNPRINTF( buffer, sizeof(buffer))
>> + "%02d:%02d:%02d.%03d",
>> + tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
>> + (int)(tv.tv_usec/1000) );
>> +
>> + return( buffer );
>> +}
>
>> - Time_str(0,0));
>> + lpf_time_str(0,0));
>
>> - tmptr = localtime( &t );
>> - if( shortform ){
>> - SNPRINTF( buffer, sizeof(buffer))
>> - "%02d:%02d:%02d.%03d",
>> - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
>> - (int)(tv.tv_usec/1000) );
>> } else {
>> - SNPRINTF( buffer, sizeof(buffer))
>> - "%d-%02d-%02d-%02d:%02d:%02d.%03d",
>> - tmptr->tm_year+1900, tmptr->tm_mon+1, tmptr->tm_mday,
>> - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
>> - (int)(tv.tv_usec/1000) );
>
> Doesn't that change the output? shortform seems to be always 0, and you
> make it return the shortform uncondionally.
>
> Hochachtungsvoll,
> Bernhard R. Link
>
> P.S: something breaks whitespace in you patches before they arrive here.
> Attaching the patches is likely to work much better.
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Lprng-devel mailing list
> Lpr...@li...
> https://lists.sourceforge.net/lists/listinfo/lprng-devel
>
>
|
|
From: Bernhard R. L. <br...@de...> - 2007-06-08 12:55:13
|
* walter harms <wh...@bf...> [070607 21:11]: > translations are always very crude. imho it makes no sense to spend time to check all the > different plural forms of the languages. Given the fact that some languages have very 'exotic' > ideas about plural/gender etc. i feel this attempt will fail. If someone really need it he may > choose something like "job(s)". Isn't it the sole purpose of ngettext to deal with those exotic plural forms? Hochachtungsvoll, Bernhard R. Link |
|
From: Bernhard R. L. <br...@de...> - 2007-06-08 12:54:07
|
* walter harms <wh...@bf...> [070607 21:01]:
> -char *Time_str(int shortform, time_t t);
> +
> +static char *lpf_time_str(int shortform, time_t t)
> +{
> + static char buffer[99];
> + struct tm *tmptr;
> + struct timeval tv={0,0};
> +
> +
> + if ( gettimeofday( &tv, 0 ) == -1 ){
> + logerr_die( "Time_str: gettimeofday failed");
> + }
> +
> + tmptr = localtime( &tv.tv_sec );
> + SNPRINTF( buffer, sizeof(buffer))
> + "%02d:%02d:%02d.%03d",
> + tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
> + (int)(tv.tv_usec/1000) );
> +
> + return( buffer );
> +}
> - Time_str(0,0));
> + lpf_time_str(0,0));
> - tmptr = localtime( &t );
> - if( shortform ){
> - SNPRINTF( buffer, sizeof(buffer))
> - "%02d:%02d:%02d.%03d",
> - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
> - (int)(tv.tv_usec/1000) );
> } else {
> - SNPRINTF( buffer, sizeof(buffer))
> - "%d-%02d-%02d-%02d:%02d:%02d.%03d",
> - tmptr->tm_year+1900, tmptr->tm_mon+1, tmptr->tm_mday,
> - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec,
> - (int)(tv.tv_usec/1000) );
Doesn't that change the output? shortform seems to be always 0, and you
make it return the shortform uncondionally.
Hochachtungsvoll,
Bernhard R. Link
P.S: something breaks whitespace in you patches before they arrive here.
Attaching the patches is likely to work much better.
|
|
From: walter h. <wh...@bf...> - 2007-06-07 19:10:41
|
hi list, while reviewing the patches from http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/LPRng-ngettext.patch?rev=1.1 i decided not to go this way. reason: translations are always very crude. imho it makes no sense to spend time to check all the different plural forms of the languages. Given the fact that some languages have very 'exotic' ideas about plural/gender etc. i feel this attempt will fail. If someone really need it he may choose something like "job(s)". re, wh |
|
From: walter h. <wh...@bf...> - 2007-06-07 19:00:58
|
hi all, I got carried away and forgot to add the textdomain stuff now added. this replace the first patch. I added the other header also. It is only for complettness. The rest is a list of variables and that make no sense to translate. re, wh --- lpf.c.org 2007-06-07 16:22:16.000000000 +0200 +++ lpf.c 2007-06-07 19:11:48.000000000 +0200 @@ -166,70 +166,49 @@ # endif #endif -char *Time_str(int shortform, time_t t); + +static char *lpf_time_str(int shortform, time_t t) +{ + static char buffer[99]; + struct tm *tmptr; + struct timeval tv={0,0}; + + + if ( gettimeofday( &tv, 0 ) == -1 ){ + logerr_die( "Time_str: gettimeofday failed"); + } + + tmptr = localtime( &tv.tv_sec ); + SNPRINTF( buffer, sizeof(buffer)) + "%02d:%02d:%02d.%03d", + tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, + (int)(tv.tv_usec/1000) ); + + return( buffer ); +} /* * default exit status, causes abort */ -int errorcode; -char *name; /* name of filter */ +static int errorcode; +static char *name; /* name of filter */ /* set from flags */ -int debug, width, length, xwidth, ylength, literal, indent; -char *zopts, *class, *job, *login, *accntname, *host, *accntfile, *format; -char *printer, *controlfile, *bnrname, *comment; -char *queuename, *errorfile; -int npages; /* number of pages */ -char *statusfile; -char filter_stop[] = "\031\001"; /* sent to cause filter to suspend */ -int accounting_fd; -int crlf; /* change lf to CRLF */ - -void getargs( int argc, char *argv[], char *envp[] ); -extern void banner( void ); -extern void doaccnt( void ); -extern void filter_pgm( char * ); -int of_filter; +static int debug, width, length, xwidth, ylength, literal, indent; +static char *zopts, *class, *job, *login, *accntname, *host, *accntfile, *format; +static char *printer, *controlfile, *bnrname, *comment; +static char *queuename, *errorfile; +static int npages; /* number of pages */ +static char *statusfile; +static char filter_stop[] = "\031\001"; /* sent to cause filter to suspend */ +static int accounting_fd; +static int crlf; /* change lf to CRLF */ + +static void getargs( int argc, char *argv[], char *envp[] ); +//extern void banner( void ); +//extern void doaccnt( void ); +//extern void filter_pgm( char * ); +static int of_filter; -int main( int argc, char *argv[], char *envp[] ) -{ - - /* check to see if you have the accounting fd */ - accounting_fd = dup(3); - /* if this works, then you have one */ - if( accounting_fd >= 0 ){ - (void)close( accounting_fd ); - accounting_fd = 3; - } else { - accounting_fd = -1; - } - if( fcntl(0,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 0\n"); - exit(2); - } - if( fcntl(1,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 1\n"); - exit(2); - } - if( fcntl(2,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 2\n"); - exit(2); - } - getargs( argc, argv, envp ); - /* - * Turn off SIGPIPE - */ - (void)signal( SIGPIPE, SIG_IGN ); - (void)signal( SIGINT, SIG_DFL ); - (void)signal( SIGHUP, SIG_DFL ); - (void)signal( SIGQUIT, SIG_DFL ); - (void)signal( SIGCHLD, SIG_DFL ); - if( of_filter || (format && format[0] == 'o') ){ - filter_pgm( filter_stop ); - } else { - filter_pgm( (char *)0 ); - } - return(0); -} static int Write_fd_str( int fd, const char *msg ) { @@ -238,6 +217,7 @@ return write(fd,msg,n); } + /* VARARGS2 */ #ifdef HAVE_STDARGS void safefprintf (int fd, char *format,...) @@ -261,6 +241,8 @@ Write_fd_str(fd,buf); } + + /**************************************************************************** * Extract the necessary definitions for error message reporting ****************************************************************************/ @@ -336,14 +318,14 @@ * writes the accounting information to the accounting file * This has the format: user host printer pages format date */ -void doaccnt(void) +static void doaccnt(void) { time_t t; char buffer[256]; FILE *f; int l, len, c; + // t = time((time_t *)0); - t = time((time_t *)0); SNPRINTF(buffer, sizeof(buffer)) "%s\t%s\t%s\t%7d\t%s\t%s\n", login? login: "NULL", @@ -351,7 +333,8 @@ printer? printer: "NULL", npages, format? format: "NULL", - Time_str(0,0)); + lpf_time_str(0,0)); + len = strlen( buffer ); if( accounting_fd < 0 ){ if(accntfile && (f = fopen(accntfile, "a" )) != NULL ) { @@ -383,7 +366,7 @@ of_filter = (strstr( s, "of" ) != 0); for( i = 1; i < argc && (arg = argv[i])[0] == '-'; ++i ){ if( (c = arg[1]) == 0 ){ - FPRINTF( STDERR, "missing option flag"); + FPRINTF( STDERR, _("missing option flag")); i = argc; break; } @@ -395,7 +378,7 @@ if( arg[2] == 0 ){ optargv = argv[i++]; if( optargv == 0 ){ - FPRINTF( STDERR, "missing option '%c' value", c ); + FPRINTF( STDERR,_( "missing option '%c' value"), c ); i = argc; break; } @@ -444,9 +427,9 @@ int fd; fd = open( errorfile, O_APPEND | O_WRONLY, 0600 ); if( fd < 0 ){ - FPRINTF( STDERR, "cannot open error log file '%s'", errorfile ); + FPRINTF( STDERR, _("cannot open error log file '%s'"), errorfile ); } else { - FPRINTF( STDERR, "using error log file '%s'", errorfile ); + FPRINTF( STDERR, _("using error log file '%s'"), errorfile ); if( fd != 2 ){ dup2(fd, 2 ); close(fd); @@ -461,7 +444,7 @@ FPRINTF( STDERR, "\n" ); } if( debug ){ - FPRINTF(STDERR, "FILTER decoded options: " ); + FPRINTF(STDERR,_("FILTER decoded options: ") ); FPRINTF(STDERR,"accntfile '%s'\n", accntfile? accntfile : "null" ); FPRINTF(STDERR,"accntname '%s'\n", accntname? accntname : "null" ); FPRINTF(STDERR,"class '%s'\n", class? class : "null" ); @@ -481,7 +464,7 @@ FPRINTF(STDERR,"ylength, %d\n", ylength); FPRINTF(STDERR,"zopts '%s'\n", zopts? zopts : "null" ); - FPRINTF(STDERR, "FILTER environment: " ); + FPRINTF(STDERR, _("FILTER environment: ") ); for( i = 0; (arg = envp[i]); ++i ){ FPRINTF(STDERR,"%s\n", arg ); } @@ -506,7 +489,7 @@ * if any. ******************************************/ -void filter_pgm(char *stop) +static void filter_pgm(char *stop) { int c; int state, i, xout, lastc; @@ -580,39 +563,49 @@ doaccnt(); } -/* - * Time_str: return "cleaned up" ctime() string... - * - * in YY/MO/DY/hr:mn:sc - * Thu Aug 4 12:34:17 BST 1994 -> 12:34:17 - */ -char *Time_str(int shortform, time_t t) +int main( int argc, char *argv[], char *envp[] ) { - static char buffer[99]; - struct tm *tmptr; - struct timeval tv; +#if defined (HAVE_LOCALE_H) + setlocale(LC_ALL, ""); + bindtextdomain (PACKAGE, LOCALEDIR); + textdomain (PACKAGE); +#endif - tv.tv_usec = 0; - if( t == 0 ){ - if( gettimeofday( &tv, 0 ) == -1 ){ - logerr_die( "Time_str: gettimeofday failed"); - } - t = tv.tv_sec; + /* check to see if you have the accounting fd */ + accounting_fd = dup(3); + /* if this works, then you have one */ + if( accounting_fd >= 0 ){ + (void)close( accounting_fd ); + accounting_fd = 3; + } else { + accounting_fd = -1; } - tmptr = localtime( &t ); - if( shortform ){ - SNPRINTF( buffer, sizeof(buffer)) - "%02d:%02d:%02d.%03d", - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, - (int)(tv.tv_usec/1000) ); + if( fcntl(0,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 0\n"); + exit(2); + } + if( fcntl(1,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 1\n"); + exit(2); + } + if( fcntl(2,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 2\n"); + exit(2); + } + getargs( argc, argv, envp ); + /* + * Turn off SIGPIPE + */ + (void)signal( SIGPIPE, SIG_IGN ); + (void)signal( SIGINT, SIG_DFL ); + (void)signal( SIGHUP, SIG_DFL ); + (void)signal( SIGQUIT, SIG_DFL ); + (void)signal( SIGCHLD, SIG_DFL ); + if( of_filter || (format && format[0] == 'o') ){ + filter_pgm( filter_stop ); } else { - SNPRINTF( buffer, sizeof(buffer)) - "%d-%02d-%02d-%02d:%02d:%02d.%03d", - tmptr->tm_year+1900, tmptr->tm_mon+1, tmptr->tm_mday, - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, - (int)(tv.tv_usec/1000) ); + filter_pgm( (char *)0 ); } - /* now format the time */ - return( buffer ); + return(0); } |
|
From: Bernhard R. L. <br...@de...> - 2007-06-07 17:50:17
|
* walter harms <wh...@bf...> [070607 18:21]:
> * added translation _()
As lpf is a program on it's own, _() alone will not
have any effect, unles it is also changed to initialize
all the nls stuff.
> @@ -481,7 +464,7 @@
> FPRINTF(STDERR,"ylength, %d\n", ylength);
> FPRINTF(STDERR,"zopts '%s'\n", zopts? zopts : "null" );
>
> - FPRINTF(STDERR, "FILTER environment: " );
> + FPRINTF(STDERR, _("FILTER environment: ") );
Why translating exactly that line? (While I think translating debug
output mostly means more work for translators without much gain,
translating the second heading of the output but not the first and
none of the content looks quite strange.)
Hochachtungsvoll,
Bernhard R. Link
|
|
From: walter h. <wh...@bf...> - 2007-06-07 17:12:57
|
hi list, in several place the lpd checks for socklen_t. is there any reason not to replace the #if-stuff with a sentence like: #if !defined(HAVE_SOCKLEN_T) typedef socklen_t int ; #endif it will be replace anyway with int in the error case. re, wh |
|
From: walter h. <wh...@bf...> - 2007-06-07 16:20:58
|
hi list, this is lpf.c * added translation _() * reorder functions * replace Time_str() the patch got a bit huge because of the reordering. it is compile tested. re, wh --- lpf.c.org 2007-06-07 16:22:16.000000000 +0200 +++ lpf.c 2007-06-07 16:30:43.000000000 +0200 @@ -166,70 +166,49 @@ # endif #endif -char *Time_str(int shortform, time_t t); + +static char *lpf_time_str(int shortform, time_t t) +{ + static char buffer[99]; + struct tm *tmptr; + struct timeval tv={0,0}; + + + if ( gettimeofday( &tv, 0 ) == -1 ){ + logerr_die( "Time_str: gettimeofday failed"); + } + + tmptr = localtime( &tv.tv_sec ); + SNPRINTF( buffer, sizeof(buffer)) + "%02d:%02d:%02d.%03d", + tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, + (int)(tv.tv_usec/1000) ); + + return( buffer ); +} /* * default exit status, causes abort */ -int errorcode; -char *name; /* name of filter */ +static int errorcode; +static char *name; /* name of filter */ /* set from flags */ -int debug, width, length, xwidth, ylength, literal, indent; -char *zopts, *class, *job, *login, *accntname, *host, *accntfile, *format; -char *printer, *controlfile, *bnrname, *comment; -char *queuename, *errorfile; -int npages; /* number of pages */ -char *statusfile; -char filter_stop[] = "\031\001"; /* sent to cause filter to suspend */ -int accounting_fd; -int crlf; /* change lf to CRLF */ - -void getargs( int argc, char *argv[], char *envp[] ); -extern void banner( void ); -extern void doaccnt( void ); -extern void filter_pgm( char * ); -int of_filter; +static int debug, width, length, xwidth, ylength, literal, indent; +static char *zopts, *class, *job, *login, *accntname, *host, *accntfile, *format; +static char *printer, *controlfile, *bnrname, *comment; +static char *queuename, *errorfile; +static int npages; /* number of pages */ +static char *statusfile; +static char filter_stop[] = "\031\001"; /* sent to cause filter to suspend */ +static int accounting_fd; +static int crlf; /* change lf to CRLF */ + +static void getargs( int argc, char *argv[], char *envp[] ); +//extern void banner( void ); +//extern void doaccnt( void ); +//extern void filter_pgm( char * ); +static int of_filter; -int main( int argc, char *argv[], char *envp[] ) -{ - - /* check to see if you have the accounting fd */ - accounting_fd = dup(3); - /* if this works, then you have one */ - if( accounting_fd >= 0 ){ - (void)close( accounting_fd ); - accounting_fd = 3; - } else { - accounting_fd = -1; - } - if( fcntl(0,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 0\n"); - exit(2); - } - if( fcntl(1,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 1\n"); - exit(2); - } - if( fcntl(2,F_GETFL,0) == -1 ){ - FPRINTF(STDERR,"BAD FD 2\n"); - exit(2); - } - getargs( argc, argv, envp ); - /* - * Turn off SIGPIPE - */ - (void)signal( SIGPIPE, SIG_IGN ); - (void)signal( SIGINT, SIG_DFL ); - (void)signal( SIGHUP, SIG_DFL ); - (void)signal( SIGQUIT, SIG_DFL ); - (void)signal( SIGCHLD, SIG_DFL ); - if( of_filter || (format && format[0] == 'o') ){ - filter_pgm( filter_stop ); - } else { - filter_pgm( (char *)0 ); - } - return(0); -} static int Write_fd_str( int fd, const char *msg ) { @@ -238,6 +217,7 @@ return write(fd,msg,n); } + /* VARARGS2 */ #ifdef HAVE_STDARGS void safefprintf (int fd, char *format,...) @@ -261,6 +241,8 @@ Write_fd_str(fd,buf); } + + /**************************************************************************** * Extract the necessary definitions for error message reporting ****************************************************************************/ @@ -336,14 +318,14 @@ * writes the accounting information to the accounting file * This has the format: user host printer pages format date */ -void doaccnt(void) +static void doaccnt(void) { time_t t; char buffer[256]; FILE *f; int l, len, c; + // t = time((time_t *)0); - t = time((time_t *)0); SNPRINTF(buffer, sizeof(buffer)) "%s\t%s\t%s\t%7d\t%s\t%s\n", login? login: "NULL", @@ -351,7 +333,8 @@ printer? printer: "NULL", npages, format? format: "NULL", - Time_str(0,0)); + lpf_time_str(0,0)); + len = strlen( buffer ); if( accounting_fd < 0 ){ if(accntfile && (f = fopen(accntfile, "a" )) != NULL ) { @@ -383,7 +366,7 @@ of_filter = (strstr( s, "of" ) != 0); for( i = 1; i < argc && (arg = argv[i])[0] == '-'; ++i ){ if( (c = arg[1]) == 0 ){ - FPRINTF( STDERR, "missing option flag"); + FPRINTF( STDERR, _("missing option flag")); i = argc; break; } @@ -395,7 +378,7 @@ if( arg[2] == 0 ){ optargv = argv[i++]; if( optargv == 0 ){ - FPRINTF( STDERR, "missing option '%c' value", c ); + FPRINTF( STDERR,_( "missing option '%c' value"), c ); i = argc; break; } @@ -444,9 +427,9 @@ int fd; fd = open( errorfile, O_APPEND | O_WRONLY, 0600 ); if( fd < 0 ){ - FPRINTF( STDERR, "cannot open error log file '%s'", errorfile ); + FPRINTF( STDERR, _("cannot open error log file '%s'"), errorfile ); } else { - FPRINTF( STDERR, "using error log file '%s'", errorfile ); + FPRINTF( STDERR, _("using error log file '%s'"), errorfile ); if( fd != 2 ){ dup2(fd, 2 ); close(fd); @@ -481,7 +464,7 @@ FPRINTF(STDERR,"ylength, %d\n", ylength); FPRINTF(STDERR,"zopts '%s'\n", zopts? zopts : "null" ); - FPRINTF(STDERR, "FILTER environment: " ); + FPRINTF(STDERR, _("FILTER environment: ") ); for( i = 0; (arg = envp[i]); ++i ){ FPRINTF(STDERR,"%s\n", arg ); } @@ -506,7 +489,7 @@ * if any. ******************************************/ -void filter_pgm(char *stop) +static void filter_pgm(char *stop) { int c; int state, i, xout, lastc; @@ -580,39 +563,44 @@ doaccnt(); } -/* - * Time_str: return "cleaned up" ctime() string... - * - * in YY/MO/DY/hr:mn:sc - * Thu Aug 4 12:34:17 BST 1994 -> 12:34:17 - */ -char *Time_str(int shortform, time_t t) +int main( int argc, char *argv[], char *envp[] ) { - static char buffer[99]; - struct tm *tmptr; - struct timeval tv; - tv.tv_usec = 0; - if( t == 0 ){ - if( gettimeofday( &tv, 0 ) == -1 ){ - logerr_die( "Time_str: gettimeofday failed"); - } - t = tv.tv_sec; + /* check to see if you have the accounting fd */ + accounting_fd = dup(3); + /* if this works, then you have one */ + if( accounting_fd >= 0 ){ + (void)close( accounting_fd ); + accounting_fd = 3; + } else { + accounting_fd = -1; } - tmptr = localtime( &t ); - if( shortform ){ - SNPRINTF( buffer, sizeof(buffer)) - "%02d:%02d:%02d.%03d", - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, - (int)(tv.tv_usec/1000) ); + if( fcntl(0,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 0\n"); + exit(2); + } + if( fcntl(1,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 1\n"); + exit(2); + } + if( fcntl(2,F_GETFL,0) == -1 ){ + FPRINTF(STDERR,"BAD FD 2\n"); + exit(2); + } + getargs( argc, argv, envp ); + /* + * Turn off SIGPIPE + */ + (void)signal( SIGPIPE, SIG_IGN ); + (void)signal( SIGINT, SIG_DFL ); + (void)signal( SIGHUP, SIG_DFL ); + (void)signal( SIGQUIT, SIG_DFL ); + (void)signal( SIGCHLD, SIG_DFL ); + if( of_filter || (format && format[0] == 'o') ){ + filter_pgm( filter_stop ); } else { - SNPRINTF( buffer, sizeof(buffer)) - "%d-%02d-%02d-%02d:%02d:%02d.%03d", - tmptr->tm_year+1900, tmptr->tm_mon+1, tmptr->tm_mday, - tmptr->tm_hour, tmptr->tm_min, tmptr->tm_sec, - (int)(tv.tv_usec/1000) ); + filter_pgm( (char *)0 ); } - /* now format the time */ - return( buffer ); + return(0); } |
|
From: walter h. <wh...@bf...> - 2007-06-07 15:35:44
|
as long as nobody can explain why an "\n" may need translation it is save to remove it. re, wh --- lpc.c.org 2007-06-07 15:46:04.000000000 +0200 +++ lpc.c 2007-06-07 15:46:55.000000000 +0200 @@ -309,7 +309,7 @@ Show_all_printcap_entries(); } else { Set_DYN(&Printer_DYN,args->list[argspos]); - if( Write_fd_str( 1,_("\n")) < 0 ) cleanup(0); + if( Write_fd_str( 1,"\n") < 0 ) cleanup(0); if( Write_fd_str( 1,_("# Printcap Information\n")) < 0 ) cleanup(0); Show_formatted_info(); } |
|
From: walter h. <wh...@bf...> - 2007-06-07 15:30:58
|
Based on the patch by Jakub Bogusz add _( ) re, wh --- debug.c.org 2007-06-07 15:20:46.000000000 +0200 +++ debug.c 2007-06-07 15:29:12.000000000 +0200 @@ -157,8 +157,8 @@ if(!found && interactive ){ int i; int lastflag = 0; - FPRINTF (STDERR, "debug flag format: num | flag[+num] | flag=str\n"); - FPRINTF (STDERR, " flag names:"); + FPRINTF (STDERR, _("debug flag format: num | flag[+num] | flag=str\n")); + FPRINTF (STDERR, _(" flag names:")); for (i = 0; list[i].keyword; i++) { if( safestrchr( list[i].keyword, '+' ) ) continue; if( lastflag ){ @@ -184,7 +184,7 @@ } FPRINTF (STDERR, "\n"); for(i = 0; guide[i]; ++i ){ - FPRINTF (STDERR, "%s\n", guide[i]); + FPRINTF (STDERR, "%s\n", _(guide[i])); } Errorcode = JABORT; |
|
From: walter h. <wh...@bf...> - 2007-06-07 15:30:42
|
Based on the patch by Jakub Bogusz add _( ) re, wh --- lpstat.c.org 2007-06-07 15:20:28.000000000 +0200 +++ lpstat.c 2007-06-07 15:26:35.000000000 +0200 @@ -139,7 +139,7 @@ Setup_configuration(); Get_parms(argc, argv ); /* scan input args */ if( A_flag && !getenv( "AUTH" ) ){ - FPRINTF(STDERR,"lpstat: requested authenticated transfer (-A) and AUTH environment variable not set"); + FPRINTF(STDERR,_("lpstat: requested authenticated transfer (-A) and AUTH environment variable not set")); usage(); } @@ -187,14 +187,14 @@ if(DEBUGL1)Dump_line_list("lpstat - options", &options); if( r_flag ){ - Write_fd_str(1,"scheduler is running\n"); + Write_fd_str(1,_("scheduler is running\n")); } if( d_flag ){ if( Printer_DYN == 0 ){ - Write_fd_str(1,"no system default destination\n"); + Write_fd_str(1,_("no system default destination\n")); } else { SNPRINTF(msg,sizeof(msg)) - "system default destination: %s\n", Printer_DYN); + _("system default destination: %s\n"), Printer_DYN); Write_fd_str(1,msg); } } @@ -202,7 +202,7 @@ for( i = 0; i < request_list.count; ++i ){ Set_DYN(&Printer_DYN,request_list.list[i] ); Fix_Rm_Rp_info(0,0); - SNPRINTF(msg,sizeof(msg)) "system for %s: %s\n", Printer_DYN, RemoteHost_DYN); + SNPRINTF(msg,sizeof(msg)) _("system for %s: %s\n"), Printer_DYN, RemoteHost_DYN); Write_fd_str(1,msg); } } @@ -246,7 +246,7 @@ if( Check_for_rg_group( Logname_DYN ) ){ SNPRINTF( msg, sizeof(msg)) - " Printer: %s - cannot use printer, not in privileged group\n", Printer_DYN ); + _(" Printer: %s - cannot use printer, not in privileged group\n"), Printer_DYN ); if( Write_fd_str( 1, msg ) < 0 ) cleanup(0); return; } @@ -384,25 +384,25 @@ if( a_flag ){ if( !nospool ){ SNPRINTF(msg,sizeof(msg)) - "%s accepting requests since %s\n", + _("%s accepting requests since %s\n"), Printer_DYN, Time_str(0,0) ); } else { SNPRINTF(msg,sizeof(msg)) - "%s not accepting requests since %s -\n\tunknown reason\n", + _("%s not accepting requests since %s -\n\tunknown reason\n"), Printer_DYN, Time_str(0,0) ); } if( Write_fd_str( output, msg ) < 0 ) return(1); } if( p_flag ){ SNPRINTF(msg,sizeof(msg)) - "printer %s unknown state. %s since %s. available\n", + _("printer %s unknown state. %s since %s. available\n"), Printer_DYN, noprint?"disabled":"enabled", Pretty_time(0)); if( Write_fd_str( output, msg ) < 0 ) return(1); } if( p_flag && D_flag ){ SNPRINTF(msg,sizeof(msg)) - "\tDescription: %s@%s\n", + _("\tDescription: %s@%s\n"), RemotePrinter_DYN, RemoteHost_DYN ); if( Write_fd_str( output, msg ) < 0 ) return(1); } |
|
From: walter h. <wh...@bf...> - 2007-06-07 15:29:19
|
this patch is questionable add _( ) re, wh --- lpd.c.org 2007-06-07 15:32:56.000000000 +0200 +++ lpd.c 2007-06-07 15:37:25.000000000 +0200 @@ -994,7 +994,7 @@ if( pid < 0 ){ LOGERR(LOG_INFO) _("lpd: fork() failed") ); if( lpd_socket ){ - Write_fd_str( newsock, "\002Server load too high\n"); + Write_fd_str( newsock, _("\002Server load too high\n")); } } else { DEBUG1( "lpd: listener pid %d running", pid ); |
|
From: walter h. <wh...@bf...> - 2007-06-07 15:27:56
|
Based on the patch from Jakub Bogusz add _( ) re, wh --- getopt.c.org 2007-06-07 15:21:36.000000000 +0200 +++ getopt.c 2007-06-07 15:27:40.000000000 +0200 @@ -86,7 +86,7 @@ if (option == '-') { if( *next_opt ){ if( Opterr ){ - (void) FPRINTF (STDERR, "--X option form illegal\n" ); + (void) FPRINTF (STDERR, _("--X option form illegal\n") ); return('?'); } } @@ -97,7 +97,7 @@ */ if ((match = (char *) safestrchr (optstring, option)) == 0 ){ if( Opterr ){ - (void) FPRINTF (STDERR, "%s: Illegal option '%c'\n", Name, option); + (void) FPRINTF (STDERR, _("%s: Illegal option '%c'\n"), Name, option); } return( '?' ); } @@ -119,7 +119,7 @@ } if( Optarg == 0 && Opterr ) { (void) FPRINTF (STDERR, - "%s: missing argument for '%c'\n", Name, option); + _("%s: missing argument for '%c'\n"), Name, option); option = '?'; } next_opt = 0; |
|
From: walter h. <wh...@bf...> - 2007-06-05 07:59:12
|
hi list, i looked into the gcc4 warnings that were posted on debian ML. IMHO they do not make sense. Either the code has changed that much or the warnings are bogus for RC3. re, wh |
|
From: walter h. <wh...@bf...> - 2007-06-05 07:41:33
|
hi, i have tested RC3 and it compiles nicely and much faster that before. the docs need some overhaul and monitor.c is strangely 755. NTL i will publish an announce of the new RC ASAP. re, wh Bernhard R. Link wrote: > I've just uploaded to current state of the cvs as LPRng-3.8.29-RC3.tar.gz. > Is there anything but updated translations left to do before a release? > > Hochachtungsvoll, > Bernhard R. Link > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Lprng-devel mailing list > Lpr...@li... > https://lists.sourceforge.net/lists/listinfo/lprng-devel > > |
|
From: walter h. <wh...@bf...> - 2007-06-03 15:35:55
|
hello everyone, i was very busy the last weeks but i have hope that some more time will be left for lprng now. hi bernhard, the link from the polish guy: http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/ has some more patches for lprng. btw. could you test the lprng-R3 on one of your sun stations ? craig, thx for the test, just for my understanding did you compile AND test ? big thanks to every one. I think we can release R3 now. Clearly it will be an intermediate so we have time to check out the polish stuff and look why gcc4.2 complains. I expect some minor fixes soon as people look for the impact of the translation (badly broken line etc. ) that will be addressed in RC4. Any objections ? re, walter Bernhard R. Link wrote: > I've just uploaded to current state of the cvs as LPRng-3.8.29-RC3.tar.gz. > Is there anything but updated translations left to do before a release? > > Hochachtungsvoll, > Bernhard R. Link > |
|
From: Craig S. <csm...@en...> - 2007-06-02 13:50:22
|
On Fri, Jun 01, 2007 at 03:41:58PM +0200, Bernhard R. Link wrote: > I've just uploaded to current state of the cvs as LPRng-3.8.29-RC3.tar.gz. > Is there anything but updated translations left to do before a release? I just test-compiled the CVS code on a s390 computer and it worked fine. Had a few problems on strange architecture like that before so that looks good. I think this bug has been solved through other means, but can you have a quick look at http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=361925 and see it is ok now? I tried compiling it on a amd64 device and it also compiled with GCC version 4.1.3 prerelease ok. It seems GCC v4.2 didnt like it. -- Craig Small GnuPG:1C1B D893 1418 2AF4 45EE 95CB C76C E5AC 12CA DFA5 http://www.enc.com.au/ csmall at : enc.com.au http://www.debian.org/ Debian GNU/Linux, software should be Free |
|
From: Bernhard R. L. <br...@de...> - 2007-06-01 13:42:06
|
I've just uploaded to current state of the cvs as LPRng-3.8.29-RC3.tar.gz. Is there anything but updated translations left to do before a release? Hochachtungsvoll, Bernhard R. Link |