1/*
2 *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
3 *Copyright (C) 2003-2004 Harold L Hunt II All Rights Reserved.
4 *Copyright (C) Colin Harrison 2005-2008
5 *
6 *Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 *"Software"), to deal in the Software without restriction, including
9 *without limitation the rights to use, copy, modify, merge, publish,
10 *distribute, sublicense, and/or sell copies of the Software, and to
11 *permit persons to whom the Software is furnished to do so, subject to
12 *the following conditions:
13 *
14 *The above copyright notice and this permission notice shall be
15 *included in all copies or substantial portions of the Software.
16 *
17 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 *NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
21 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 *Except as contained in this notice, the name of the copyright holder(s)
26 *and author(s) shall not be used in advertising or otherwise to promote
27 *the sale, use or other dealings in this Software without prior written
28 *authorization from the copyright holder(s) and author(s).
29 *
30 * Authors:	Harold L Hunt II
31 *              Colin Harrison
32 */
33
34#ifdef HAVE_XWIN_CONFIG_H
35#include <xwin-config.h>
36#endif
37
38#include <stdio.h>
39#include <stdlib.h>
40#include <string.h>
41
42#include "winclipboard.h"
43
44/*
45 * Main function
46 */
47
48int
49main (int argc, char *argv[])
50{
51  int			i;
52  char			*pszDisplay = NULL;
53
54  /* Parse command-line parameters */
55  for (i = 1; i < argc; ++i)
56    {
57      /* Look for -display "display_name" or --display "display_name" */
58      if (i < argc - 1
59	  && (!strcmp (argv[i], "-display")
60	      || !strcmp (argv[i], "--display")))
61	{
62	  /* Grab a pointer to the display parameter */
63	  pszDisplay = argv[i + 1];
64
65	  /* Skip the display argument */
66	  i++;
67	  continue;
68	}
69
70      /* Look for -noprimary */
71      if (!strcmp (argv[i], "-noprimary"))
72	{
73	  fPrimarySelection = 0;
74	  continue;
75	}
76
77      /* Yack when we find a parameter that we don't know about */
78      printf ("Unknown parameter: %s\nExiting.\n", argv[i]);
79      exit (1);
80    }
81
82  winClipboardProc(pszDisplay, NULL /* Use XAUTHORITY for auth data */);
83
84  return 0;
85}
86