Skip to content

Commit 52a1c77

Browse files
committed
[[ Script ]] Tweak naming of some libscript functions
This patch renames some of the libscript functions to have more appropriate names. Specifically: . MCScriptListDependencyNamesOfModule . MCScriptListConstantNamesOfModule . MCScriptListPropertyNamesOfModule . MCScriptListEventNamesOfModule . MCScriptListHandlerNamesOfModule . MCScriptListHandlerParameterNamesOfModule . MCScriptGetPropertyInInstance . MCScriptSetPropertyInInstance . MCScriptCallHandlerInInstance . MCScriptCallHandlerInInstanceIfFound . MCScriptEvaluateHandlerBindingInInstance
1 parent 2a3d91f commit 52a1c77

6 files changed

Lines changed: 31 additions & 31 deletions

File tree

engine/src/exec-extension.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static void __rebuild_library_handler_list(void)
7979
if (MCScriptIsModuleALibrary(t_ext -> module))
8080
{
8181
MCAutoProperListRef t_handlers;
82-
MCScriptCopyHandlersOfModule(t_ext -> module, &t_handlers);
82+
MCScriptListHandlerNamesOfModule(t_ext -> module, &t_handlers);
8383
for(uindex_t i = 0; i < MCProperListGetLength(*t_handlers); i++)
8484
{
8585
MCNameRef t_name;
@@ -411,7 +411,7 @@ Exec_stat MCEngineHandleLibraryMessage(MCNameRef p_message, MCParameter *p_param
411411
MCValueRef t_result;
412412
t_result = nil;
413413
if (t_success &&
414-
MCScriptCallHandlerOfInstance(t_ext -> instance, p_message, t_arguments . Ptr(), t_arguments . Size(), t_result))
414+
MCScriptCallHandlerInInstance(t_ext -> instance, p_message, t_arguments . Ptr(), t_arguments . Size(), t_result))
415415
{
416416
t_param = p_parameters;
417417
for(uindex_t i = 0; i < t_arg_count && t_success; i++)

engine/src/widget-ref.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ bool MCWidgetBase::SetProperty(MCNameRef p_property, MCValueRef p_value)
163163
t_host -> lockforexecution();
164164

165165
bool t_success;
166-
t_success = MCScriptSetPropertyOfInstance(m_instance, p_property, p_value);
166+
t_success = MCScriptSetPropertyInInstance(m_instance, p_property, p_value);
167167

168168
if (t_host != nil)
169169
t_host -> unlockforexecution();
@@ -185,7 +185,7 @@ bool MCWidgetBase::GetProperty(MCNameRef p_property, MCValueRef& r_value)
185185
t_host -> lockforexecution();
186186

187187
bool t_success;
188-
t_success = MCScriptGetPropertyOfInstance(m_instance, p_property, r_value);
188+
t_success = MCScriptGetPropertyInInstance(m_instance, p_property, r_value);
189189

190190
if (t_host != nil)
191191
t_host -> unlockforexecution();
@@ -863,7 +863,7 @@ bool MCWidgetBase::DoDispatch(MCNameRef p_event, MCValueRef *x_args, uindex_t p_
863863

864864
bool t_success;
865865
MCAutoValueRef t_retval;
866-
t_success = MCScriptCallHandlerOfInstanceIfFound(m_instance, p_event, x_args, p_arg_count, &t_retval);
866+
t_success = MCScriptCallHandlerInInstanceIfFound(m_instance, p_event, x_args, p_arg_count, &t_retval);
867867

868868
if (t_host != nil)
869869
t_host -> unlockforexecution();

libscript/include/libscript/script.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -180,38 +180,38 @@ bool MCScriptIsModuleALibrary(MCScriptModuleRef module);
180180
// Returns true if the module is a widget.
181181
bool MCScriptIsModuleAWidget(MCScriptModuleRef module);
182182

183+
// List the module's direct dependencies.
184+
bool MCScriptListDependencyNamesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_module_names);
185+
183186
// Returns a list of the constants defined by the module.
184-
bool MCScriptCopyConstantsOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_constant_names);
187+
bool MCScriptListConstantNamesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_constant_names);
185188

186189
// Queries the value of the given constant.
187190
bool MCScriptQueryConstantOfModule(MCScriptModuleRef module, MCNameRef name, /* get */ MCValueRef& r_constant_value);
188191

189-
// List the module's direct dependencies.
190-
bool MCScriptCopyDependenciesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_module_names);
191-
192192
// Returns a list of properties implemented by the module.
193-
bool MCScriptCopyPropertiesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_property_names);
193+
bool MCScriptListPropertyNamesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_property_names);
194194

