Home » Archimedes archive » Acorn User » AU 1997-01 B.adf » Features » Arcade/!Popcorn/c/LoseGroup

Arcade/!Popcorn/c/LoseGroup

This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.

Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.

Tape/disk: Home » Archimedes archive » Acorn User » AU 1997-01 B.adf » Features
Filename: Arcade/!Popcorn/c/LoseGroup
Read OK:
File size: 0103 bytes
Load address: 0000
Exec address: 0000
Duplicates

There is 1 duplicate copy of this file in the archive:

File contents
#include <stdlib.h>

#include "Popcorn:h.Popcorn"

void Popcorn_LoseGroup(int group)
{
  int c=0;

  while (c != resource_free)
  {
    if (resource[c]->group == group)
    {
      free(resource[c]->addr);
      resource[c]->addr = NULL;
    }
    c++;
  }
}
00000000  23 69 6e 63 6c 75 64 65  20 3c 73 74 64 6c 69 62  |#include <stdlib|
00000010  2e 68 3e 0a 0a 23 69 6e  63 6c 75 64 65 20 22 50  |.h>..#include "P|
00000020  6f 70 63 6f 72 6e 3a 68  2e 50 6f 70 63 6f 72 6e  |opcorn:h.Popcorn|
00000030  22 0a 0a 76 6f 69 64 20  50 6f 70 63 6f 72 6e 5f  |"..void Popcorn_|
00000040  4c 6f 73 65 47 72 6f 75  70 28 69 6e 74 20 67 72  |LoseGroup(int gr|
00000050  6f 75 70 29 0a 7b 0a 20  20 69 6e 74 20 63 3d 30  |oup).{.  int c=0|
00000060  3b 0a 0a 20 20 77 68 69  6c 65 20 28 63 20 21 3d  |;..  while (c !=|
00000070  20 72 65 73 6f 75 72 63  65 5f 66 72 65 65 29 0a  | resource_free).|
00000080  20 20 7b 0a 20 20 20 20  69 66 20 28 72 65 73 6f  |  {.    if (reso|
00000090  75 72 63 65 5b 63 5d 2d  3e 67 72 6f 75 70 20 3d  |urce[c]->group =|
000000a0  3d 20 67 72 6f 75 70 29  0a 20 20 20 20 7b 0a 20  |= group).    {. |
000000b0  20 20 20 20 20 66 72 65  65 28 72 65 73 6f 75 72  |     free(resour|
000000c0  63 65 5b 63 5d 2d 3e 61  64 64 72 29 3b 0a 20 20  |ce[c]->addr);.  |
000000d0  20 20 20 20 72 65 73 6f  75 72 63 65 5b 63 5d 2d  |    resource[c]-|
000000e0  3e 61 64 64 72 20 3d 20  4e 55 4c 4c 3b 0a 20 20  |>addr = NULL;.  |
000000f0  20 20 7d 0a 20 20 20 20  63 2b 2b 3b 0a 20 20 7d  |  }.    c++;.  }|
00000100  0a 7d 0a                                          |.}.|
00000103