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.

97 lines
2.3 KiB

  1. /*****************************************************************************/
  2. /** Microsoft LAN Manager **/
  3. /** Copyright(c) Microsoft Corp., 1987-1999 **/
  4. /*****************************************************************************/
  5. /*****************************************************************************
  6. File : linenum.cxx
  7. Title : Line number storage routines
  8. History :
  9. 29-Oct-93 GregJen Created
  10. *****************************************************************************/
  11. #pragma warning ( disable : 4514 )
  12. /****************************************************************************
  13. local defines and includes
  14. ****************************************************************************/
  15. #include "nulldefs.h"
  16. extern "C"
  17. {
  18. #include <stdio.h>
  19. }
  20. #include "common.hxx"
  21. #include "linenum.hxx"
  22. #include "filehndl.hxx"
  23. #include "idict.hxx"
  24. /****************************************************************************
  25. external data
  26. ****************************************************************************/
  27. extern NFA_INFO * pImportCntrl;
  28. extern short curr_line_G;
  29. /****************************************************************************
  30. external procs
  31. ****************************************************************************/
  32. /****************************************************************************
  33. global data
  34. ****************************************************************************/
  35. short FileIndex;
  36. IDICT * pFileDict;
  37. /****************************************************************************/
  38. void
  39. tracked_node::SetLine()
  40. {
  41. //FLine = pImportCntrl->GetCurrentLineNo();
  42. FLine = curr_line_G;
  43. }
  44. STATUS_T
  45. tracked_node::GetLineInfo(
  46. char *& pName,
  47. short & Line )
  48. {
  49. if (FIndex)
  50. {
  51. // fetch file name from dictionary and line number from here
  52. pName = FetchFileFromDB( FIndex );
  53. Line = FLine;
  54. return STATUS_OK;
  55. }
  56. pName = "";
  57. Line = 0;
  58. return NO_INPUT_FILE;
  59. }
  60. /****************************************************************************/
  61. short
  62. AddFileToDB( char * pFile )
  63. {
  64. FileIndex = (short) pFileDict->AddElement( (IDICTELEMENT) pFile );
  65. return FileIndex;
  66. };
  67. char *
  68. FetchFileFromDB( short Index )
  69. {
  70. return (char *) pFileDict->GetElement( (IDICTKEY) Index );
  71. }