OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [torture/] [pr51801.c] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do compile } */
2
 
3
typedef struct { char Vshow; } TScreen;
4
typedef struct _Misc { char Tshow; } Misc;
5
typedef struct _XtermWidgetRec { TScreen screen; Misc misc; } XtermWidgetRec, *XtermWidget;
6
extern XtermWidget term;
7
 
8
void
9
handle_tekshow (void *gw, int allowswitch)
10
{
11
  XtermWidget xw = term;
12
  if (!((xw)->misc.Tshow))
13
    set_tek_visibility (1);
14
}
15
 
16
void
17
do_tekonoff (void *gw, void *closure, void *data)
18
{
19
  handle_tekshow (gw, 0);
20
}
21
 
22
void
23
do_vtonoff (void *gw, void *closure, void *data)
24
{
25
}
26
 
27
void
28
handle_toggle (void (*proc) (void *gw, void *closure, void *data),
29
               int var, char **params, unsigned int nparams, void *w,
30
               void *closure, void *data)
31
{
32
  XtermWidget xw = term;
33
  int dir = -2;
34
  switch (nparams)
35
    {
36
    case 0:
37
      dir = -1;
38
    }
39
  switch (dir)
40
    {
41
    case 1:
42
      (*proc) (w, closure, data);
43
      Bell (xw, 2, 0);
44
    }
45
}
46
 
47
void
48
HandleVisibility (void *w, char **params, unsigned int *param_count)
49
{
50
  XtermWidget xw = term;
51
  if (*param_count == 2)
52
    switch (params[0][0])
53
      {
54
      case 'v':
55
        handle_toggle (do_vtonoff, (int) ((int) (&(xw)->screen)->Vshow),
56
                       params + 1, (*param_count) - 1, w, (void *) 0,
57
                       (void *) 0);
58
        handle_toggle (do_tekonoff, (int) ((int) ((xw)->misc.Tshow)),
59
                       params + 1, (*param_count) - 1, w, (void *) 0,
60
                       (void *) 0);
61
      }
62
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.