From 0f7c35900c3efc1c746f830f9304ab09b1afbc7d Mon Sep 17 00:00:00 2001 From: dimitri staessens Date: Wed, 28 Dec 2016 14:41:09 +0100 Subject: ipcpd: Rename normal/path to normal/pathname --- src/ipcpd/normal/CMakeLists.txt | 2 +- src/ipcpd/normal/dir.c | 2 +- src/ipcpd/normal/fmgr.c | 2 +- src/ipcpd/normal/path.c | 76 ----------------------------------------- src/ipcpd/normal/path.h | 34 ------------------ src/ipcpd/normal/pathname.c | 76 +++++++++++++++++++++++++++++++++++++++++ src/ipcpd/normal/pathname.h | 34 ++++++++++++++++++ src/ipcpd/normal/pol/flat.c | 2 +- src/ipcpd/normal/ribmgr.c | 2 +- 9 files changed, 115 insertions(+), 115 deletions(-) delete mode 100644 src/ipcpd/normal/path.c delete mode 100644 src/ipcpd/normal/path.h create mode 100644 src/ipcpd/normal/pathname.c create mode 100644 src/ipcpd/normal/pathname.h diff --git a/src/ipcpd/normal/CMakeLists.txt b/src/ipcpd/normal/CMakeLists.txt index 5f85dd89..bdcb78ae 100644 --- a/src/ipcpd/normal/CMakeLists.txt +++ b/src/ipcpd/normal/CMakeLists.txt @@ -30,7 +30,7 @@ set(SOURCE_FILES fmgr.c frct.c main.c - path.c + pathname.c pff.c ribmgr.c shm_pci.c diff --git a/src/ipcpd/normal/dir.c b/src/ipcpd/normal/dir.c index 905af2ed..47fb1f6e 100644 --- a/src/ipcpd/normal/dir.c +++ b/src/ipcpd/normal/dir.c @@ -28,7 +28,7 @@ #include "dir.h" #include "ipcp.h" #include "ro.h" -#include "path.h" +#include "pathname.h" #include "ribmgr.h" #include diff --git a/src/ipcpd/normal/fmgr.c b/src/ipcpd/normal/fmgr.c index 7917d61a..f7737b82 100644 --- a/src/ipcpd/normal/fmgr.c +++ b/src/ipcpd/normal/fmgr.c @@ -40,7 +40,7 @@ #include "ipcp.h" #include "shm_pci.h" #include "dir.h" -#include "path.h" +#include "pathname.h" #include "ro.h" #include "flow_alloc.pb-c.h" diff --git a/src/ipcpd/normal/path.c b/src/ipcpd/normal/path.c deleted file mode 100644 index ebd5719c..00000000 --- a/src/ipcpd/normal/path.c +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - * - * Functions to construct pathnames - * - * Sander Vrijders - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#define OUROBOROS_PREFIX "pathnames" - -#include -#include -#include - -#include -#include -#include - -#include "path.h" - -char * pathname_create(const char * name) -{ - char * tmp; - - assert(name); - - tmp = malloc(strlen(name) + strlen(PATH_DELIMITER) + 1); - if (tmp == NULL) - return NULL; - - strcpy(tmp, PATH_DELIMITER); - strcat(tmp, name); - - return tmp; -} - -char * pathname_append(char * pname, - const char * name) -{ - char * tmp; - - assert(pname); - assert(name); - - tmp = malloc(strlen(pname) + - strlen(PATH_DELIMITER) + - strlen(name) + 1); - if (tmp == NULL) - return NULL; - - strcpy(tmp, pname); - strcat(tmp, PATH_DELIMITER); - strcat(tmp, name); - - free(pname); - - return tmp; -} - -void pathname_destroy(char * pname) -{ - free(pname); -} diff --git a/src/ipcpd/normal/path.h b/src/ipcpd/normal/path.h deleted file mode 100644 index 8689036f..00000000 --- a/src/ipcpd/normal/path.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Ouroboros - Copyright (C) 2016 - * - * Functions to construct pathnames - * - * Sander Vrijders - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef OUROBOROS_IPCPD_NORMAL_PATH_H -#define OUROBOROS_IPCPD_NORMAL_PATH_H - -#define PATH_DELIMITER "/" - -char * pathname_create(const char * name); - -char * pathname_append(char * pname, - const char * name); - -void pathname_destroy(char * pname); - -#endif /* OUROBOROS_IPCPD_NORMAL_PATH_H */ diff --git a/src/ipcpd/normal/pathname.c b/src/ipcpd/normal/pathname.c new file mode 100644 index 00000000..cf6e08b0 --- /dev/null +++ b/src/ipcpd/normal/pathname.c @@ -0,0 +1,76 @@ +/* + * Ouroboros - Copyright (C) 2016 + * + * Functions to construct pathnames + * + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#define OUROBOROS_PREFIX "pathnames" + +#include +#include +#include + +#include +#include +#include + +#include "pathname.h" + +char * pathname_create(const char * name) +{ + char * tmp; + + assert(name); + + tmp = malloc(strlen(name) + strlen(PATH_DELIMITER) + 1); + if (tmp == NULL) + return NULL; + + strcpy(tmp, PATH_DELIMITER); + strcat(tmp, name); + + return tmp; +} + +char * pathname_append(char * pname, + const char * name) +{ + char * tmp; + + assert(pname); + assert(name); + + tmp = malloc(strlen(pname) + + strlen(PATH_DELIMITER) + + strlen(name) + 1); + if (tmp == NULL) + return NULL; + + strcpy(tmp, pname); + strcat(tmp, PATH_DELIMITER); + strcat(tmp, name); + + free(pname); + + return tmp; +} + +void pathname_destroy(char * pname) +{ + free(pname); +} diff --git a/src/ipcpd/normal/pathname.h b/src/ipcpd/normal/pathname.h new file mode 100644 index 00000000..dc91b7d9 --- /dev/null +++ b/src/ipcpd/normal/pathname.h @@ -0,0 +1,34 @@ +/* + * Ouroboros - Copyright (C) 2016 + * + * Functions to construct pathnames + * + * Sander Vrijders + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef OUROBOROS_IPCPD_NORMAL_PATHNAME_H +#define OUROBOROS_IPCPD_NORMAL_PATHNAME_H + +#define PATH_DELIMITER "/" + +char * pathname_create(const char * name); + +char * pathname_append(char * pname, + const char * name); + +void pathname_destroy(char * pname); + +#endif /* OUROBOROS_IPCPD_NORMAL_PATHNAME_H */ diff --git a/src/ipcpd/normal/pol/flat.c b/src/ipcpd/normal/pol/flat.c index 82c7db93..13eaf215 100644 --- a/src/ipcpd/normal/pol/flat.c +++ b/src/ipcpd/normal/pol/flat.c @@ -29,7 +29,7 @@ #include "shm_pci.h" #include "ribmgr.h" #include "ro.h" -#include "path.h" +#include "pathname.h" #include #include diff --git a/src/ipcpd/normal/ribmgr.c b/src/ipcpd/normal/ribmgr.c index 15c3957f..d2ba8deb 100644 --- a/src/ipcpd/normal/ribmgr.c +++ b/src/ipcpd/normal/ribmgr.c @@ -42,7 +42,7 @@ #include "frct.h" #include "ipcp.h" #include "ro.h" -#include "path.h" +#include "pathname.h" #include "dir.h" #include "static_info.pb-c.h" -- cgit v1.2.3