kpilot/lib
pilotStruct.cc
00001 /* pilotStruct.cc 00002 ** 00003 ** Copyright (C) 1998-2001 by Dan Pilone 00004 ** Copyright (C) 2003 by Reinhold Kainhofer 00005 ** Copyright (C) 2005 by Adriaan de Groot <groot@kde.org> 00006 ** 00007 ** Implementation for PilotUser and PilotSysInfo methods. 00008 ** 00009 ** Wrapper for the PilotUser struct from pilot-link, which describes 00010 ** the user-data set in the Pilot. 00011 */ 00012 00013 /* 00014 ** This program is free software; you can redistribute it and/or modify 00015 ** it under the terms of the GNU Lesser General Public License as published by 00016 ** the Free Software Foundation; either version 2.1 of the License, or 00017 ** (at your option) any later version. 00018 ** 00019 ** This program is distributed in the hope that it will be useful, 00020 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 ** GNU Lesser General Public License for more details. 00023 ** 00024 ** You should have received a copy of the GNU Lesser General Public License 00025 ** along with this program in a file called COPYING; if not, write to 00026 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00027 ** MA 02110-1301, USA. 00028 */ 00029 00030 #include <config.h> 00031 #include "options.h" 00032 #include "fakes.h" 00033 00034 #include "pilotUser.h" 00035 #include "pilotSysInfo.h" 00036 00037 00038 00039 void KPilotSysInfo::setProductID(const char *prodid) 00040 { 00041 strlcpy(fSysInfo.prodID, prodid, sizeof(fSysInfo.prodID)); 00042 boundsCheck(); 00043 fSysInfo.prodIDLength = strlen(fSysInfo.prodID); 00044 } 00045 00046 void KPilotUser::setUserName(const char *name) 00047 { 00048 memset(&fUser.username, 0, sizeof(fUser.username)); 00049 strlcpy(fUser.username, name,sizeof(fUser.username)); 00050 } 00051 00052 void KPilotUser::setPassword(const char *password) 00053 { 00054 memset(&fUser.password, 0, sizeof(fUser.password)); 00055 strlcpy(fUser.password, password,sizeof(fUser.password)); 00056 fUser.passwordLength = strlen(fUser.password); 00057 } 00058