LibPkg
Classes | Functions
pkg::os Namespace Reference

Classes

class  exception
 An exception class to represent a RISC OS error block. More...
 
struct  file_info
 

Functions

void call_swi (unsigned int number, _kernel_swi_regs *regs)
 Call a RISC OS software interrupt. More...
 
void OS_Byte161 (int address, int *_value)
 Read byte from CMOS RAM. More...
 
void OS_File1 (const char *name, unsigned int loadaddr, unsigned int execaddr, unsigned int attr)
 Write catalogue information. More...
 
void OS_File4 (const char *name, unsigned int attr)
 Write file attributes. More...
 
void OS_File6 (const char *name, unsigned int *_objtype, unsigned int *_loadaddr, unsigned int *_execaddr, unsigned int *_length, unsigned int *_attr)
 Delete object. More...
 
void OS_File8 (const char *name, unsigned int entries)
 Create directory. More...
 
void OS_File17 (const char *name, unsigned int *_objtype, unsigned int *_loadaddr, unsigned int *_execaddr, unsigned int *_length, unsigned int *_attr)
 Read catalogue information. More...
 
void OS_File18 (const char *name, unsigned int filetype)
 Write filetype. More...
 
void OS_Args5 (int handle, bool *_eof)
 Read EOF status. More...
 
void OS_Find (int code, const char *name, const char *path, int *_handle)
 Open file. More...
 
void OS_Find0 (int handle)
 Close file. More...
 
void OS_GBPB2 (int handle, const void *buffer, unsigned int count, unsigned int *_fp)
 Write bytes to file. More...
 
void OS_GBPB4 (int handle, void *buffer, unsigned int count, unsigned int *_excess, unsigned int *_fp)
 Read bytes from file. More...
 
void OS_GBPB12 (const char *name, void *buffer, unsigned int count, int offset, unsigned int length, const char *pattern, unsigned int *_count, int *_offset)
 Read catalogue information from directory. More...
 
void OS_SetVarVal (const char *varname, const char *value, unsigned int length, unsigned int context, unsigned int vartype, unsigned int *_context, unsigned int *_vartype)
 Set system variable. More...
 
void OS_FSControl25 (const char *src_name, const char *dst_name)
 Rename object. More...
 
void OS_FSControl26 (const char *src_name, const char *dst_name, unsigned int mask, unsigned long long start_time, unsigned long long end_time, void *extra_info)
 Copy objects. More...
 
void OS_FSControl37 (const char *name, char *buffer, const char *pathvar, const char *path, unsigned int size, unsigned int *_size)
 Canonicalise pathname. More...
 
void OS_ReadModeVariable (int index, int *_value)
 Read mode variable. More...
 
void OS_ReadMonotonicTime (unsigned int *_time)
 Read monotonic time. More...
 
void OS_CLI (const char *command)
 Execute a command line. More...
 

Function Documentation

◆ call_swi()

void pkg::os::call_swi ( unsigned int  number,
_kernel_swi_regs *  regs 
)
inline

◆ OS_Byte161()

void pkg::os::OS_Byte161 ( int  address,
int *  _value 
)

Read byte from CMOS RAM.

Parameters
addressthe address to read
_valuea buffer for the returned value

References call_swi(), and pkg::swi::OS_Byte.

◆ OS_File1()

void pkg::os::OS_File1 ( const char *  name,
unsigned int  loadaddr,
unsigned int  execaddr,
unsigned int  attr 
)

Write catalogue information.

Parameters
namethe object name
loadaddrthe required load address
execaddrthe required execution address
attrthe required file attributes

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::write_file_info().

◆ OS_File4()

void pkg::os::OS_File4 ( const char *  name,
unsigned int  attr 
)

Write file attributes.

Parameters
namethe object name
attrthe required file attributes

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::force_delete(), and pkg::force_move().

◆ OS_File6()

void pkg::os::OS_File6 ( const char *  name,
unsigned int *  _objtype,
unsigned int *  _loadaddr,
unsigned int *  _execaddr,
unsigned int *  _length,
unsigned int *  _attr 
)

Delete object.

Parameters
namethe object name
_objtypea buffer for the returned object type
_loadaddra buffer for the returned load address
_execaddra buffer for the returned execution address
_lengtha buffer for the returned object length
_attra buffer for the returned object attributes

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::force_delete(), pkg::force_move(), pkg::auto_dir::operator()(), and pkg::soft_delete().

◆ OS_File8()

void pkg::os::OS_File8 ( const char *  name,
unsigned int  entries 
)

Create directory.

Parameters
namethe object name
entriesthe initial number of entries, or 0 for default

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::create_directory(), and pkg::auto_dir::operator()().

◆ OS_File17()

void pkg::os::OS_File17 ( const char *  name,
unsigned int *  _objtype,
unsigned int *  _loadaddr,
unsigned int *  _execaddr,
unsigned int *  _length,
unsigned int *  _attr 
)

Read catalogue information.

Parameters
namethe object name
_objtypea buffer for the returned object type
_loadaddra buffer for the returned load address
_execaddra buffer for the returned execution address
_lengtha buffer for the returned object length
_attra buffer for the returned object attributes

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::force_move(), pkg::object_length(), pkg::object_type(), and pkg::auto_dir::operator()().

◆ OS_File18()

void pkg::os::OS_File18 ( const char *  name,
unsigned int  filetype 
)

