Permalink
Browse files

More source cleanups, added nice comments in methods_xxx files

  • Loading branch information...
nickgammon committed Sep 26, 2010
1 parent 24e3b52 commit e362b37dd4b5197281a2c16f15145328ac7bed8b
Showing with 593 additions and 79 deletions.
  1. +48 −48 MUSHclient.dsp
  2. +58 −0 scripting/methods/methods.cpp
  3. +5 −6 scripting/methods/methods_accelerators.cpp
  4. +15 −9 scripting/methods/methods_aliases.cpp
  5. +23 −0 scripting/methods/methods_arrays.cpp
  6. +28 −6 scripting/methods/methods_chat.cpp
  7. +5 −0 scripting/methods/methods_clipboard.cpp
  8. +15 −0 scripting/methods/methods_colours.cpp
  9. +18 −0 scripting/methods/methods_commands.cpp
  10. +23 −0 scripting/methods/methods_database.cpp
  11. +7 −0 scripting/methods/methods_defaults.cpp
  12. +33 −0 scripting/methods/methods_info.cpp
  13. +9 −0 scripting/methods/methods_infobar.cpp
  14. +8 −0 scripting/methods/methods_logging.cpp
  15. +12 −0 scripting/methods/methods_mapping.cpp
  16. +51 −0 scripting/methods/methods_miniwindows.cpp
  17. +20 −0 scripting/methods/methods_notepad.cpp
  18. +15 −0 scripting/methods/methods_noting.cpp
  19. +29 −0 scripting/methods/methods_output.cpp
  20. +26 −0 scripting/methods/methods_plugins.cpp
  21. +8 −0 scripting/methods/methods_sending.cpp
  22. +6 −0 scripting/methods/methods_sounds.cpp
  23. +8 −0 scripting/methods/methods_speedwalks.cpp
  24. +9 −0 scripting/methods/methods_spellchecker.cpp
  25. +21 −0 scripting/methods/methods_timers.cpp
  26. +7 −1 scripting/methods/methods_tracing.cpp
  27. +16 −6 scripting/methods/methods_triggers.cpp
  28. +7 −0 scripting/methods/methods_udp.cpp
  29. +38 −0 scripting/methods/methods_utilities.cpp
  30. +8 −3 scripting/methods/methods_variables.cpp
  31. +7 −0 scripting/methods/methods_worlds.cpp
  32. +10 −0 scripting/methods/methods_xml.cpp
