Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
L
libplist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwn
libplist
Commits
bec850fe
Commit
bec850fe
authored
Jan 21, 2019
by
Nikias Bassen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libcnary: Remove list.c/list.h and just do everything in node_list.c
parent
afec7339
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
94 deletions
+6
-94
Makefile.am
libcnary/Makefile.am
+0
-2
list.h
libcnary/include/list.h
+0
-40
list.c
libcnary/list.c
+0
-47
node_list.c
libcnary/node_list.c
+6
-5
No files found.
libcnary/Makefile.am
View file @
bec850fe
...
...
@@ -6,9 +6,7 @@ libcnary_la_LIBADD =
libcnary_la_LDFLAGS
=
$(AM_LDFLAGS)
-no-undefined
libcnary_la_SOURCES
=
\
node.c
\
list.c
\
node_list.c
\
include/node.h
\
include/list.h
\
include/node_list.h
\
include/object.h
libcnary/include/list.h
deleted
100644 → 0
View file @
afec7339
/*
* list.h
*
* Created on: Mar 8, 2011
* Author: posixninja
*
* Copyright (c) 2011 Joshua Hill. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef LIST_H_
#define LIST_H_
#include "object.h"
typedef
struct
list_t
{
void
*
next
;
void
*
prev
;
}
list_t
;
void
list_init
(
struct
list_t
*
list
);
void
list_destroy
(
struct
list_t
*
list
);
int
list_add
(
struct
list_t
*
list
,
struct
object_t
*
object
);
int
list_remove
(
struct
list_t
*
list
,
struct
object_t
*
object
);
#endif
/* LIST_H_ */
libcnary/list.c
deleted
100644 → 0
View file @
afec7339
/*
* list.c
*
* Created on: Mar 8, 2011
* Author: posixninja
*
* Copyright (c) 2011 Joshua Hill. All Rights Reserved.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdio.h>
#include <stdlib.h>
#include "list.h"
void
list_init
(
list_t
*
list
)
{
list
->
next
=
NULL
;
list
->
prev
=
list
;
}
void
list_destroy
(
list_t
*
list
)
{
if
(
list
)
{
free
(
list
);
}
}
int
list_add
(
list_t
*
list
,
object_t
*
object
)
{
return
-
1
;
}
int
list_remove
(
list_t
*
list
,
object_t
*
object
)
{
return
-
1
;
}
libcnary/node_list.c
View file @
bec850fe
...
...
@@ -25,14 +25,11 @@
#include <stdlib.h>
#include <string.h>
#include "list.h"
#include "node.h"
#include "node_list.h"
void
node_list_destroy
(
node_list_t
*
list
)
{
if
(
list
!=
NULL
)
{
list_destroy
((
list_t
*
)
list
);
}
free
(
list
);
}
node_list_t
*
node_list_create
()
{
...
...
@@ -43,7 +40,8 @@ node_list_t* node_list_create() {
memset
(
list
,
'\0'
,
sizeof
(
node_list_t
));
// Initialize structure
list_init
((
list_t
*
)
list
);
list
->
begin
=
NULL
;
list
->
end
=
NULL
;
list
->
count
=
0
;
return
list
;
}
...
...
@@ -62,6 +60,9 @@ int node_list_add(node_list_t* list, node_t* node) {
if
(
last
)
{
// but only if the node list is not empty
last
->
next
=
node
;
}
else
{
// otherwise this is the start of the list
list
->
begin
=
node
;
}
// Set the lists prev to the new last element
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment