home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 2: PC / frozenfish_august_1995.bin / bbs / d07xx / d0744.lha / FO2 / Sources_FO2 / move.c < prev    next >
C/C++ Source or Header  |  1992-10-12  |  984b  |  58 lines

  1. #include "defs.h"
  2.  
  3. Prototype MoveUserDirB(WORD oB,WORD nB);
  4. Prototype MoveHashFils(WORD bloc,WORD parent);
  5.  
  6. MoveUserDirB(oB,nB)
  7. WORD oB,nB;
  8. {
  9. struct SUserDirB *dlist;
  10. struct UserDirB *adr;
  11. WORD n;
  12.  
  13. #ifdef DEBUG
  14.     printf("in MoveUserDir() oB: %d, nB: %d\n",oB,nB);
  15. #endif
  16.     dlist=whereB(oB);
  17.     if (dlist==0) NotSet(oB,6);
  18.     else
  19.     {    
  20.         if (dlist->dl_Type==4)
  21.         {
  22.  
  23.             adr=dlist->dl_AdrB;
  24.             dlist->dl_Bloc2=nB;
  25.             adr->HeaderKey=nB;
  26.             for (n=71;n!=-1;n--)
  27.             {
  28.                 if (adr->HashTable[n])
  29.                 {
  30.                     MoveHashFils(adr->HashTable[n],nB);
  31.                 }
  32.             }
  33.         return(nB+1);
  34.         } else puts("err in MoveUserDirB");
  35.     }
  36. }
  37.  
  38. MoveHashFils(bloc,parent)
  39. WORD bloc,parent;
  40. {
  41. struct DiskList *dlist;
  42. struct  FileHeaderB *adr;
  43.  
  44. #ifdef DEBUG
  45.     printf("in MoveHashFils() bloc: %d, parent: %d\n",bloc,parent);
  46. #endif
  47.     do
  48.     {
  49.     dlist=whereB(bloc);
  50.     if (dlist==0) {NotSet(bloc,7); return(0);}
  51.     adr=dlist->dl_AdrB;
  52.     dlist->dl_types.dl_type4.dl_Parent=parent;
  53.     adr->ParentDir=parent;
  54.     bloc=adr->NextHash;
  55.     }
  56.     while (bloc);
  57. }
  58.