mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Minor tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14616 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4282a396bb
commit
cb5aa8f8c6
3 changed files with 19 additions and 9 deletions
|
@ -81,14 +81,6 @@
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
// Maximum data in single I/O operation
|
|
||||||
#define NETBUF_SIZE 4096
|
|
||||||
|
|
||||||
// Key to info dictionary for operation mode.
|
|
||||||
static NSString* NotificationKey = @"NSFileHandleNotificationKey";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@interface GSSSLHandle : GSFileHandle <GCFinalization>
|
@interface GSSSLHandle : GSFileHandle <GCFinalization>
|
||||||
{
|
{
|
||||||
SSL_CTX *ctx;
|
SSL_CTX *ctx;
|
||||||
|
|
|
@ -1369,7 +1369,11 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
return y;
|
return y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Providing Adjusted Dates
|
/**
|
||||||
|
* This method exists solely for conformance to the OpenStep spec.
|
||||||
|
* Its use is deprecated ... it simply calls
|
||||||
|
* -dateByAddingYears:months:days:hours:minutes:seconds:
|
||||||
|
*/
|
||||||
- (NSCalendarDate*) addYear: (int)year
|
- (NSCalendarDate*) addYear: (int)year
|
||||||
month: (int)month
|
month: (int)month
|
||||||
day: (int)day
|
day: (int)day
|
||||||
|
@ -1770,6 +1774,16 @@ static inline int getDigits(const char *from, char *to, int limit)
|
||||||
|
|
||||||
@implementation NSCalendarDate (OPENSTEP)
|
@implementation NSCalendarDate (OPENSTEP)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>Returns a calendar date formed by adding the specified offsets to the
|
||||||
|
* receiver. The offsets are added in order, years, then months, then
|
||||||
|
* days, then hours then minutes then seconds, so if you add 1 month and
|
||||||
|
* forty days to 20th September, the result will be 9th November.
|
||||||
|
* </p>
|
||||||
|
* <p>This method understands leap years and tries to adjust for daylight
|
||||||
|
* savings time changes so that it preserves expected clock time.
|
||||||
|
* </p>
|
||||||
|
*/
|
||||||
- (NSCalendarDate*) dateByAddingYears: (int)years
|
- (NSCalendarDate*) dateByAddingYears: (int)years
|
||||||
months: (int)months
|
months: (int)months
|
||||||
days: (int)days
|
days: (int)days
|
||||||
|
|
|
@ -237,6 +237,10 @@ if ([(NSDate*) [NSCalendarDate date] compare:
|
||||||
printf("Add four hours - %s\n", [DESCRIP_FORMAT(c) cString]);
|
printf("Add four hours - %s\n", [DESCRIP_FORMAT(c) cString]);
|
||||||
c = [c addYear:0 month:0 day:0 hour:-24 minute:0 second:0];
|
c = [c addYear:0 month:0 day:0 hour:-24 minute:0 second:0];
|
||||||
printf("Subtract twentyfour hours - %s\n", [DESCRIP_FORMAT(c) cString]);
|
printf("Subtract twentyfour hours - %s\n", [DESCRIP_FORMAT(c) cString]);
|
||||||
|
c = [c addYear:0 month:0 day:0 hour:24 minute:0 second:0];
|
||||||
|
printf("Add twentyfour hours - %s\n", [DESCRIP_FORMAT(c) cString]);
|
||||||
|
c = [c addYear:0 month:0 day:-1 hour:0 minute:0 second:0];
|
||||||
|
printf("Subtract a day - %s\n", [DESCRIP_FORMAT(c) cString]);
|
||||||
|
|
||||||
c = [NSCalendarDate dateWithString: @"2002-10-27 00:30:00 GB"
|
c = [NSCalendarDate dateWithString: @"2002-10-27 00:30:00 GB"
|
||||||
calendarFormat: @"%Y-%m-%d %H:%M:%S %Z"];
|
calendarFormat: @"%Y-%m-%d %H:%M:%S %Z"];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue