Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit dab41ef

Browse files
[[ Bug 14057 ]] Revert lcidlc/include/LiveCode.h change to keep backwards-compatibility
1 parent 3db8633 commit dab41ef

File tree

3 files changed

+168
-20
lines changed

3 files changed

+168
-20
lines changed

engine/src/externalv1.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,19 @@ enum
109109
kMCExternalValueOptionAsUTF16String = 9,
110110
kMCExternalValueOptionAsUTF16CString = 10,
111111

112+
// SN-2015-01-19: [[ Bug 14057 ]] Update the enum to match
113+
// the ones declared in lcidlc/include/LiveCode.h
114+
// and lcidlc/src/Support.mm
112115
#ifdef __HAS_CORE_FOUNDATION__
113116
kMCExternalValueOptionAsNSNumber = 17,
114-
kMCExternalValueOptionAsCFNumber = 18,
115-
kMCExternalValueOptionAsNSString = 19,
116-
kMCExternalValueOptionAsCFString = 20,
117-
kMCExternalValueOptionAsNSData = 21,
118-
kMCExternalValueOptionAsCFData = 22,
119-
kMCExternalValueOptionAsNSArray = 23,
120-
kMCExternalValueOptionAsCFArray = 24,
121-
kMCExternalValueOptionAsNSDictionary = 25,
117+
kMCExternalValueOptionAsNSString = 18,
118+
kMCExternalValueOptionAsNSData = 19,
119+
kMCExternalValueOptionAsNSArray = 20,
120+
kMCExternalValueOptionAsNSDictionary = 21,
121+
kMCExternalValueOptionAsCFNumber = 22,
122+
kMCExternalValueOptionAsCFString = 23,
123+
kMCExternalValueOptionAsCFData = 24,
124+
kMCExternalValueOptionAsCFArray = 25,
122125
kMCExternalValueOptionAsCFDictionary = 26,
123126
#endif
124127
// V6-ADDITIONS-END

lcidlc/include/LiveCode.h

Lines changed: 110 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -355,23 +355,21 @@ enum
355355
// The 'value' parameter is a point to a uint16_t * variable (UTF-16 encoding)
356356
kLCValueOptionAsUTF16CString = 10,
357357

358-
// SN-2014-07-16: [[ ExternalsApiV6 ]] Enum updated to match
359-
// the enum declared in externalsv1.cpp in the Engine
360358
// The 'value' parameter is a pointer to an LCArrayRef variable.
361359
kLCValueOptionAsLCArray = 16,
362360
// The 'value' parameter is a pointer to an NSNumber* variable.
363361
kLCValueOptionAsObjcNumber = 17,
364362
// The 'value' parameter is a pointer to an NSString* variable.
365-
kLCValueOptionAsObjcString = 19,
363+
kLCValueOptionAsObjcString = 18,
366364
// The 'value' parameter is a pointer to an NSData* variable.
367-
kLCValueOptionAsObjcData = 21,
365+
kLCValueOptionAsObjcData = 19,
368366
// The 'value' parameter is a pointer to an NSArray* variable.
369-
kLCValueOptionAsObjcArray = 23,
367+
kLCValueOptionAsObjcArray = 20,
370368
// The 'value' parameter is a pointer to an NSDictionary *variable.
371-
kLCValueOptionAsObjcDictionary = 25,
369+
kLCValueOptionAsObjcDictionary = 21,
372370

373371
// The 'value' parameter is a pointer to a char variable (native encoding)
374-
kLCValueOptionAsCChar = 28,
372+
kLCValueOptionAsCChar = 22,
375373

376374
// Treat array keys as case-insensitive.
377375
kLCValueOptionCaseSensitiveFalse = 0 << 30,
@@ -884,6 +882,111 @@ LCError LCContextColumnDelimiter(unsigned int options, void *r_value);
884882
//
885883
LCError LCContextRowDelimiter(unsigned int options, void *r_value);
886884