View
@@ -999,131 +999,131 @@ SOURCE=.\paneline.cpp
# PROP Default_Filter ""
# Begin Source File
-SOURCE=.\scripting\methods.cpp
+SOURCE=.\scripting\methods\methods.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_accelerators.cpp
+SOURCE=.\scripting\methods\methods_accelerators.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_aliases.cpp
+SOURCE=.\scripting\methods\methods_aliases.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_arrays.cpp
+SOURCE=.\scripting\methods\methods_arrays.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_chat.cpp
+SOURCE=.\scripting\methods\methods_chat.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_clipboard.cpp
+SOURCE=.\scripting\methods\methods_clipboard.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_colours.cpp
+SOURCE=.\scripting\methods\methods_colours.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_commands.cpp
+SOURCE=.\scripting\methods\methods_commands.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_database.cpp
+SOURCE=.\scripting\methods\methods_database.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_defaults.cpp
+SOURCE=.\scripting\methods\methods_defaults.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_info.cpp
+SOURCE=.\scripting\methods\methods_info.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_infobar.cpp
+SOURCE=.\scripting\methods\methods_infobar.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_logging.cpp
+SOURCE=.\scripting\methods\methods_logging.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_mapping.cpp
+SOURCE=.\scripting\methods\methods_mapping.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_miniwindows.cpp
+SOURCE=.\scripting\methods\methods_miniwindows.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_notepad.cpp
+SOURCE=.\scripting\methods\methods_notepad.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_noting.cpp
+SOURCE=.\scripting\methods\methods_noting.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_output.cpp
+SOURCE=.\scripting\methods\methods_output.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_panes.cpp
+SOURCE=.\scripting\methods\methods_panes.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_plugins.cpp
+SOURCE=.\scripting\methods\methods_plugins.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_sending.cpp
+SOURCE=.\scripting\methods\methods_sending.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_sounds.cpp
+SOURCE=.\scripting\methods\methods_sounds.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_speedwalks.cpp
+SOURCE=.\scripting\methods\methods_speedwalks.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_spellchecker.cpp
+SOURCE=.\scripting\methods\methods_spellchecker.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_timers.cpp
+SOURCE=.\scripting\methods\methods_timers.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_tracing.cpp
+SOURCE=.\scripting\methods\methods_tracing.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_triggers.cpp
+SOURCE=.\scripting\methods\methods_triggers.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_udp.cpp
+SOURCE=.\scripting\methods\methods_udp.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_utilities.cpp
+SOURCE=.\scripting\methods\methods_utilities.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_variables.cpp
+SOURCE=.\scripting\methods\methods_variables.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_worlds.cpp
+SOURCE=.\scripting\methods\methods_worlds.cpp
# End Source File
# Begin Source File
-SOURCE=.\scripting\methods_xml.cpp
+SOURCE=.\scripting\methods\methods_xml.cpp
# End Source File
# End Group
# Begin Source File
@@ -1560,6 +1560,22 @@ SOURCE=.\using_git.txt
# End Source File
# End Target
# End Project
+# Section MUSHclient : {00000000-0001-0000-0000-000000000000}
+# 1:23:CG_IDR_POPUP_MAIN_FRAME:126
+# End Section
+# Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD}
+# 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h
+# 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp
+# 1:10:IDB_SPLASH:102
+# 2:10:ResHdrName:resource.h
+# 2:11:ProjHdrName:stdafx.h
+# 2:10:WrapperDef:_SPLASH_SCRN_
+# 2:12:SplClassName:CSplashWnd
+# 2:21:SplashScreenInsertKey:4.0
+# 2:10:HeaderName:Splash.h
+# 2:10:ImplemName:Splash.cpp
+# 2:7:BmpID16:IDB_SPLASH
+# End Section
# Section MUSHclient : {F3B13065-16CC-11D0-B7D0-00A0247B3BFD}
# 0:8:TipDlg.h:D:\SOURCE\MUSHclient\TipDlg.h
# 0:10:TipDlg.cpp:D:\SOURCE\MUSHclient\TipDlg.cpp
@@ -1585,19 +1601,6 @@ SOURCE=.\using_git.txt
# 2:18:CG_IDS_FILE_ABSENT:CG_IDS_FILE_ABSENT
# 2:10:TipDlg.cpp:TipDlg.cpp
# End Section
-# Section MUSHclient : {F3B1306C-16CC-11D0-B7D0-00A0247B3BFD}
-# 0:8:Splash.h:D:\SOURCE\MUSHclient\Splash.h
-# 0:10:Splash.cpp:D:\SOURCE\MUSHclient\Splash.cpp
-# 1:10:IDB_SPLASH:102
-# 2:10:ResHdrName:resource.h
-# 2:11:ProjHdrName:stdafx.h
-# 2:10:WrapperDef:_SPLASH_SCRN_
-# 2:12:SplClassName:CSplashWnd
-# 2:21:SplashScreenInsertKey:4.0
-# 2:10:HeaderName:Splash.h
-# 2:10:ImplemName:Splash.cpp
-# 2:7:BmpID16:IDB_SPLASH
-# End Section
# Section MUSHclient : {00000000-0000-0000-0000-000000000000}
# 1:22:CG_IDR_POPUP_SEND_VIEW:124
# End Section
@@ -1607,6 +1610,3 @@ SOURCE=.\using_git.txt
# Section MUSHclient : {00000000-000C-0000-0C00-00004944445F}
# 1:26:CG_IDR_POPUP_ACTIVITY_VIEW:127
# End Section
-# Section MUSHclient : {00000000-0001-0000-0000-000000000000}
-# 1:23:CG_IDR_POPUP_MAIN_FRAME:126
-# End Section
@@ -39,3 +39,61 @@
*/
+
+/*
+
+-- Lua code to work out what functions are in what file:
+
+
+require "commas"
+
+funcs = {}
+
+for _, v in ipairs (utils.functionlist ()) do
+ funcs [v] = true
+end -- for
+
+
+-- this function is called for every found file
+function load_file (name, stats)
+
+ print (string.rep ("-", 40))
+
+ local n = string.match (name, "[%w._]+$")
+ print (n)
+
+ print ""
+ print ("// Implements:")
+ print ""
+
+ local f = assert (io.open (name, "r")) -- open it
+ local s = f:read ("*a") -- read all of it
+ f:close () -- close it
+
+ local t = {}
+
+ for w in string.gmatch (s, "CMUSHclientDoc::([%w_]+)") do
+ if funcs [w] then
+ table.insert (t, w)
+ end -- if a script function
+ end -- for
+
+ table.sort (t)
+
+ local done = {}
+
+ for _, name in ipairs (t) do
+ if not done [name] then
+ print ("// ", name)
+ end -- if
+ done [name] = true
+ end -- for
+
+ print ""
+
+end -- load_file
+
+
+scan_dir ("\\source\\mushclient\\scripting\\methods", load_file)
+
+*/
@@ -2,12 +2,6 @@
#include "stdafx.h"
#include "..\..\MUSHclient.h"
-
-//=============================================================
-// IMPORTANT - when adding methods here remember to add the 'glue'
-// routine in lua_methods.cpp and add it to the library table
-// - see comments at the end of methods.cpp
-//=============================================================
#include "..\..\doc.h"
#include "..\..\MUSHview.h"
#include "..\..\mainfrm.h"
@@ -16,6 +10,11 @@
#include "..\..\childfrm.h"
#include "..\..\sendvw.h"
+// Implements:
+
+// Accelerator
+// AcceleratorList
+// AcceleratorTo
// accelerator finding functor
@@ -4,22 +4,28 @@
#include "stdafx.h"
#include "..\..\MUSHclient.h"
-
-//=============================================================
-// IMPORTANT - when adding methods here remember to add the 'glue'
-// routine in lua_methods.cpp and add it to the library table
-// - see comments at the end of methods.cpp
-//=============================================================
#include "..\..\doc.h"
#include "..\..\MUSHview.h"
#include "..\..\mainfrm.h"
#include "..\..\flags.h"
#include "..\errors.h"
-// ******************************************************************************
-// **************************** ALIASES ****************************************
-// ******************************************************************************
+// Implements:
+
+// AddAlias
+// DeleteAlias
+// DeleteAliasGroup
+// DeleteTemporaryAliases
+// EnableAlias
+// EnableAliasGroup
+// GetAlias
+// GetAliasInfo
+// GetAliasList
+// GetAliasOption
+// GetAliasWildcard
+// IsAlias
+// SetAliasOption
#define AO(arg) offsetof (CAlias, arg), sizeof (((CAlias *)NULL)->arg)
@@ -7,6 +7,29 @@
#include "..\..\doc.h"
#include "..\errors.h"
+
+// Implements:
+
+// ArrayClear
+// ArrayCount
+// ArrayCreate
+// ArrayDelete
+// ArrayDeleteKey
+// ArrayExists
+// ArrayExport
+// ArrayExportKeys
+// ArrayGet
+// ArrayGetFirstKey
+// ArrayGetLastKey
+// ArrayImport
+// ArrayKeyExists
+// ArrayListAll
+// ArrayListKeys
+// ArrayListValues
+// ArraySet
+// ArraySize
+
+
/*
arrays test:
Oops, something went wrong.

0 comments on commit e362b37

Please sign in to comment.