Skip to content

Commit

Permalink
Merge pull request #440 from gnustep/agsdoc-html-style
Browse files Browse the repository at this point in the history
Agsdoc html style update
  • Loading branch information
rfm authored Nov 8, 2024
2 parents 75fe3d2 + 4961287 commit a8e453f
Show file tree
Hide file tree
Showing 12 changed files with 512 additions and 121 deletions.
14 changes: 11 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2024-11-08 Richard Frith-Macdonald <[email protected]>

* Headers/Foundation/NSFileHandle.h:
* Source/GSFileHandle.m:
* Source/NSFileHandle.m:
Add -truncateAtOffset:error: method (issue 325)

2024-11-03 Richard Frith-Macdonald <[email protected]>

* Source/NSFileManager.m: Fix case where positive result of asking
Expand Down Expand Up @@ -31,9 +38,10 @@
* Source/NSDatePrivate.h:
NSDate is now a small object in slot 6, when configuring GNUstep with the
clang/libobjc2 toolchain. This is done by compressing the binary64 fp
holding the seconds since reference date (because someone at Apple thought
it would be a good idea to represent a time interval as a fp). Note that
this assumes that IEEE 754 is used.
holding the seconds since reference date (because someone at Apple
thought it would be a good idea to represent a time interval as a fp).
Note that this assumes that IEEE 754 is used.

* Source/NSCalendarDate.m:
Remove access to the NSDate private concrete Class
and implement -timeIntervalSinceReferenceDate instead.
Expand Down
5 changes: 5 additions & 0 deletions Headers/Foundation/NSFileHandle.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ GS_EXPORT_CLASS
- (void) synchronizeFile;
- (void) truncateFileAtOffset: (unsigned long long)pos;

#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
- (BOOL) truncateAtOffset: (unsigned long long)offset
error: (out NSError **)error;
#endif

@end

// Notification names.
Expand Down
7 changes: 4 additions & 3 deletions Source/DocMakefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ GCObject.h \
# directory.
#
Base_AGSDOC_FLAGS = \
-MakeFrames YES \
-MakeFrames NO \
-IndexFile Base \
-DocumentationDirectory ../Documentation/Base \
-HeaderDirectory ../Headers/Foundation \
-Declared Foundation \
Expand All @@ -252,14 +253,14 @@ Base_AGSDOC_FLAGS = \
-ConstantsTemplate TypesAndConstants \
-FunctionsTemplate Functions \
-MacrosTemplate Functions \
-StylesheetURL gnustepStyle \
-TypedefsTemplate TypesAndConstants \
-VariablesTemplate TypesAndConstants \
-WordMap '{\
}' -Up Base

BaseAdditions_AGSDOC_FLAGS = \
-MakeFrames YES \
-MakeFrames NO \
-IndexFile BaseAdditions \
-DocumentationDirectory ../Documentation/BaseAdditions \
-HeaderDirectory ../Headers/GNUstepBase \
-Declared GNUstepBase \
Expand Down
16 changes: 15 additions & 1 deletion Source/GSFileHandle.m
Original file line number Diff line number Diff line change
Expand Up @@ -1722,7 +1722,6 @@ - (void) truncateFileAtOffset: (unsigned long long)pos
{
[NSException raise: NSFileHandleOperationException
format: @"attempt to truncate invalid file"];

}
if (ftruncate(descriptor, pos) < 0)
{
Expand All @@ -1732,6 +1731,21 @@ - (void) truncateFileAtOffset: (unsigned long long)pos
[self seekToFileOffset: pos];
}

- (BOOL) truncateAtOffset: (unsigned long long)offset
error: (out NSError **)error
{
if (ftruncate((isStandardFile ? descriptor : -1), offset) < 0)
{
if (error)
{
*error = [NSError _last];
}
return NO;
}
[self seekToFileOffset: offset];
return YES;
}

- (void) writeInBackgroundAndNotify: (NSData*)item forModes: (NSArray*)modes
{
NSMutableDictionary* info;
Expand Down
6 changes: 6 additions & 0 deletions Source/NSFileHandle.m
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,12 @@ - (void) truncateFileAtOffset: (unsigned long long)pos
[self subclassResponsibility: _cmd];
}

- (BOOL) truncateAtOffset: (unsigned long long)offset
error: (out NSError **)error
{
[self subclassResponsibility: _cmd];
return NO;
}

@end

Expand Down
4 changes: 4 additions & 0 deletions Tools/AGSHtml.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
unsigned sssect;
BOOL isContentsDoc;
BOOL ivarsAtEnd;
BOOL cssNavigation;
BOOL verbose;
BOOL warn;
}
Expand All @@ -61,6 +62,9 @@
- (NSString*) makeLink: (NSString*)r
ofType: (NSString*)t
isRef: (BOOL)f;
- (NSString*) makeURL: (NSString*)r
ofType: (NSString*)t
isRef: (BOOL)f;
- (NSString*) makeLink: (NSString*)r
ofType: (NSString*)t
inUnit: (NSString*)u
Expand Down
Loading

0 comments on commit a8e453f

Please sign in to comment.