Mercurial > emacs
comparison src/strftime.c @ 109136:52fedf240c84
* strftime.c: Revert conversion to standard C (revno:100708).
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sun, 04 Jul 2010 22:42:36 +0200 |
parents | aec1143e8d85 |
children | a673d202fe46 |
comparison
equal
deleted
inserted
replaced
109135:370f2493de9e | 109136:52fedf240c84 |
---|---|
365 | 365 |
366 static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, | 366 static CHAR_T *memcpy_lowcase (CHAR_T *dest, const CHAR_T *src, |
367 size_t len LOCALE_PARAM_PROTO); | 367 size_t len LOCALE_PARAM_PROTO); |
368 | 368 |
369 static CHAR_T * | 369 static CHAR_T * |
370 memcpy_lowcase (char *dest, const char *src, size_t len) | 370 memcpy_lowcase (dest, src, len LOCALE_PARAM) |
371 CHAR_T *dest; | |
372 const CHAR_T *src; | |
373 size_t len; | |
374 LOCALE_PARAM_DECL | |
371 { | 375 { |
372 while (len-- > 0) | 376 while (len-- > 0) |
373 dest[len] = TOLOWER ((UCHAR_T) src[len], loc); | 377 dest[len] = TOLOWER ((UCHAR_T) src[len], loc); |
374 return dest; | 378 return dest; |
375 } | 379 } |
376 | 380 |
377 static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, | 381 static CHAR_T *memcpy_uppcase (CHAR_T *dest, const CHAR_T *src, |
378 size_t len LOCALE_PARAM_PROTO); | 382 size_t len LOCALE_PARAM_PROTO); |
379 | 383 |
380 static CHAR_T * | 384 static CHAR_T * |
381 memcpy_uppcase (char *dest, const char *src, size_t len) | 385 memcpy_uppcase (dest, src, len LOCALE_PARAM) |
386 CHAR_T *dest; | |
387 const CHAR_T *src; | |
388 size_t len; | |
389 LOCALE_PARAM_DECL | |
382 { | 390 { |
383 while (len-- > 0) | 391 while (len-- > 0) |
384 dest[len] = TOUPPER ((UCHAR_T) src[len], loc); | 392 dest[len] = TOUPPER ((UCHAR_T) src[len], loc); |
385 return dest; | 393 return dest; |
386 } | 394 } |
427 static int iso_week_days (int, int); | 435 static int iso_week_days (int, int); |
428 #ifdef __GNUC__ | 436 #ifdef __GNUC__ |
429 __inline__ | 437 __inline__ |
430 #endif | 438 #endif |
431 static int | 439 static int |
432 iso_week_days (int yday, int wday) | 440 iso_week_days (yday, wday) |
441 int yday; | |
442 int wday; | |
433 { | 443 { |
434 /* Add enough to the first operand of % to make it nonnegative. */ | 444 /* Add enough to the first operand of % to make it nonnegative. */ |
435 int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; | 445 int big_enough_multiple_of_7 = (-YDAY_MINIMUM / 7 + 2) * 7; |
436 return (yday | 446 return (yday |
437 - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 | 447 - (yday - wday + ISO_WEEK1_WDAY + big_enough_multiple_of_7) % 7 |
1462 #ifdef emacs | 1472 #ifdef emacs |
1463 #undef ut | 1473 #undef ut |
1464 /* For Emacs we have a separate interface which corresponds to the normal | 1474 /* For Emacs we have a separate interface which corresponds to the normal |
1465 strftime function plus the ut argument, but without the ns argument. */ | 1475 strftime function plus the ut argument, but without the ns argument. */ |
1466 size_t | 1476 size_t |
1467 emacs_strftimeu (char *s, size_t maxsize, const char *format, const struct tm *tp, int ut) | 1477 emacs_strftimeu (s, maxsize, format, tp, ut) |
1478 char *s; | |
1479 size_t maxsize; | |
1480 const char *format; | |
1481 const struct tm *tp; | |
1482 int ut; | |
1468 { | 1483 { |
1469 return my_strftime (s, maxsize, format, tp, ut, 0); | 1484 return my_strftime (s, maxsize, format, tp, ut, 0); |
1470 } | 1485 } |
1471 #endif | 1486 #endif |
1472 | 1487 |