Home » Personal collection » Acorn hard disk » apps » web » Telnet/!SysLog/C-veneer/c/test

Telnet/!SysLog/C-veneer/c/test

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 » Personal collection » Acorn hard disk » apps » web
Filename: Telnet/!SysLog/C-veneer/c/test
Read OK:
File size: 0201 bytes
Load address: 0000
Exec address: 0000
Duplicates

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

File contents
#include "syslog.h"

int main(void)
{
    int fred = 999;
    char logname[]="Test";

    syslog_logmessage("Test","testing 123",123);
    syslogf(logname,23,"my %s are dim! %d", "eyes", 234);
    syslogf(logname,23,"log level = %d", syslog_getloglevel(logname));
    syslogf(logname,23,"xgetlevel = %d", xsyslog_getloglevel(logname,&fred));
    syslogf(logname,23,"log level = %d", fred);
    syslogf(logname,23,"error message = %s", syslog_readerrormessage(60));
    syslog_logcomplete("Test");
    return 0;
}
00000000  23 69 6e 63 6c 75 64 65  20 22 73 79 73 6c 6f 67  |#include "syslog|
00000010  2e 68 22 0a 0a 69 6e 74  20 6d 61 69 6e 28 76 6f  |.h"..int main(vo|
00000020  69 64 29 0a 7b 0a 20 20  20 20 69 6e 74 20 66 72  |id).{.    int fr|
00000030  65 64 20 3d 20 39 39 39  3b 0a 20 20 20 20 63 68  |ed = 999;.    ch|
00000040  61 72 20 6c 6f 67 6e 61  6d 65 5b 5d 3d 22 54 65  |ar logname[]="Te|
00000050  73 74 22 3b 0a 0a 20 20  20 20 73 79 73 6c 6f 67  |st";..    syslog|
00000060  5f 6c 6f 67 6d 65 73 73  61 67 65 28 22 54 65 73  |_logmessage("Tes|
00000070  74 22 2c 22 74 65 73 74  69 6e 67 20 31 32 33 22  |t","testing 123"|
00000080  2c 31 32 33 29 3b 0a 20  20 20 20 73 79 73 6c 6f  |,123);.    syslo|
00000090  67 66 28 6c 6f 67 6e 61  6d 65 2c 32 33 2c 22 6d  |gf(logname,23,"m|
000000a0  79 20 25 73 20 61 72 65  20 64 69 6d 21 20 25 64  |y %s are dim! %d|
000000b0  22 2c 20 22 65 79 65 73  22 2c 20 32 33 34 29 3b  |", "eyes", 234);|
000000c0  0a 20 20 20 20 73 79 73  6c 6f 67 66 28 6c 6f 67  |.    syslogf(log|
000000d0  6e 61 6d 65 2c 32 33 2c  22 6c 6f 67 20 6c 65 76  |name,23,"log lev|
000000e0  65 6c 20 3d 20 25 64 22  2c 20 73 79 73 6c 6f 67  |el = %d", syslog|
000000f0  5f 67 65 74 6c 6f 67 6c  65 76 65 6c 28 6c 6f 67  |_getloglevel(log|
00000100  6e 61 6d 65 29 29 3b 0a  20 20 20 20 73 79 73 6c  |name));.    sysl|
00000110  6f 67 66 28 6c 6f 67 6e  61 6d 65 2c 32 33 2c 22  |ogf(logname,23,"|
00000120  78 67 65 74 6c 65 76 65  6c 20 3d 20 25 64 22 2c  |xgetlevel = %d",|
00000130  20 78 73 79 73 6c 6f 67  5f 67 65 74 6c 6f 67 6c  | xsyslog_getlogl|
00000140  65 76 65 6c 28 6c 6f 67  6e 61 6d 65 2c 26 66 72  |evel(logname,&fr|
00000150  65 64 29 29 3b 0a 20 20  20 20 73 79 73 6c 6f 67  |ed));.    syslog|
00000160  66 28 6c 6f 67 6e 61 6d  65 2c 32 33 2c 22 6c 6f  |f(logname,23,"lo|
00000170  67 20 6c 65 76 65 6c 20  3d 20 25 64 22 2c 20 66  |g level = %d", f|
00000180  72 65 64 29 3b 0a 20 20  20 20 73 79 73 6c 6f 67  |red);.    syslog|
00000190  66 28 6c 6f 67 6e 61 6d  65 2c 32 33 2c 22 65 72  |f(logname,23,"er|
000001a0  72 6f 72 20 6d 65 73 73  61 67 65 20 3d 20 25 73  |ror message = %s|
000001b0  22 2c 20 73 79 73 6c 6f  67 5f 72 65 61 64 65 72  |", syslog_reader|
000001c0  72 6f 72 6d 65 73 73 61  67 65 28 36 30 29 29 3b  |rormessage(60));|
000001d0  0a 20 20 20 20 73 79 73  6c 6f 67 5f 6c 6f 67 63  |.    syslog_logc|
000001e0  6f 6d 70 6c 65 74 65 28  22 54 65 73 74 22 29 3b  |omplete("Test");|
000001f0  0a 20 20 20 20 72 65 74  75 72 6e 20 30 3b 0a 7d  |.    return 0;.}|
00000200  0a                                                |.|
00000201