Annotation of os2sdk/demos/examples/version/version.c, revision 1.1.1.2

1.1       root        1: /*
1.1.1.2 ! root        2:  * Example of DosGetVersion usage
1.1       root        3:  *
                      4:  * This program gets the DOS version and revision numbers.
                      5:  * It works as a Family API Program.
                      6:  *
                      7:  * Compile as: cl -AL -Lp -G0 version.c
                      8:  *
1.1.1.2 ! root        9:  * Created by Microsoft Corp. 1986
1.1       root       10:  */
                     11: 
1.1.1.2 ! root       12: #include  <os2def.h>
        !            13: #define INCL_DOSMISC
        !            14: #include  <bsedos.h>
1.1       root       15: 
                     16: main()
                     17: {
1.1.1.2 ! root       18:        USHORT VersionWord;
        !            19:        USHORT major, minor;
1.1       root       20: 
1.1.1.2 ! root       21:        DosGetVersion(&VersionWord);    /* Call DOS to get the version */
1.1       root       22: 
                     23:        major = VersionWord >> 8;           /* High byte is major version */
                     24:        minor = VersionWord & 0xff;         /* Low byte is minor revision */
                     25: 
                     26:        printf("Version %d.%d\n", major, minor);
                     27: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.