/*
Winbind client API
Copyright (C) Gerald (Jerry) Carter 2007
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 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
Library General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/* Required Headers */
#include "libwbclient.h"
/** @brief Translate an error value into a string
*
* @param error
*
* @return a pointer to a static string
**/
{
switch (error) {
case WBC_ERR_SUCCESS:
return "WBC_ERR_SUCCESS";
case WBC_ERR_NOT_IMPLEMENTED:
return "WBC_ERR_NOT_IMPLEMENTED";
case WBC_ERR_UNKNOWN_FAILURE:
return "WBC_ERR_UNKNOWN_FAILURE";
case WBC_ERR_NO_MEMORY:
return "WBC_ERR_NO_MEMORY";
case WBC_ERR_INVALID_SID:
return "WBC_ERR_INVALID_SID";
case WBC_ERR_INVALID_PARAM:
return "WBC_ERR_INVALID_PARAM";
return "WBC_ERR_WINBIND_NOT_AVAILABLE";
case WBC_ERR_DOMAIN_NOT_FOUND:
return "WBC_ERR_DOMAIN_NOT_FOUND";
case WBC_ERR_INVALID_RESPONSE:
return "WBC_ERR_INVALID_RESPONSE";
case WBC_ERR_NSS_ERROR:
return "WBC_ERR_NSS_ERROR";
case WBC_ERR_UNKNOWN_USER:
return "WBC_ERR_UNKNOWN_USER";
case WBC_ERR_UNKNOWN_GROUP:
return "WBC_ERR_UNKNOWN_GROUP";
case WBC_ERR_AUTH_ERROR:
return "WBC_ERR_AUTH_ERROR";
return "WBC_ERR_PWD_CHANGE_FAILED";
}
return "unknown wbcErr value";
}
struct wbcMemPrefix {
};
{
}
{
}
void (*destructor)(void *ptr))
{
/* basic protection against integer wrap */
return NULL;
}
return NULL;
}
return ((char *)result) + wbcPrefixLen();
}
/* Free library allocated memory */
void wbcFreeMemory(void *p)
{
if (p == NULL) {
return;
}
wbcMem = wbcMemToPrefix(p);
return;
}
/* paranoid check to ensure we don't double free */
wbcMem->destructor(p);
}
return;
}
{
char *result;
return NULL;
}
return result;
}
{
char **p = (char **)ptr;
while (*p != NULL) {
free(*p);
p += 1;
}
}
{
return (const char **)wbcAllocateMemory(
num_strings + 1, sizeof(const char *),
}
{
return WBC_ERR_NO_MEMORY;
}
return WBC_ERR_SUCCESS;
}