Write filetype.

Parameters
namethe object name
filetypethe required filetype

References call_swi(), and pkg::swi::OS_File.

Referenced by pkg::write_filetype().

◆ OS_Args5()

void pkg::os::OS_Args5 ( int  handle,
bool *  _eof 
)

Read EOF status.

Parameters
handlethe file handle
_eofa buffer for the returned EOF status (true=EOF)

References call_swi(), and pkg::swi::OS_Args.

◆ OS_Find()

void pkg::os::OS_Find ( int  code,
const char *  name,
const char *  path,
int *  _handle 
)

Open file.

Parameters
codethe reason code
namethe object name
paththe path (if any)
_handlea buffer for the returned file handle

References call_swi(), and pkg::swi::OS_Find.

◆ OS_Find0()

void pkg::os::OS_Find0 ( int  handle)

Close file.

Parameters
handlethe file handle

References call_swi(), and pkg::swi::OS_Find.

◆ OS_GBPB2()

void pkg::os::OS_GBPB2 ( int  handle,
const void *  buffer,
unsigned int  count,
unsigned int *  _fp 
)

Write bytes to file.

Parameters
handlethe file handle
bufferthe data to be written
countthe number of bytes to be written
_fpa buffer for the returned file pointer

References call_swi(), and pkg::swi::OS_GBPB.

◆ OS_GBPB4()

void pkg::os::OS_GBPB4 ( int  handle,
void *  buffer,
unsigned int  count,
unsigned int *  _excess,
unsigned int *  _fp 
)

Read bytes from file.

Parameters
handlethe file handle
buffera buffer for the data to be read
countthe number of bytes to be read
_excessa buffer for the returned number of bytes not transferred
_fpa buffer for the returned file pointer

References call_swi(), and pkg::swi::OS_GBPB.

◆ OS_GBPB12()

void pkg::os::OS_GBPB12 ( const char *  name,
void *  buffer,
unsigned int  count,
int  offset,
unsigned int  length,
const char *  pattern,
unsigned int *  _count,
int *  _offset 
)

Read catalogue information from directory.

Parameters
namethe directory pathname
buffera buffer for the catalogue entries to be read
countthe number of catalogue entries to be read
offsetthe offset at which to begin
lengththe length of the buffer
patternthe pattern to match
_counta buffer for the returned number of directory entries read
_offseta buffer for the returned offset, or -1 if finished

References call_swi(), and pkg::swi::OS_GBPB.

Referenced by pkg::dirstream::operator>>().

◆ OS_SetVarVal()

void pkg::os::OS_SetVarVal ( const char *  varname,
const char *  value,
unsigned int  length,
unsigned int  context,
unsigned int  vartype,
unsigned int *  _context,
unsigned int *  _vartype 
)

Set system variable.

Parameters
varnamethe variable name
valuethe required value
lengththe length of the required value
contextthe context pointer, or 0 if none
vartypethe variable type
_contexta buffer for the returned context pointer
_vartypea buffer for the returned variable type

References call_swi(), and pkg::swi::OS_SetVarVal.

Referenced by pkg::update_sysvars().

◆ OS_FSControl25()

void pkg::os::OS_FSControl25 ( const char *  src_name,
const char *  dst_name 
)

Rename object.

Parameters
src_namethe source name
dst_namethe destination name

References call_swi(), and pkg::swi::OS_FSControl.

Referenced by pkg::force_move().

◆ OS_FSControl26()

void pkg::os::OS_FSControl26 ( const char *  src_name,
const char *  dst_name,
unsigned int  mask,
unsigned long long  start_time,
unsigned long long  end_time,
void *  extra_info 
)

Copy objects.

Parameters
src_namethe source name
dst_namethe destination name
maska bitmap describing the required action
start_timethe optional inclusive start time
end_timethe optional inclusive end time
extra_infoan optional pointer to extra information

References call_swi(), and pkg::swi::OS_FSControl.

Referenced by pkg::copy_object().

◆ OS_FSControl37()

void pkg::os::OS_FSControl37 ( const char *  name,
char *  buffer,
const char *  pathvar,
const char *  path,
unsigned int  size,
unsigned int *  _size 
)

Canonicalise pathname.

Parameters
namethe object name
buffera buffer for the result
pathvarthe name of a system variable containing the path
paththe path to use if path_variable is null or non-existant
sizethe size of the buffer
_sizethe space remaining after the result (but the terminator) has been placed in the buffer

References call_swi(), and pkg::swi::OS_FSControl.

Referenced by pkg::canonicalise().

◆ OS_ReadModeVariable()

void pkg::os::OS_ReadModeVariable ( int  index,
int *  _value 
)

Read mode variable.

Parameters
indexthe variable number
_valuea buffer for the returned value

References call_swi(), and pkg::swi::OS_ReadModeVariable.

◆ OS_ReadMonotonicTime()

void pkg::os::OS_ReadMonotonicTime ( unsigned int *  _time)

Read monotonic time.

Parameters
_timea buffer for the returned time (in centiseconds)

References call_swi(), and pkg::swi::OS_ReadMonotonicTime.

◆ OS_CLI()

void pkg::os::OS_CLI ( const char *  command)

Execute a command line.

Parameters
commandline to execute ( < 256 characters)

References call_swi(), and pkg::swi::OS_CLI.

Referenced by pkg::commit::poll().


Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)