885+
886+
// Function:
887+
// LCContextUnicodeItemDelimiter
888+
// Parameters:
889+
// (in) options - unsigned int
890+
// (out) value - depends on options
891+
// Errors:
892+
// OutOfMemory - memory ran out while attempting to perform the operation
893+
// NotABoolean - the value was requested as a boolean, and it is not a boolean
894+
// NotANumber - the value was requested as a number, and it is not a number
895+
// NotAnInteger - the value was requested as an integer, and it is not an
896+
// integer
897+
// NotABinaryString - the value was requested as binary data, and it is not
898+
// binary data
899+
// NotAString - the value was requested as a string, and it is not a string
900+
// NotAnArray - the value was requested as an array, and it is not an array
901+
// NotAChar - the value was requested as a char, and it is not a char
902+
// Context Safety:
903+
// Must be called from handler context.
904+
// This function will only work if the external is called by an engine post-7.0
905+
// and return NotImplemented for the earlier versions.
906+
// The returned value must be free'd by the caller of this function.
907+
// Semantics:
908+
// Returns a the current value of the local 'itemDelimiter' property.
909+
//
910+
LCError LCContextUnicodeItemDelimiter(unsigned int options, void *r_value);
911+
912+
// Function:
913+
// LCContextUnicodeLineDelimiter
914+
// Parameters:
915+
// (in) options - unsigned int
916+
// (out) value - depends on options
917+
// Errors:
918+
// OutOfMemory - memory ran out while attempting to perform the operation
919+
// NotABoolean - the value was requested as a boolean, and it is not a boolean
920+
// NotANumber - the value was requested as a number, and it is not a number
921+
// NotAnInteger - the value was requested as an integer, and it is not an
922+
// integer
923+
// NotABinaryString - the value was requested as binary data, and it is not
924+
// binary data
925+
// NotAString - the value was requested as a string, and it is not a string
926+
// NotAnArray - the value was requested as an array, and it is not an array
927+
// NotAChar - the value was requested as a char, and it is not a char
928+
// Context Safety:
929+
// Must be called from handler context.
930+
// This function will only work if the external is called by an engine post-7.0
931+
// and return NotImplemented for the earlier versions.
932+
// The returned value must be free'd by the caller of this function.
933+
// Semantics:
934+
// Returns a the current value of the local 'lineDelimiter' property.
935+
//
936+
LCError LCContextUnicodeLineDelimiter(unsigned int options, void *r_value);
937+
938+
// Function:
939+
// LCContextUnicodeColumnDelimiter
940+
// Parameters:
941+
// (in) options - unsigned int
942+
// (out) value - depends on options
943+
// Errors:
944+
// OutOfMemory - memory ran out while attempting to perform the operation
945+
// NotABoolean - the value was requested as a boolean, and it is not a boolean
946+
// NotANumber - the value was requested as a number, and it is not a number
947+
// NotAnInteger - the value was requested as an integer, and it is not an
948+
// integer
949+
// NotABinaryString - the value was requested as binary data, and it is not
950+
// binary data
951+
// NotAString - the value was requested as a string, and it is not a string
952+
// NotAnArray - the value was requested as an array, and it is not an array
953+
// NotAChar - the value was requested as a char, and it is not a char
954+
// Context Safety:
955+
// Must be called from handler context.
956+
// This function will only work if the external is called by an engine post-7.0
957+
// and return NotImplemented for the earlier versions.
958+
// The returned value must be free'd by the caller of this function.
959+
// Semantics:
960+
// Returns a the current value of the local 'columnDelimiter' property.
961+
//
962+
LCError LCContextColumnDelimiter(unsigned int options, void *r_value);
963+
964+
// Function:
965+
// LCContextUnicodeRowDelimiter
966+
// Parameters:
967+
// (in) options - unsigned int
968+
// (out) value - depends on options
969+
// Errors:
970+
// OutOfMemory - memory ran out while attempting to perform the operation
971+
// NotABoolean - the value was requested as a boolean, and it is not a boolean
972+
// NotANumber - the value was requested as a number, and it is not a number
973+
// NotAnInteger - the value was requested as an integer, and it is not an
974+
// integer
975+
// NotABinaryString - the value was requested as binary data, and it is not
976+
// binary data
977+
// NotAString - the value was requested as a string, and it is not a string
978+
// NotAnArray - the value was requested as an array, and it is not an array
979+
// NotAChar - the value was requested as a char, and it is not a char
980+
// Context Safety:
981+
// Must be called from handler context.
982+
// This function will only work if the external is called by an engine post-7.0
983+
// and return NotImplemented for the earlier versions.
984+
// The returned value must be free'd by the caller of this function.
985+
// Semantics:
986+
// Returns a the current value of the local 'rowDelimiter' property.
987+
//
988+
LCError LCContextRowDelimiter(unsigned int options, void *r_value);
989+
887990
// Function:
888991
// LCContextResult
889992
// Parameters:

