Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

549 lines
16 KiB

  1. /* File: cloopset.c (created 02/19/94, JKH)
  2. *
  3. * Copyright 1994 by Hilgraeve Inc. -- Monroe, MI
  4. * All rights reserved
  5. *
  6. * $Revision: 3 $
  7. * $Date: 3/20/02 12:43p $
  8. */
  9. #include <windows.h>
  10. #pragma hdrstop
  11. #include "stdtyp.h"
  12. #include <tdll\assert.h>
  13. #include "session.h"
  14. #include "timers.h"
  15. #include "sf.h"
  16. #include "htchar.h"
  17. #include "cloop.h"
  18. #include "cloop.hh"
  19. /* --- Session file access functions --- */
  20. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  21. * FUNCTION:
  22. * CLoopInitHdl
  23. *
  24. * DESCRIPTION:
  25. * Set all cloop user settings to valid, default values.
  26. *
  27. * ARGUMENTS:
  28. *
  29. *
  30. * RETURNS:
  31. *
  32. */
  33. int CLoopInitHdl(const HCLOOP hCLoop)
  34. {
  35. ST_CLOOP *pstCLoop = (ST_CLOOP *)hCLoop;
  36. pstCLoop->stWorkSettings.fSendCRLF = FALSE;
  37. pstCLoop->stWorkSettings.fExpandBlankLines = FALSE;
  38. pstCLoop->stWorkSettings.fLocalEcho = FALSE;
  39. pstCLoop->stWorkSettings.fLineWait = FALSE;
  40. pstCLoop->stWorkSettings.chWaitChar = TEXT('\r');
  41. pstCLoop->stWorkSettings.fExpandTabsOut = FALSE;
  42. pstCLoop->stWorkSettings.nTabSizeOut = 8;
  43. pstCLoop->stWorkSettings.nLineDelay = 0;
  44. pstCLoop->stWorkSettings.nCharDelay = 0;
  45. pstCLoop->stWorkSettings.fAddLF = FALSE;
  46. pstCLoop->stWorkSettings.fASCII7 = FALSE;
  47. pstCLoop->stWorkSettings.fEchoplex = FALSE;
  48. pstCLoop->stWorkSettings.fShowHex = FALSE;
  49. pstCLoop->stWorkSettings.nTabSizeIn = 8;
  50. // Original settings and working settings must match initially
  51. // If they no longer match at save time, then changes occurred.
  52. pstCLoop->stOrigSettings = pstCLoop->stWorkSettings;
  53. return 0;
  54. }
  55. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56. * FUNCTION:
  57. * CLoopLoadHdl
  58. *
  59. * DESCRIPTION:
  60. * Loads CLoop user settings from the session file
  61. *
  62. * ARGUMENTS:
  63. *
  64. *
  65. * RETURNS:
  66. *
  67. */
  68. int CLoopLoadHdl(const HCLOOP hCLoop)
  69. {
  70. unsigned long ul;
  71. ST_CLOOP *pstCLoop = (ST_CLOOP *)hCLoop;
  72. ST_CLOOP_SETTINGS *pstSettings;
  73. const SF_HANDLE sfhdl = sessQuerySysFileHdl(pstCLoop->hSession);
  74. // Start off with default settings
  75. CLoopInitHdl(hCLoop);
  76. pstSettings = &pstCLoop->stOrigSettings;
  77. ul = sizeof(pstSettings->fSendCRLF);
  78. sfGetSessionItem(sfhdl, SF_CLOOP_SENDCRLF, &ul, &pstSettings->fSendCRLF);
  79. ul = sizeof(pstSettings->fExpandBlankLines);
  80. sfGetSessionItem(sfhdl, SF_CLOOP_EXPAND, &ul, &pstSettings->fExpandBlankLines);
  81. ul = sizeof(pstSettings->fLocalEcho);
  82. sfGetSessionItem(sfhdl, SF_CLOOP_LOCALECHO, &ul, &pstSettings->fLocalEcho);
  83. ul = sizeof(pstSettings->fLineWait);
  84. sfGetSessionItem(sfhdl, SF_CLOOP_LINEWAIT, &ul, &pstSettings->fLineWait);
  85. ul = sizeof(pstSettings->chWaitChar);
  86. sfGetSessionItem(sfhdl, SF_CLOOP_WAITCHAR, &ul, &pstSettings->chWaitChar);
  87. ul = sizeof(pstSettings->fExpandTabsOut);
  88. sfGetSessionItem(sfhdl, SF_CLOOP_EXTABSOUT, &ul, &pstSettings->fExpandTabsOut);
  89. ul = sizeof(pstSettings->nTabSizeOut);
  90. sfGetSessionItem(sfhdl, SF_CLOOP_TABSIZEOUT, &ul, &pstSettings->nTabSizeOut);
  91. ul = sizeof(pstSettings->nLineDelay);
  92. sfGetSessionItem(sfhdl, SF_CLOOP_LINEDELAY, &ul, &pstSettings->nLineDelay);
  93. ul = sizeof(pstSettings->nCharDelay);
  94. sfGetSessionItem(sfhdl, SF_CLOOP_CHARDELAY, &ul, &pstSettings->nCharDelay);
  95. ul = sizeof(pstSettings->fAddLF);
  96. sfGetSessionItem(sfhdl, SF_CLOOP_ADDLF, &ul, &pstSettings->fAddLF);
  97. ul = sizeof(pstSettings->fASCII7);
  98. sfGetSessionItem(sfhdl, SF_CLOOP_ASCII7, &ul, &pstSettings->fASCII7);
  99. ul = sizeof(pstSettings->fEchoplex);
  100. sfGetSessionItem(sfhdl, SF_CLOOP_ECHOPLEX, &ul, &pstSettings->fEchoplex);
  101. ul = sizeof(pstSettings->fShowHex);
  102. sfGetSessionItem(sfhdl, SF_CLOOP_SHOWHEX, &ul, &pstSettings->fShowHex);
  103. ul = sizeof(pstSettings->nTabSizeIn);
  104. sfGetSessionItem(sfhdl, SF_CLOOP_TABSIZEIN, &ul, &pstSettings->nTabSizeIn);
  105. ul = sizeof(pstCLoop->fDoMBCS);
  106. sfGetSessionItem(sfhdl, SF_CLOOP_DBCS, &ul, &pstCLoop->fDoMBCS);
  107. pstCLoop->stWorkSettings = pstCLoop->stOrigSettings;
  108. return 0;
  109. }
  110. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111. * FUNCTION:
  112. * CLoopSaveHdl
  113. *
  114. * DESCRIPTION:
  115. * Saves CLoop user settings in the session file if any changes have
  116. * been made.
  117. *
  118. * ARGUMENTS:
  119. * hCLoop -- The CLoop handle created by CLoopCreateHandle
  120. *
  121. * RETURNS:
  122. * nothing
  123. */
  124. int CLoopSaveHdl(const HCLOOP hCLoop)
  125. {
  126. ST_CLOOP *pstCLoop = (ST_CLOOP *)hCLoop;
  127. ST_CLOOP_SETTINGS *pstSettings;
  128. SF_HANDLE hSF;
  129. #define PutItem(v,i) sfPutSessionItem(hSF, i, sizeof(v), &(v))
  130. EnterCriticalSection(&pstCLoop->csect);
  131. hSF = sessQuerySysFileHdl(pstCLoop->hSession);
  132. // If any settings have changed, write all settings out to session file
  133. // Outgoing line endings
  134. #if 1
  135. // Decided on 3/23 to modify design so handles will write out all
  136. // settings and session file routiines will decide what has changed
  137. if (TRUE)
  138. #else
  139. if (memcmp(&pstCLoop->stWorkSettings, &pstCLoop->stOrigSettings,
  140. sizeof(pstCLoop->stWorkSettings)) != 0)
  141. #endif
  142. {
  143. pstSettings = &pstCLoop->stWorkSettings;
  144. PutItem(pstSettings->fSendCRLF, SF_CLOOP_SENDCRLF);
  145. PutItem(pstSettings->fExpandBlankLines, SF_CLOOP_EXPAND);
  146. PutItem(pstSettings->fLocalEcho, SF_CLOOP_LOCALECHO);
  147. PutItem(pstSettings->fLineWait, SF_CLOOP_LINEWAIT);
  148. PutItem(pstSettings->chWaitChar, SF_CLOOP_WAITCHAR);
  149. PutItem(pstSettings->fExpandTabsOut, SF_CLOOP_EXTABSOUT);
  150. PutItem(pstSettings->nTabSizeOut, SF_CLOOP_TABSIZEOUT);
  151. PutItem(pstSettings->nLineDelay, SF_CLOOP_LINEDELAY);
  152. PutItem(pstSettings->nCharDelay, SF_CLOOP_CHARDELAY);
  153. PutItem(pstSettings->fAddLF, SF_CLOOP_ADDLF);
  154. PutItem(pstSettings->fASCII7, SF_CLOOP_ASCII7);
  155. PutItem(pstSettings->fEchoplex, SF_CLOOP_ECHOPLEX);
  156. PutItem(pstSettings->fShowHex, SF_CLOOP_SHOWHEX);
  157. PutItem(pstSettings->nTabSizeIn, SF_CLOOP_TABSIZEIN);
  158. PutItem(pstCLoop->fDoMBCS, SF_CLOOP_DBCS);
  159. pstCLoop->stOrigSettings = pstCLoop->stWorkSettings;
  160. }
  161. LeaveCriticalSection(&pstCLoop->csect);
  162. return SF_OK;
  163. }
  164. /* --- Access functions for user settings --- */
  165. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  166. * FUNCTION: CLoopGetXXXXX (several functions)
  167. *
  168. * DESCRIPTION:
  169. * Retrieves the named user setting.
  170. *
  171. * ARGUMENTS:
  172. * hCLoop -- Value returned from CLoopCreateHandle
  173. *
  174. * RETURNS:
  175. * The requested user setting.
  176. */
  177. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  178. * FUNCTION: CLoopSetXXXXX (several functions)
  179. *
  180. * DESCRIPTION:
  181. * Sets the named user setting
  182. *
  183. * ARGUMENTS:
  184. * hCLoop -- Value returned from CLoopCreateHandle
  185. * <varname> -- The value to be set
  186. *
  187. * RETURNS:
  188. * nothing
  189. */
  190. /* ------------------------------------------------------------*/
  191. int CLoopGetSendCRLF(const HCLOOP hCLoop)
  192. {
  193. int iVal;
  194. assert(hCLoop);
  195. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  196. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fSendCRLF;
  197. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  198. return iVal;
  199. }
  200. void CLoopSetSendCRLF(const HCLOOP hCLoop, const int fSendCRLF)
  201. {
  202. assert(hCLoop);
  203. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  204. ((ST_CLOOP *)hCLoop)->stWorkSettings.fSendCRLF = fSendCRLF;
  205. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  206. }
  207. /* ------------------------------------------------------------*/
  208. int CLoopGetExpandBlankLines(const HCLOOP hCLoop)
  209. {
  210. int iVal;
  211. assert(hCLoop);
  212. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  213. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fExpandBlankLines;
  214. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  215. return iVal;
  216. }
  217. void CLoopSetExpandBlankLines(const HCLOOP hCLoop, const int fExpandBlankLines)
  218. {
  219. assert(hCLoop);
  220. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  221. ((ST_CLOOP *)hCLoop)->stWorkSettings.fExpandBlankLines = fExpandBlankLines;
  222. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  223. }
  224. /* ------------------------------------------------------------*/
  225. int CLoopGetLocalEcho(const HCLOOP hCLoop)
  226. {
  227. int iVal;
  228. assert(hCLoop);
  229. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  230. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fLocalEcho;
  231. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  232. return iVal;
  233. }
  234. void CLoopSetLocalEcho(const HCLOOP hCLoop, const int fLocalEcho)
  235. {
  236. assert(hCLoop);
  237. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  238. ((ST_CLOOP *)hCLoop)->stWorkSettings.fLocalEcho = fLocalEcho;
  239. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  240. }
  241. /* ------------------------------------------------------------*/
  242. int CLoopGetLineWait(const HCLOOP hCLoop)
  243. {
  244. int iVal;
  245. assert(hCLoop);
  246. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  247. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fLineWait;
  248. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  249. return iVal;
  250. }
  251. void CLoopSetLineWait(const HCLOOP hCLoop, const int fLineWait)
  252. {
  253. assert(hCLoop);
  254. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  255. ((ST_CLOOP *)hCLoop)->stWorkSettings.fLineWait = fLineWait;
  256. // Clear line wait flag in case option is turned off while waiting
  257. CLoopSndControl(hCLoop, CLOOP_RESUME, CLOOP_SB_LINEWAIT);
  258. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  259. }
  260. /* ------------------------------------------------------------*/
  261. TCHAR CLoopGetWaitChar(const HCLOOP hCLoop)
  262. {
  263. TCHAR chVal;
  264. assert(hCLoop);
  265. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  266. chVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.chWaitChar;
  267. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  268. return chVal;
  269. }
  270. void CLoopSetWaitChar(const HCLOOP hCLoop, TCHAR chWaitChar)
  271. {
  272. assert(hCLoop);
  273. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  274. ((ST_CLOOP *)hCLoop)->stWorkSettings.chWaitChar = chWaitChar;
  275. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  276. }
  277. /* ------------------------------------------------------------*/
  278. int CLoopGetExpandTabsOut(const HCLOOP hCLoop)
  279. {
  280. int iVal;
  281. assert(hCLoop);
  282. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  283. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fExpandTabsOut;
  284. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  285. return iVal;
  286. }
  287. void CLoopSetExpandTabsOut(const HCLOOP hCLoop, const int fExpandTabsOut)
  288. {
  289. assert(hCLoop);
  290. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  291. ((ST_CLOOP *)hCLoop)->stWorkSettings.fExpandTabsOut = fExpandTabsOut;
  292. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  293. }
  294. /* ------------------------------------------------------------*/
  295. int CLoopGetTabSizeOut(const HCLOOP hCLoop)
  296. {
  297. int iVal;
  298. assert(hCLoop);
  299. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  300. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.nTabSizeOut;
  301. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  302. return iVal;
  303. }
  304. void CLoopSetTabSizeOut(const HCLOOP hCLoop, const int nTabSizeOut)
  305. {
  306. assert(hCLoop);
  307. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  308. ((ST_CLOOP *)hCLoop)->stWorkSettings.nTabSizeOut = nTabSizeOut;
  309. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  310. }
  311. /* ------------------------------------------------------------*/
  312. int CLoopGetLineDelay(const HCLOOP hCLoop)
  313. {
  314. int iVal;
  315. assert(hCLoop);
  316. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  317. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.nLineDelay;
  318. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  319. return iVal;
  320. }
  321. void CLoopSetLineDelay(const HCLOOP hCLoop, const int nLineDelay)
  322. {
  323. assert(hCLoop);
  324. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  325. ((ST_CLOOP *)hCLoop)->stWorkSettings.nLineDelay = nLineDelay;
  326. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  327. }
  328. /* ------------------------------------------------------------*/
  329. int CLoopGetCharDelay(const HCLOOP hCLoop)
  330. {
  331. int iVal;
  332. assert(hCLoop);
  333. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  334. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.nCharDelay;
  335. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  336. return iVal;
  337. }
  338. void CLoopSetCharDelay(const HCLOOP hCLoop, const int nCharDelay)
  339. {
  340. assert(hCLoop);
  341. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  342. ((ST_CLOOP *)hCLoop)->stWorkSettings.nCharDelay = nCharDelay;
  343. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  344. }
  345. /* ------------------------------------------------------------*/
  346. int CLoopGetAddLF(const HCLOOP hCLoop)
  347. {
  348. int iVal;
  349. assert(hCLoop);
  350. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  351. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fAddLF;
  352. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  353. return iVal;
  354. }
  355. void CLoopSetAddLF(const HCLOOP hCLoop, const int fAddLF)
  356. {
  357. assert(hCLoop);
  358. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  359. ((ST_CLOOP *)hCLoop)->stWorkSettings.fAddLF = fAddLF;
  360. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  361. }
  362. /* ------------------------------------------------------------*/
  363. int CLoopGetASCII7(const HCLOOP hCLoop)
  364. {
  365. int iVal;
  366. assert(hCLoop);
  367. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  368. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fASCII7;
  369. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  370. return iVal;
  371. }
  372. void CLoopSetASCII7(const HCLOOP hCLoop, const int fASCII7)
  373. {
  374. assert(hCLoop);
  375. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  376. ((ST_CLOOP *)hCLoop)->stWorkSettings.fASCII7 = fASCII7;
  377. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  378. }
  379. /* ------------------------------------------------------------*/
  380. int CLoopGetEchoplex(const HCLOOP hCLoop)
  381. {
  382. int iVal;
  383. assert(hCLoop);
  384. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  385. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fEchoplex;
  386. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  387. return iVal;
  388. }
  389. void CLoopSetEchoplex(const HCLOOP hCLoop, const int fEchoplex)
  390. {
  391. assert(hCLoop);
  392. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  393. ((ST_CLOOP *)hCLoop)->stWorkSettings.fEchoplex = fEchoplex;
  394. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  395. }
  396. /* ------------------------------------------------------------*/
  397. #if 0
  398. int CLoopGetWrapLines(const HCLOOP hCLoop)
  399. {
  400. int iVal;
  401. assert(hCLoop);
  402. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  403. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fWrapLines;
  404. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  405. return iVal;
  406. }
  407. void CLoopSetWrapLines(const HCLOOP hCLoop, const int fWrapLines)
  408. {
  409. assert(hCLoop);
  410. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  411. ((ST_CLOOP *)hCLoop)->stWorkSettings.fWrapLines = fWrapLines;
  412. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  413. }
  414. #endif
  415. /* ------------------------------------------------------------*/
  416. int CLoopGetShowHex(const HCLOOP hCLoop)
  417. {
  418. int iVal;
  419. assert(hCLoop);
  420. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  421. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.fShowHex;
  422. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  423. return iVal;
  424. }
  425. void CLoopSetShowHex(const HCLOOP hCLoop, const int fShowHex)
  426. {
  427. assert(hCLoop);
  428. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  429. ((ST_CLOOP *)hCLoop)->stWorkSettings.fShowHex = fShowHex;
  430. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  431. }
  432. /* ------------------------------------------------------------*/
  433. int CLoopGetTabSizeIn(const HCLOOP hCLoop)
  434. {
  435. int iVal;
  436. assert(hCLoop);
  437. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  438. iVal = ((ST_CLOOP *)hCLoop)->stWorkSettings.nTabSizeIn;
  439. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  440. return iVal;
  441. }
  442. void CLoopSetTabSizeIn(const HCLOOP hCLoop, const int nTabSizeIn)
  443. {
  444. assert(hCLoop);
  445. EnterCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  446. ((ST_CLOOP *)hCLoop)->stWorkSettings.nTabSizeIn = nTabSizeIn;
  447. LeaveCriticalSection(&((ST_CLOOP *)hCLoop)->csect);
  448. }
  449. /* ------------------------------------------------------------*/