tdnf/client/client.c

61 lines
1.2 KiB
C
Raw Normal View History

2015-04-02 09:59:27 +08:00
/*
* Copyright (C) 2015-2018 VMware, Inc. All Rights Reserved.
2015-04-16 05:10:08 +08:00
*
* Licensed under the GNU Lesser General Public License v2.1 (the "License");
* you may not use this file except in compliance with the License. The terms
* of the License are located in the COPYING file of this distribution.
*/
/*
* Module : client.c
*
* Abstract :
*
* tdnfclientlib
*
* client library
*
* Authors : Priyesh Padmavilasom (ppadmavilasom@vmware.com)
*/
2015-04-02 09:59:27 +08:00
#include "includes.h"
uint32_t
TDNFApplyScopeFilter(
PSolvQuery pQuery,
2015-04-02 09:59:27 +08:00
TDNF_SCOPE nScope
)
{
uint32_t dwError = 0;
if(!pQuery || nScope == SCOPE_NONE)
2015-04-02 09:59:27 +08:00
{
dwError = ERROR_TDNF_INVALID_PARAMETER;
BAIL_ON_TDNF_ERROR(dwError);
}
pQuery->nScope = nScope;
2015-04-02 09:59:27 +08:00
switch(nScope)
{
case SCOPE_INSTALLED:
dwError = SolvAddSystemRepoFilter(pQuery);
BAIL_ON_TDNF_ERROR(dwError);
2015-04-02 09:59:27 +08:00
break;
case SCOPE_AVAILABLE:
dwError = SolvAddAvailableRepoFilter(pQuery);
BAIL_ON_TDNF_ERROR(dwError);
break;
2015-04-02 09:59:27 +08:00
default:
break;
}
cleanup:
return dwError;
error:
goto cleanup;
}