lcidlc/src/Support.mm

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,13 @@
132132

133133
// SN-2014-07-16: [[ ExternalsApiV6 ]] Update the numbering of the enum
134134
// to match the enum in externalv1.cpp
135-
// (NS types and CF types are different: NS types are autoreleasing)
135+
// SN-2015-01-19: [[ Bug 14057 ]] Do not modify the enum in Support.mm,
136+
// to avoid breaking backward-compatibility.
136137
kMCOptionAsObjcNumber = 17,
137-
kMCOptionAsObjcString = 19,
138-
kMCOptionAsObjcData = 21,
139-
kMCOptionAsObjcArray = 23,
140-
kMCOptionAsObjcDictionary = 25,
138+
kMCOptionAsObjcString = 18,
139+
kMCOptionAsObjcData = 19,
140+
kMCOptionAsObjcArray = 20,
141+
kMCOptionAsObjcDictionary = 21,
141142

142143
kMCOptionNumberFormatDefault = 0 << 26,
143144
kMCOptionNumberFormatDecimal = 1 << 26,
@@ -204,6 +205,13 @@
204205
kMCExternalContextVarDefaultStack = 12,
205206
kMCExternalContextVarDefaultCard = 13,
206207
kMCExternalContextVarWholeMatches = 14,
208+
209+
// SN-2015-01-19: [[ Bug 14057 ]] Add the enum for the
210+
// unicode delimiters.
211+
kMCExternalContextVarUnicodeItemDelimiter = 15,
212+
kMCExternalContextVarUnicodeLineDelimiter = 16,
213+
kMCExternalContextVarUnicodeColumnDelimiter = 17,
214+
kMCExternalContextVarUnicodeRowDelimiter = 18,
207215
} MCExternalContextVar;
208216

209217
typedef enum MCExternalVariableQuery
@@ -1616,6 +1624,40 @@ LCError LCContextColumnDelimiter(unsigned int p_options, void *r_value)
16161624
{
16171625
return LCContextQueryDelimiter(kMCExternalContextVarColumnDelimiter, p_options, r_value);
16181626
}
1627+
1628+
// SN-2015-01-19: [[ Bug 14057 ]] Added Unicode, string delimiter-query to
1629+
// reflect the 7.0 update on the delimiters.
1630+
LCError LCContextUnicodeItemDelimiter(unsigned int p_options, void *r_value)
1631+
{
1632+
if (s_interface -> version < 6)
1633+
return kLCErrorNotImplemented;
1634+
else
1635+
return LCContextQueryDelimiter(kMCExternalContextVarUnicodeItemDelimiter, p_options, r_value);
1636+
}
1637+
1638+
LCError LCContextUnicodeLineDelimiter(unsigned int p_options, void *r_value)
1639+
{
1640+
if (s_interface -> version < 6)
1641+
return kLCErrorNotImplemented;
1642+
else
1643+
return LCContextQueryDelimiter(kMCExternalContextVarUnicodeLineDelimiter, p_options, r_value);
1644+
}
1645+
1646+
LCError LCContextUnicodeRowDelimiter(unsigned int p_options, void *r_value)
1647+
{
1648+
if (s_interface -> version < 6)
1649+
return kLCErrorNotImplemented;
1650+
else
1651+
return LCContextQueryDelimiter(kMCExternalContextVarUnicodeRowDelimiter, p_options, r_value);
1652+
}
1653+
1654+
LCError LCContextUnicodeColumnDelimiter(unsigned int p_options, void *r_value)
1655+
{
1656+
if (s_interface -> version < 6)
1657+
return kLCErrorNotImplemented;
1658+
else
1659+
return LCContextQueryDelimiter(kMCExternalContextVarUnicodeColumnDelimiter, p_options, r_value);
1660+
}
16191661

16201662
//////////
16211663

0 commit comments

Comments
 (0)