[ttssh2-commit] [9422] SpecialFolderテーブルを移動

Back to archive index
scmno****@osdn***** scmno****@osdn*****
2021年 9月 19日 (日) 00:46:57 JST


Revision: 9422
          https://osdn.net/projects/ttssh2/scm/svn/commits/9422
Author:   zmatsuo
Date:     2021-09-19 00:46:57 +0900 (Sun, 19 Sep 2021)
Log Message:
-----------
SpecialFolderテーブルを移動

- ファイル内グローバルから関数内へ移動
- static から static const に変更

Modified Paths:
--------------
    trunk/teraterm/ttpmacro/ttmlib.c

-------------- next part --------------
Modified: trunk/teraterm/ttpmacro/ttmlib.c
===================================================================
--- trunk/teraterm/ttpmacro/ttmlib.c	2021-09-18 15:46:46 UTC (rev 9421)
+++ trunk/teraterm/ttpmacro/ttmlib.c	2021-09-18 15:46:57 UTC (rev 9422)
@@ -41,31 +41,6 @@
 
 static char CurrentDir[MAXPATHLEN];
 
-typedef struct {
-	char *name;
-	int csidl;
-} SpFolder;
-
-static SpFolder spfolders[] = {
-	{ "AllUsersDesktop",   CSIDL_COMMON_DESKTOPDIRECTORY },
-	{ "AllUsersStartMenu", CSIDL_COMMON_STARTMENU },
-	{ "AllUsersPrograms",  CSIDL_COMMON_PROGRAMS },
-	{ "AllUsersStartup",   CSIDL_COMMON_STARTUP },
-	{ "Desktop",           CSIDL_DESKTOPDIRECTORY },
-	{ "Favorites",         CSIDL_FAVORITES },
-	{ "Fonts",             CSIDL_FONTS },
-	{ "MyDocuments",       CSIDL_PERSONAL },
-	{ "NetHood",           CSIDL_NETHOOD },
-	{ "PrintHood",         CSIDL_PRINTHOOD },
-	{ "Programs",          CSIDL_PROGRAMS },
-	{ "Recent",            CSIDL_RECENT },
-	{ "SendTo",            CSIDL_SENDTO },
-	{ "StartMenu",         CSIDL_STARTMENU },
-	{ "Startup",           CSIDL_STARTUP },
-	{ "Templates",         CSIDL_TEMPLATES },
-	{ NULL,                -1}
-};
-
 /**
  * \x95\xB6\x8E\x9A\x82\xF0\x95`\x89悵\x82\xBD\x8E\x9E\x82̃T\x83C\x83Y\x82\xF0\x8EZ\x8Fo\x82\xB7\x82\xE9
  *	@param[in]	hWnd
@@ -247,8 +222,33 @@
 
 int GetSpecialFolder(PCHAR dest, int dest_len, PCHAR type)
 {
-	SpFolder *p;
+	typedef struct {
+		char *name;
+		int csidl;
+	} SpFolder;
 
+	static const SpFolder spfolders[] = {
+		{ "AllUsersDesktop",   CSIDL_COMMON_DESKTOPDIRECTORY },
+		{ "AllUsersStartMenu", CSIDL_COMMON_STARTMENU },
+		{ "AllUsersPrograms",  CSIDL_COMMON_PROGRAMS },
+		{ "AllUsersStartup",   CSIDL_COMMON_STARTUP },
+		{ "Desktop",           CSIDL_DESKTOPDIRECTORY },
+		{ "Favorites",         CSIDL_FAVORITES },
+		{ "Fonts",             CSIDL_FONTS },
+		{ "MyDocuments",       CSIDL_PERSONAL },
+		{ "NetHood",           CSIDL_NETHOOD },
+		{ "PrintHood",         CSIDL_PRINTHOOD },
+		{ "Programs",          CSIDL_PROGRAMS },
+		{ "Recent",            CSIDL_RECENT },
+		{ "SendTo",            CSIDL_SENDTO },
+		{ "StartMenu",         CSIDL_STARTMENU },
+		{ "Startup",           CSIDL_STARTUP },
+		{ "Templates",         CSIDL_TEMPLATES },
+		{ NULL,                -1}
+	};
+
+	const SpFolder *p;
+
 	for (p = spfolders; p->name != NULL; p++) {
 		if (_stricmp(type, p->name) == 0) {
 			return DoGetSpecialFolder(p->csidl, dest, dest_len);


ttssh2-commit メーリングリストの案内
Back to archive index