HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/django/contrib/gis/geos/__pycache__/libgeos.cpython-310.pyc
o

�a��@s8dZddlZddlZddlmZmZmZmZmZddl	m
Z
ddlmZddl
mZmZddlmZe�d�Zd	d
�Zedee�Zdd�Zee�Zedee�Zd
d�Zee�ZGdd�de�ZGdd�de�ZGdd�de�ZGdd�de�Zee�Zee�Zee�Zee�Z ee�Z!Gdd�d�Z"dd�Z#dd�Z$dS)a
 This module houses the ctypes initialization procedures, as well
 as the notice and error handler function callbacks (get called
 when an error occurs in GEOS).

 This module also houses GEOS Pointer utilities, including
 get_pointer_arr(), and GEOM_PTR.
�N)�CDLL�	CFUNCTYPE�POINTER�	Structure�c_char_p)�find_library)�ImproperlyConfigured)�SimpleLazyObject�cached_property)�get_version_tuplezdjango.contrib.giscCs�zddlm}|j}Wnttttfyd}Ynw|r d}ntjdkr*ddg}ntjdkr4ddg}ntdtj��|rL|D]}t	|�}|durKnq?|durYtd	d
�
|���t|�}t|j
_tg|j_t|j_|S)Nr)�settings�nt�geos_czlibgeos_c-1�posix�GEOSzUnsupported OS "%s"z]Could not find the GEOS library (tried "%s"). Try setting GEOS_LIBRARY_PATH in your settings.z", ")�django.confr�GEOS_LIBRARY_PATH�AttributeError�ImportErrorr�OSError�os�namer�joinr�CONTEXT_PTR�
initGEOS_r�restype�finishGEOS_r�argtypesr�GEOSversion)r�lib_path�	lib_names�lib_name�_lgeos�r#�A/usr/lib/python3/dist-packages/django/contrib/gis/geos/libgeos.py�	load_geoss<
�



���	
r%cC�F|��|��}}z||}Wnty|}Ynwt�d|�dS)NzGEOS_NOTICE: %s
)�decode�	TypeError�logger�warning)�fmt�lst�warn_msgr#r#r$�notice_hO��r.cCr&)NzGEOS_ERROR: %s
)r'r(r)�error)r+r,�err_msgr#r#r$�error_h]r/r2c@�eZdZdS)�
GEOSGeom_tN��__name__�
__module__�__qualname__r#r#r#r$r4l�r4c@r3)�GEOSPrepGeom_tNr5r#r#r#r$r:pr9r:c@r3)�GEOSCoordSeq_tNr5r#r#r#r$r;tr9r;c@r3)�GEOSContextHandle_tNr5r#r#r#r$r<xr9r<c@sBeZdZdZdZdZdZdddd�dd�Zdd�Ze	dd	��Z
dS)
�GEOSFuncFactoryz)
    Lazy loading of GEOS functions.
    N)r�errcheckrcCs8||_|dur
||_|dur||_|dur||_dSdS�N)�	func_namerr>r)�selfr@rr>rr#r#r$�__init__�s
�zGEOSFuncFactory.__init__cGs
|j|�Sr?)�func)rA�argsr#r#r$�__call__�s
zGEOSFuncFactory.__call__cCs<ddlm}||j�}|jpg|_|j|_|jr|j|_|S)Nr)�GEOSFunc)�-django.contrib.gis.geos.prototypes.threadsaferFr@rrr>)rArFrCr#r#r$rC�s
zGEOSFuncFactory.func)r6r7r8�__doc__rrr>rBrEr
rCr#r#r#r$r=�s	r=cCst��S)z.Return the string version of the GEOS library.)�lgeosrr#r#r#r$�geos_version�srJcCstt����S)z<Return the GEOS version as a tuple (major, minor, subminor).)rrJr'r#r#r#r$�geos_version_tuple�srK)%rH�loggingr�ctypesrrrrr�ctypes.utilr�django.core.exceptionsr�django.utils.functionalr	r
�django.utils.versionr�	getLoggerr)r%�
NOTICEFUNCr.�	ERRORFUNCr2r4r:r;r<�GEOM_PTR�PREPGEOM_PTR�CS_PTRrrIr=rJrKr#r#r#r$�<module>s8
7