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

Commit 090000f

Browse files
committed
libfoundation: Synchronise with MLC branch.
1 parent bd2b751 commit 090000f

24 files changed

+5117
-160
lines changed

libfoundation/include/foundation-auto.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ typedef MCAutoValueRefBase<MCBooleanRef> MCAutoBooleanRef;
7070
typedef MCAutoValueRefBase<MCSetRef> MCAutoSetRef;
7171
typedef MCAutoValueRefBase<MCNameRef> MCNewAutoNameRef;
7272
typedef MCAutoValueRefBase<MCDataRef> MCAutoDataRef;
73+
typedef MCAutoValueRefBase<MCProperListRef> MCAutoProperListRef;
7374
typedef MCAutoValueRefBase<MCTypeInfoRef> MCAutoTypeInfoRef;
7475
typedef MCAutoValueRefBase<MCRecordRef> MCAutoRecordRef;
7576

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/* Copyright (C) 2003-2013 Runtime Revolution Ltd.
2+
3+
This file is part of LiveCode.
4+
5+
LiveCode is free software; you can redistribute it and/or modify it under
6+
the terms of the GNU General Public License v3 as published by the Free
7+
Software Foundation.
8+
9+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
10+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
16+
17+
#ifndef __MC_FOUNDATION_CHUNK__
18+
#define __MC_FOUNDATION_CHUNK__
19+
20+
#include "foundation.h"
21+
22+
typedef uinteger_t (MCChunkCountCallback(void *context));
23+
24+
uinteger_t MCChunkCountByteChunkCallback(void *context);
25+
uinteger_t MCChunkCountCodepointChunkCallback(void *context);
26+
27+
void MCChunkGetExtentsByRange(integer_t p_first, integer_t p_last, MCChunkCountCallback p_callback, void *p_context, uindex_t& r_first, uindex_t& r_chunk_count);
28+
29+
void MCChunkGetExtentsByExpression(integer_t p_first, MCChunkCountCallback p_callback, void *p_context, uindex_t& r_first, uindex_t& r_chunk_count);
30+
31+
void MCChunkGetExtentsOfByteChunkByRange(MCDataRef p_data, integer_t p_first, integer_t p_last, uindex_t& r_first, uindex_t& r_chunk_count);
32+
void MCChunkGetExtentsOfByteChunkByExpression(MCDataRef p_data, integer_t p_first, uindex_t& r_first, uindex_t& r_chunk_count);
33+
34+
void MCChunkGetExtentsOfCodepointChunkByRange(MCStringRef p_data, integer_t p_first, integer_t p_last, uindex_t& r_first, uindex_t& r_chunk_count);
35+
void MCChunkGetExtentsOfCodepointChunkByExpression(MCStringRef p_data, integer_t p_first, uindex_t& r_first, uindex_t& r_chunk_count);
36+
37+
void MCChunkGetExtentsOfElementChunkByRange(MCProperListRef p_string, integer_t p_first, integer_t p_last, uindex_t& r_first, uindex_t& r_chunk_count);
38+
void MCChunkGetExtentsOfElementChunkByExpression(MCProperListRef p_string, integer_t p_first, uindex_t& r_first, uindex_t& r_chunk_count);
39+
40+
#endif // __MC_FOUNDATION_CHUNK__
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Copyright (C) 2003-2013 Runtime Revolution Ltd.
2+
3+
This file is part of LiveCode.
4+
5+
LiveCode is free software; you can redistribute it and/or modify it under
6+
the terms of the GNU General Public License v3 as published by the Free
7+
Software Foundation.
8+
9+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
10+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
16+
17+
#ifndef __MC_FOUNDATION_FILTERS__
18+
#define __MC_FOUNDATION_FILTERS__
19+
20+
#ifndef __MC_FOUNDATION__
21+
#include <foundation.h>
22+
#endif
23+
24+
////////////////////////////////////////////////////////////////////////////////
25+
26+
bool MCFiltersBase64Decode(MCStringRef p_src, MCDataRef& r_dst);
27+
bool MCFiltersBase64Encode(MCDataRef p_src, MCStringRef& r_dst);
28+
bool MCFiltersCompress(MCDataRef p_source, MCDataRef& r_result);
29+
bool MCFiltersIsCompressed(MCDataRef p_source);
30+
bool MCFiltersDecompress(MCDataRef p_source, MCDataRef& r_result);
31+
bool MCFiltersIsoToMac(MCDataRef p_source, MCDataRef &r_result);
32+
bool MCFiltersMacToIso(MCDataRef p_source, MCDataRef &r_result);
33+
bool MCFiltersUrlEncode(MCStringRef p_source, MCStringRef& r_result);
34+
bool MCFiltersUrlDecode(MCStringRef p_source, MCStringRef& r_result);
35+
36+
////////////////////////////////////////////////////////////////////////////////
37+
38+
#endif
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/* Copyright (C) 2003-2013 Runtime Revolution Ltd.
2+
3+
This file is part of LiveCode.
4+
5+
LiveCode is free software; you can redistribute it and/or modify it under
6+
the terms of the GNU General Public License v3 as published by the Free
7+
Software Foundation.
8+
9+
LiveCode is distributed in the hope that it will be useful, but WITHOUT ANY
10+
WARRANTY; without even the implied warranty of MERCHANTABILITY or
11+
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12+
for more details.
13+
14+
You should have received a copy of the GNU General Public License
15+
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */
16+
17+
#ifndef __MC_FOUNDATION_MATH__
18+
#define __MC_FOUNDATION_MATH__
19+
20+
#ifndef __MC_FOUNDATION__
21+
#include <foundation.h>
22+
#endif
23+
24+
////////////////////////////////////////////////////////////////////////////////
25+
26+
void MCMathRandomSeed();
27+
real64_t MCMathRandom();
28+
29+
// Convert from base 10 to a string in the desired base. Destination base should be between 2 and 32 inclusive.
30+
bool MCMathConvertFromBase10(uint32_t p_value, bool p_negative, integer_t p_dest_base, MCStringRef& r_result);
31+
32+
// Convert from string in the specified base to base 10. Source base should be between 2 and 32 inclusive.
33+
// error is true if there were characters in the string outside the source base.
34+
bool MCMathConvertToBase10(MCStringRef p_source, integer_t p_source_base, bool& r_negative, uinteger_t& r_result, bool& r_error);
35+
36+
////////////////////////////////////////////////////////////////////////////////
37+
38+
#endif

0 commit comments

Comments
 (0)