# $platform(5)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

$platform - MicroEmacs host platform identifier
%platform - MicroEmacs host platform type identifier

## SYNOPSIS

$platform "string"; Default is platform specific
%platform "string"; Default is platform specific

## DESCRIPTION

The $platform variable is a fixed ASCII string used to identify the current working platform, attempts to set this variable result in an error returned from set-variable(2).

Possible values are:

"aix"

All IBM AIX O/S.

"dos"

All IBM-PCs and compatibles running MS-DOS.

"freebsd"

All FreeBSD O/S.

"hpux"

All Hewlett Packard's with HP-UX O/S.

"irix"

All Silicon Graphics (SGI) IRIX platforms 4.x, 5.x, 6.x.

"linux"

All LINUX O/S.

"sunos"

All Sun's with SUNOS O/S.

"unixwr1"

PC based UNIX platform (Consensus and Unixware).

"win32"

Microsoft Windows based systems including Windows 3.x (with Win32s), Windows '95 and NT.

$platform is often used in .emf files to allow portability of macro files across platforms, allowing macro files to perform platform specific operations. $system(5) is also often used for this purpose as its value is easier to assess.

%platform is created at start-up when `me.emf` is executed, its value is identical to $platform except when the platform is a console in which case a '`c`' is appended to the $platform value, e.g. for MicroEmacs running a termcap version on LINUX the value will be "`linuxc`". The variable is used when the console and window based versions need to be distinguish, e.g. some of the user-setup settings.

## EXAMPLE

The following example is taken from the me.emf file which uses the $platform variable to load the platform specific initialization files.

    ;
    ; load in the platform specific stuff
    execute-file $platform

This could be more explicitly done by:

    ;
    ; load in the platform specific stuff
    !if   &seq $platform "dos"            ; is it an IBM-PC running dos ?
        execute-file "dos"
    !elif &seq $platform "irix"           ; is it an sgi ?
        execute-file "irix"
    !elif &seq $platform "hpux"           ; is it an hp ?
        execute-file "hpux"
        .
        .
    !endif

## NOTES

The $platform variable can not be set. Any attempt to set it will result in an error.

## SEE ALSO

$system(5), set-variable(2).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>