Skip to content

Commit 75a765f

Browse files
committed
refactor: Merge all header files
Merge all header files except `constants_generated.h` into a single header file `pythonldap.h`. A single header file makes it far easier to port python-ldap to heap types and module state for Per-Interpreter GIL. `pythonldap.h` uses new macros `PYLDAP_FUNC` and `PYLDAP_DATA` to declare functions and data, which are used across C files. Remove unused macro `streq`. See: python-ldap#540 Signed-off-by: Christian Heimes <cheimes@redhat.com>
1 parent 1490e99 commit 75a765f

20 files changed

+149
-231
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ valgrind: build $(PYTHON_SUPP)
8989
autoformat: indent black
9090

9191
indent:
92-
indent Modules/*.c Modules/*.h
92+
indent Modules/*.c
93+
indent -npsl Modules/pythonldap.h
9394
rm -f Modules/*.c~ Modules/*.h~
9495

9596
black:

Modules/LDAPObject.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,10 @@
11
/* See https://www.python-ldap.org/ for details. */
22

3-
#include "common.h"
3+
#include "pythonldap.h"
44
#include "patchlevel.h"
55

66
#include <math.h>
77
#include <limits.h>
8-
#include "constants.h"
9-
#include "LDAPObject.h"
10-
#include "ldapcontrol.h"
11-
#include "message.h"
12-
#include "berval.h"
13-
#include "options.h"
148

159
#ifdef HAVE_SASL
1610
#include <sasl/sasl.h>

Modules/LDAPObject.h

Lines changed: 0 additions & 38 deletions
This file was deleted.

Modules/berval.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* See https://www.python-ldap.org/ for details. */
22

3-
#include "common.h"
4-
#include "berval.h"
3+
#include "pythonldap.h"
54

65
/*
76
* Copies out the data from a berval, and returns it as a new Python object,

Modules/berval.h

Lines changed: 0 additions & 11 deletions
This file was deleted.

Modules/common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* Miscellaneous common routines
22
* See https://www.python-ldap.org/ for details. */
33

4-
#include "common.h"
4+
#include "pythonldap.h"
55

66
/* dynamically add the methods into the module dictionary d */
77

Modules/common.h

Lines changed: 0 additions & 68 deletions
This file was deleted.

Modules/constants.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
/* constants defined for LDAP
22
* See https://www.python-ldap.org/ for details. */
33

4-
#include "common.h"
5-
#include "constants.h"
6-
#include "ldapcontrol.h"
4+
#include "pythonldap.h"
75

86
/* the base exception class */
97

Modules/constants.h

Lines changed: 0 additions & 24 deletions
This file was deleted.

Modules/functions.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
/* See https://www.python-ldap.org/ for details. */
22

3-
#include "common.h"
4-
#include "functions.h"
5-
#include "LDAPObject.h"
6-
#include "berval.h"
7-
#include "constants.h"
8-
#include "options.h"
3+
#include "pythonldap.h"
94

105
/* ldap_initialize */
116

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy