File: spt_demo.c

package info (click to toggle)
python-setproctitle 1.3.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 276 kB
  • sloc: ansic: 946; python: 658; makefile: 21
file content (24 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* A small demo to show how to use the display change */

#include "../src/spt_status.h"

#include <stdio.h>
#include <unistd.h>

int
main(int argc, char **argv)
{
    printf("Process PID: %i\n", getpid());

    argv = save_ps_display_args(argc, argv);
    init_ps_display("hello, world");
    printf("Title changed, press enter\n");
    getchar();

    set_ps_display("new title!", true);
    printf("Title changed again, press enter to exit\n");
    getchar();

    return 0;
}