195195
// Queries the type of the given property. If the setting type is nil, then the property
196196
// is read-only.
197197
bool MCScriptQueryPropertyOfModule(MCScriptModuleRef module, MCNameRef property, /* get */ MCTypeInfoRef& r_getter, /* get */ MCTypeInfoRef& r_setter);
198198

199199
// Returns a list of the events declared by the module.
200-
bool MCScriptCopyEventsOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_event_names);
200+
bool MCScriptListEventNamesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_event_names);
201201

202202
// Query the signature of the given event.
203203
bool MCScriptQueryEventOfModule(MCScriptModuleRef module, MCNameRef event, /* get */ MCTypeInfoRef& r_signature);
204204

205205
// Returns a list of the handlers declared by the module.
206-
bool MCScriptCopyHandlersOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_handler_names);
206+
bool MCScriptListHandlerNamesOfModule(MCScriptModuleRef module, /* copy */ MCProperListRef& r_handler_names);
207207

208208
// Query the signature of the given handler.
209209
bool MCScriptQueryHandlerSignatureOfModule(MCScriptModuleRef module, MCNameRef handler, /* get */ MCTypeInfoRef& r_signature);
210210

211211
// Copy the names of the parameters in the signature of the given handler.
212212
// Note: If the module has had debugging info stripped, the list will be all
213213
// empty names.
214-
bool MCScriptCopyHandlerParametersOfModule(MCScriptModuleRef module, MCNameRef handler, /* copy */ MCProperListRef& r_names);
214+
bool MCScriptListHandlerParameterNamesOfModule(MCScriptModuleRef module, MCNameRef handler, /* copy */ MCProperListRef& r_names);
215215

216216
// Emit an interface definition for the module.
217217
bool MCScriptWriteInterfaceOfModule(MCScriptModuleRef module, MCStreamRef stream);
@@ -246,18 +246,18 @@ void MCScriptReleaseInstance(MCScriptInstanceRef instance);
246246
MCScriptModuleRef MCScriptGetModuleOfInstance(MCScriptInstanceRef instance);
247247

248248
// Get a property of an instance.
249-
bool MCScriptGetPropertyOfInstance(MCScriptInstanceRef instance, MCNameRef property, MCValueRef& r_value);
249+
bool MCScriptGetPropertyInInstance(MCScriptInstanceRef instance, MCNameRef property, MCValueRef& r_value);
250250
// Set a property of an instance.
251-
bool MCScriptSetPropertyOfInstance(MCScriptInstanceRef instance, MCNameRef property, MCValueRef value);
251+
bool MCScriptSetPropertyInInstance(MCScriptInstanceRef instance, MCNameRef property, MCValueRef value);
252252

253253
// Call a handler of an instance.
254-
bool MCScriptCallHandlerOfInstance(MCScriptInstanceRef instance, MCNameRef handler, MCValueRef *arguments, uindex_t argument_count, MCValueRef& r_value);
254+
bool MCScriptCallHandlerInInstance(MCScriptInstanceRef instance, MCNameRef handler, MCValueRef *arguments, uindex_t argument_count, MCValueRef& r_value);
255255

256256
// Call a handler of an instance if found, it doesn't throw an error if not.
257-
bool MCScriptCallHandlerOfInstanceIfFound(MCScriptInstanceRef instance, MCNameRef handler, MCValueRef *arguments, uindex_t argument_count, MCValueRef& r_value);
257+
bool MCScriptCallHandlerInInstanceIfFound(MCScriptInstanceRef instance, MCNameRef handler, MCValueRef *arguments, uindex_t argument_count, MCValueRef& r_value);
258258

