Skip to content

Commit

Permalink
Pushing reworked code using updated SimpleBuffer by @RhoSigma-QB64
Browse files Browse the repository at this point in the history
  • Loading branch information
a740g committed Sep 14, 2024
1 parent 27304c6 commit 11dca93
Show file tree
Hide file tree
Showing 4 changed files with 822 additions and 58 deletions.
10 changes: 6 additions & 4 deletions source/qb64pe.bas
Original file line number Diff line number Diff line change
Expand Up @@ -12597,6 +12597,7 @@ IF os$ = "WIN" THEN
IF n = 0 THEN 'attempt to locate simple function name without brackets
s$ = ResolveStaticFunction_Name(x)
fh = OpenBuffer%("I", nm_output_file$)
ConvBufToLnxMacEol fh
DO UNTIL EndOfBuf%(fh)
a$ = ReadBufLine$(fh)
IF LEN(a$) THEN
Expand All @@ -12605,9 +12606,9 @@ IF os$ = "WIN" THEN
IF OS_BITS = 32 THEN
' On 32-bit Windows function names are decorated by a leading underscore
' gcc's nm hides the leading underscore in the output, whereas clang's nm does not
x1 = RIGHT$(a$, LEN(s$) + 1) = " " + s$ _ORELSE INSTR(a$, " " + s$ + CHR$(10)) _ORELSE INSTR(a$, " _" + s$ + CHR$(10))
x1 = (RIGHT$(a$, LEN(s$) + 1) = " " + s$) _ORELSE (RIGHT$(a$, LEN(s$) + 2) = " _" + s$)
ELSE
x1 = RIGHT$(a$, LEN(s$) + 1) = " " + s$ _ORELSE INSTR(a$, " " + s$ + CHR$(10))
x1 = (RIGHT$(a$, LEN(s$) + 1) = " " + s$)
END IF
IF x1 THEN
fh2 = FREEFILE
Expand Down Expand Up @@ -12658,6 +12659,7 @@ IF os$ = "WIN" THEN
IF n = 0 THEN 'a C dynamic object library?
s$ = ResolveStaticFunction_Name(x)
fh = OpenBuffer%("I", nm_output_file_dynamic$)
ConvBufToLnxMacEol fh
DO UNTIL EndOfBuf%(fh)
a$ = ReadBufLine$(fh)
IF LEN(a$) THEN
Expand All @@ -12666,9 +12668,9 @@ IF os$ = "WIN" THEN
IF OS_BITS = 32 THEN
' On 32-bit Windows function names are decorated by a leading underscore
' gcc's nm hides the leading underscore in the output, whereas clang's nm does not
x1 = RIGHT$(a$, LEN(s$) + 1) = " " + s$ _ORELSE INSTR(a$, " " + s$ + CHR$(10)) _ORELSE INSTR(a$, " _" + s$ + CHR$(10))
x1 = (RIGHT$(a$, LEN(s$) + 1) = " " + s$) _ORELSE (RIGHT$(a$, LEN(s$) + 2) = " _" + s$)
ELSE
x1 = RIGHT$(a$, LEN(s$) + 1) = " " + s$ _ORELSE INSTR(a$, " " + s$ + CHR$(10))
x1 = (RIGHT$(a$, LEN(s$) + 1) = " " + s$)
END IF
IF x1 THEN
fh2 = FREEFILE
Expand Down
9 changes: 4 additions & 5 deletions source/utilities/s-buffer/readme.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
This is a massively reduced version of "The Simplebuffer System" library
by RhoSigma. The full package with many more functions for bookmarking,
searching, copy'n'paste and EOL conversion, inclusive documentation and
examples is part of the author's "Libraries Collection" and can be found
for download at the respective forum thread here:
This is the full fledged version of "The Simplebuffer System" library
by RhoSigma. The documentation and examples are part of the author's
"Libraries Collection" and can be found for download at the respective
forum thread here:
https://qb64phoenix.com/forum/forumdisplay.php?fid=23

Note: The sb_qb64_extension.bi/.bm files are not part of the buffer system.
Expand Down
29 changes: 28 additions & 1 deletion source/utilities/s-buffer/simplebuffer.bi
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,34 @@
'| ## ## # | ._.' |
'| ## ###### | Sources & Documents placed in the Public Domain. |
'+---------------+---------------------------------------------------+
'| |
'| === simplebuffer.bi === |
'| |
'| == Definitions required for the routines in simplebuffer.bm. |
'| |
'+-------------------------------------------------------------------+
'| Done by RhoSigma, R.Heyder, provided AS IS, use at your own risk. |
'| Find me in the QB64 Forum or mail to [email protected] for |
'| any questions or suggestions. Thanx for your interest in my work. |
'+-------------------------------------------------------------------+

'--- The internal array for data storage
'-----
'never access this directly, use functions in simplebuffer.bm
REDIM SHARED simplebuffer_array$(0 TO 10599) 'init for 100 buffers
REDIM SHARED simplebuffer_array$(0 TO 10599)

'--- Simplebuffer Errors (most FUNCTIONs)
'-----
'initializer error returns
CONST SBE_NoMoreBuffers = -1
CONST SBE_NoMoreIDs = -2
CONST SBE_EmptyFind = -3
'operational error returns
CONST SBE_UnknownMode = -11
CONST SBE_OutOfBounds = -12
CONST SBE_BadIDNumber = -13
CONST SBE_UnusedID = -14
CONST SBE_ClearedID = -15

'--- Simplebuffer Modes (SeekBuf) ---
'-----
Expand All @@ -28,6 +43,18 @@ CONST SBM_PosRestore = -21
CONST SBM_BufStart = -22
CONST SBM_BufCurrent = -23
CONST SBM_BufEnd = -24
CONST SBM_LineStart = -25
CONST SBM_LineEnd = -26

'--- Simplebuffer Flags (FindBufFwd/Rev) ---
'-----
'use for method% argument
CONST SBF_FullData = 0
CONST SBF_Delimiter = 1
CONST SBF_InvDelimiter = -1
'use for treat% argument
CONST SBF_AsWritten = 0
CONST SBF_IgnoreCase = -1

'$INCLUDE: 'sb_qb64pe_extension.bi'

Loading

0 comments on commit 11dca93

Please sign in to comment.