Sweden-Number/programs/reg/export.c

61 lines
1.6 KiB
C
Raw Normal View History

/*
* Copyright 2017 Hugh McMaster
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <windows.h>
#include <wine/unicode.h>
#include <wine/debug.h>
#include "reg.h"
WINE_DEFAULT_DEBUG_CHANNEL(reg);
static BOOL is_overwrite_switch(const WCHAR *s)
{
if (strlenW(s) > 2)
return FALSE;
if ((s[0] == '/' || s[0] == '-') && (s[1] == 'y' || s[1] == 'Y'))
return TRUE;
return FALSE;
}
int reg_export(int argc, WCHAR *argv[])
{
HKEY root;
WCHAR *path, *long_key;
if (argc == 3 || argc > 5)
goto error;
if (!parse_registry_key(argv[2], &root, &path, &long_key))
return 1;
if (argc == 5 && !is_overwrite_switch(argv[4]))
goto error;
FIXME(": operation not yet implemented\n");
return 1;
error:
output_message(STRING_INVALID_SYNTAX);
output_message(STRING_FUNC_HELP, struprW(argv[1]));
return 1;
}