Unit 'amigados' Package
[Overview][Constants][Types][Procedures and functions][Index] [#amunits]

FindSegment

Finds a segment on the resident list

Declaration

Source position: amigados.pas line 1641

function FindSegment(

  const name: pCHAR;

  const seg: pSegment;

  system: LongInt

):pSegment;

function FindSegment(

  const name: string;

  const seg: pSegment;

  system: LongInt

):pSegment;

Arguments

name

  

Name of Segment to find

seg

  

Segment to start the search after

system

  

True for system segment. False for normal segments

Function result

The Segment found or nil

Arguments

name

  

Name of Segment to find

seg

  

Segment to start the search after

system

  

True for system segment. False for normal segments

Description

Finds a segment on the Dos resident list by name and type, starting at the segment after 'start', or at the beginning if start is nil. If system is zero, it will only return nodes with a seg_UC of 0 or more. It does not increment the seg_UC, and it does not do any locking of the list. You must Forbid() lock the list to use this call.

To use an entry you have found, you must: if the seg_UC is 0 or more, increment it, and decrement it (under Forbid()!) when you're done the the seglist.

The other values for seg_UC are:

-1
system module, such as a filesystem or shell
-2
resident shell command
-999
disabled internal command, ignore

Negative values should never be modified. All other negative values between 0 and -32767 are reserved to AmigaDos and should not be used.

See also

AddSegment

  

Adds a resident segment to the resident list

RemSegment

  

Removes a resident segment from the resident list

exec.Forbid

  

Forbid task scheduling.


Documentation generated on: 2021-07-30