259259
// Create a handler-ref for the given handler in the instance.
260-
bool MCScriptCopyHandlerOfInstance(MCScriptInstanceRef instance, MCNameRef handler, /* copy */ MCHandlerRef& r_handler);
260+
bool MCScriptEvaluateHandlerBindingInInstance(MCScriptInstanceRef instance, MCNameRef handler, /* copy */ MCHandlerRef& r_handler);
261261

262262
////////////////////////////////////////////////////////////////////////////////
263263

libscript/src/script-instance.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ void MCScriptResolveDefinitionInInstance(MCScriptInstanceRef self,
600600
}
601601
////////////////////////////////////////////////////////////////////////////////
602602

603-
bool MCScriptGetPropertyOfInstance(MCScriptInstanceRef self, MCNameRef p_property, MCValueRef& r_value)
603+
bool MCScriptGetPropertyInInstance(MCScriptInstanceRef self, MCNameRef p_property, MCValueRef& r_value)
604604
{
605605
__MCScriptValidateObjectAndKind__(self, kMCScriptObjectKindInstance);
606606

@@ -655,7 +655,7 @@ bool MCScriptGetPropertyOfInstance(MCScriptInstanceRef self, MCNameRef p_propert
655655
return true;
656656
}
657657

658-
bool MCScriptSetPropertyOfInstance(MCScriptInstanceRef self, MCNameRef p_property, MCValueRef p_value)
658+
bool MCScriptSetPropertyInInstance(MCScriptInstanceRef self, MCNameRef p_property, MCValueRef p_value)
659659
{
660660
__MCScriptValidateObjectAndKind__(self, kMCScriptObjectKindInstance);
661661

@@ -770,7 +770,7 @@ static bool MCScriptCallHandlerOfInstanceDirect(MCScriptInstanceRef self, MCScri
770770
return true;
771771
}
772772

773-
bool MCScriptCallHandlerOfInstance(MCScriptInstanceRef self, MCNameRef p_handler, MCValueRef *p_arguments, uindex_t p_argument_count, MCValueRef& r_value)
773+
bool MCScriptCallHandlerInInstance(MCScriptInstanceRef self, MCNameRef p_handler, MCValueRef *p_arguments, uindex_t p_argument_count, MCValueRef& r_value)
774774
{
775775
__MCScriptValidateObjectAndKind__(self, kMCScriptObjectKindInstance);
776776

@@ -783,7 +783,7 @@ bool MCScriptCallHandlerOfInstance(MCScriptInstanceRef self, MCNameRef p_handler
783783
}
784784

785785

786-
bool MCScriptCallHandlerOfInstanceIfFound(MCScriptInstanceRef self, MCNameRef p_handler, MCValueRef *p_arguments, uindex_t p_argument_count, MCValueRef& r_value)
786+
bool MCScriptCallHandlerInInstanceIfFound(MCScriptInstanceRef self, MCNameRef p_handler, MCValueRef *p_arguments, uindex_t p_argument_count, MCValueRef& r_value)
787787
{
788788
__MCScriptValidateObjectAndKind__(self, kMCScriptObjectKindInstance);
789789

@@ -797,7 +797,7 @@ bool MCScriptCallHandlerOfInstanceIfFound(MCScriptInstanceRef self, MCNameRef p_
797797
return MCScriptCallHandlerOfInstanceDirect(self, t_definition, p_arguments, p_argument_count, r_value);
798798
}
799799

800-
bool MCScriptCopyHandlerOfInstance(MCScriptInstanceRef self, MCNameRef p_name, MCHandlerRef& r_handler)
800+
bool MCScriptEvaluateHandlerBindingInInstance(MCScriptInstanceRef self, MCNameRef p_name, MCHandlerRef& r_handler)
801801
{
802802
__MCScriptValidateObjectAndKind__(self, kMCScriptObjectKindInstance);
803803

libscript/src/script-module.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ __MCScriptCopyDefinitionsOfModule(MCScriptModuleRef self,
867867
return true;
868868
}
869869

870-
bool MCScriptCopyDependenciesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_module_names)
870+
bool MCScriptListDependenciesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_module_names)
871871
{
872872
MCAutoProperListRef t_modules;
873873
if (!MCProperListCreateMutable(&t_modules))
@@ -883,7 +883,7 @@ bool MCScriptCopyDependenciesOfModule(MCScriptModuleRef self, /* copy */ MCPrope
883883
return true;
884884
}
885885

886-
bool MCScriptCopyConstantsOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_constant_names)
886+
bool MCScriptListConstantNamesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_constant_names)
887887
{
888888
return __MCScriptCopyDefinitionsOfModule(self,
889889
kMCScriptDefinitionKindConstant,
@@ -905,7 +905,7 @@ bool MCScriptQueryConstantOfModule(MCScriptModuleRef self, MCNameRef p_constant,
905905
return true;
906906
}
907907

908-
bool MCScriptCopyPropertiesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_property_names)
908+
bool MCScriptListPropertyNamesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_property_names)
909909
{
910910
return __MCScriptCopyDefinitionsOfModule(self,
911911
kMCScriptDefinitionKindProperty,
@@ -951,7 +951,7 @@ bool MCScriptQueryPropertyOfModule(MCScriptModuleRef self, MCNameRef p_property,
951951
return true;
952952
}
953953

954-
bool MCScriptCopyEventsOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_event_names)
954+
bool MCScriptListEventNamesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_event_names)
955955
{
956956
return __MCScriptCopyDefinitionsOfModule(self,
957957
kMCScriptDefinitionKindEvent,
@@ -973,7 +973,7 @@ bool MCScriptQueryEventOfModule(MCScriptModuleRef self, MCNameRef p_event, /* ge
973973
return true;
974974
}
975975

976-
bool MCScriptCopyHandlersOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_handler_names)
976+
bool MCScriptListHandlerNamesOfModule(MCScriptModuleRef self, /* copy */ MCProperListRef& r_handler_names)
977977
{
978978
return __MCScriptCopyDefinitionsOfModule(self,
979979
kMCScriptDefinitionKindHandler,
@@ -995,7 +995,7 @@ bool MCScriptQueryHandlerSignatureOfModule(MCScriptModuleRef self, MCNameRef p_h
995995
return true;
996996
}
997997

998-
bool MCScriptCopyHandlerParametersOfModule(MCScriptModuleRef self, MCNameRef p_handler, /* copy */ MCProperListRef& r_names)
998+
bool MCScriptCopyHandlerParameterNamesOfModule(MCScriptModuleRef self, MCNameRef p_handler, /* copy */ MCProperListRef& r_names)
999999
{
10001000
MCScriptHandlerDefinition *t_def;
10011001

toolchain/lc-compile/src/lc-run.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ MCRunListHandlers (MCScriptModuleRef p_module)
434434
MCAutoProperListRef t_handler_list; /* List of MCNameRef */
435435
MCAutoStringRef t_message;
436436

437-
if (!MCScriptCopyHandlersOfModule (p_module, &t_handler_list))
437+
if (!MCScriptListHandlerNamesOfModule (p_module, &t_handler_list))
438438
return false;
439439

440440
if (!MCStringMutableCopy (kMCEmptyString, &t_message))
@@ -513,7 +513,7 @@ main (int argc,
513513
if (!MCScriptCreateInstanceOfModule (*t_module, &t_instance))
514514
MCRunStartupError(MCSTR("Create Instance"));
515515

516-
if (!MCScriptCallHandlerOfInstance(*t_instance,
516+
if (!MCScriptCallHandlerInInstance(*t_instance,
517517
t_config.m_handler,
518518
NULL, 0,
519519
&t_ignored_retval))

0 commit comments

Comments
 (0)