TekUserUnixRO.cpp

00001 /***************************************************************************
00002  *   Copyright (C) 2005 by Kevin McBride                                   *
00003  *   kevin@planetsaphire.com                                               *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Library General Public License as       *
00007  *   published by the Free Software Foundation; either version 2 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Library General Public     *
00016  *   License along with this program; if not, write to the                 *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 
00022 #define LIBTEKLTI_EXPORT (1)
00023 
00024 #ifndef _cplusplus
00025 #define _cplusplus
00026 #endif /* _cplusplus */
00027 
00028 #include "teklti.h"
00029 
00030 MKTEKUUID(UTekUserUnixRO, "EF449EEC-3E85-11DA-80BC-000BDBC434D9")
00031 MKTEKDEBUGSTRING(DBTekUserUnixRO, "TekUserUnixRO")
00032 
00033 
00042 TekUserUnixRO::TekUserUnixRO()
00043 {
00044       TEKSTD_IMPLEMENT_INTERFACE(UTekUser)
00045       TEKSTD_IMPLEMENT_INTERFACE(UTekUserUnixRO)
00046       TEKSTD_IMPLEMENT_ENDBASE
00047 }
00048 
00052 TekUserUnixRO::~TekUserUnixRO()
00053 {
00054       if ( this->Priv_UserInfo.TekUserInfo_Description != NULL )
00055             ucharempty(this->Priv_UserInfo.TekUserInfo_Description);
00056       if ( this->Priv_UserInfo.TekUserInfo_Username != NULL )
00057             ucharempty(this->Priv_UserInfo.TekUserInfo_Username);
00058       if ( this->Priv_UserInfo.TekUserInfo_HomeDir != NULL )
00059             ucharempty(this->Priv_UserInfo.TekUserInfo_HomeDir);
00060 }
00061 
00062 
00068 TEKERR TekUserUnixRO::put_TekUserInfo(struct TekUserInfo * SUInfo)
00069 {
00070 #ifndef     NO_SIZE_T_CHECKS
00071       if ( SUInfo == NULL )
00072             return TEKERR_POINTER;
00073 #endif      /* NO_SIZE_T_CHECKS */
00074 
00075       memcpy(&this->Priv_UserInfo, SUInfo, sizeof(struct TekUserInfo));
00076 
00077       return TEKERR_OK;
00078 }
00079 
00085 TEKERR TekUserUnixRO::get_Description(uchar_t** RetVal)
00086 {
00087 #ifndef     NO_SIZE_T_CHECKS
00088       if ( RetVal == NULL )
00089             return TEKERR_POINTER;
00090 #endif      /* NO_SIZE_T_CHECKS */
00091 
00092       /* Duplicate the uchar. */
00093       *RetVal = uchardup(this->Priv_UserInfo.TekUserInfo_Description);
00094 
00095       /* Return to caller. */
00096       return TEKERR_OK;
00097 }
00098 
00104 TEKERR TekUserUnixRO::get_GroupID(gid_t* RetVal)
00105 {
00106 #ifndef     NO_SIZE_T_CHECKS
00107       if ( RetVal == NULL )
00108             return TEKERR_POINTER;
00109 #endif      /* NO_SIZE_T_CHECKS */
00110 
00111       /* Set the group ID. */
00112       *RetVal = this->Priv_UserInfo.TekUserInfo_GroupID;
00113 
00114       /* Return to caller. */
00115       return TEKERR_OK;
00116 }
00117 
00123 TEKERR TekUserUnixRO::get_HomeDir(uchar_t** RetVal)
00124 {
00125 #ifndef     NO_SIZE_T_CHECKS
00126       if ( RetVal == NULL )
00127             return TEKERR_POINTER;
00128 #endif      /* NO_SIZE_T_CHECKS */
00129 
00130       /* Duplicate the uchar. */
00131       *RetVal = uchardup(this->Priv_UserInfo.TekUserInfo_HomeDir);
00132 
00133       /* Return to caller. */
00134       return TEKERR_OK;
00135 }
00136 
00142 TEKERR TekUserUnixRO::get_UserID(uid_t* RetVal)
00143 {
00144 #ifndef     NO_SIZE_T_CHECKS
00145       if ( RetVal == NULL )
00146             return TEKERR_POINTER;
00147 #endif      /* NO_SIZE_T_CHECKS */
00148 }
00149 
00155 TEKERR TekUserUnixRO::get_Username(uchar_t** RetVal)
00156 {
00157 #ifndef     NO_SIZE_T_CHECKS
00158       if ( RetVal == NULL )
00159             return TEKERR_POINTER;
00160 #endif      /* NO_SIZE_T_CHECKS */
00161 
00162       /* Duplicate the uchar. */
00163       *RetVal = uchardup(this->Priv_UserInfo.TekUserInfo_Username);
00164 
00165       /* Return to caller. */
00166       return TEKERR_OK;
00167 }
00168 
00174 TEKERR TekUserUnixRO::put_Description(const uchar_t* NewDescription)
00175 {
00176       return TEKERR_NOTIMPL;
00177 }
00178 
00184 TEKERR TekUserUnixRO::put_GroupID(gid_t NewGroupID)
00185 
00186 {
00187       return TEKERR_NOTIMPL;
00188 }
00189 
00190 
00196 TEKERR TekUserUnixRO::put_HomeDir(const uchar_t* NewHomeDir)
00197 
00198 {
00199       return TEKERR_NOTIMPL;
00200 }
00201 
00202 
00208 TEKERR TekUserUnixRO::put_Password(uchar_t* NewPassword)
00209 
00210 {
00211       return TEKERR_NOTIMPL;
00212 }
00213 
00214 
00220 TEKERR TekUserUnixRO::put_UserID(uid_t NewID)
00221 
00222 {
00223       return TEKERR_NOTIMPL;
00224 }
00225 
00226 
00232 TEKERR TekUserUnixRO::put_Username(const uchar_t* NewUsername)
00233 {
00234       return TEKERR_NOTIMPL;
00235 }
00236 
00242 TEKERR TekUserUnixRO::Save()
00243 {
00244       return TEKERR_NOTIMPL;
00245 }
00246 
SourceForge.net Logo  Technical Library Template Interface Project Page