STASIS
A pipeline delivery generator
Loading...
Searching...
No Matches
wheel.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fnmatch.h>
#include <zip.h>
Include dependency graph for wheel.h:

Go to the source code of this file.

Data Structures

struct  WheelMetadata_ProvidesExtra
 
struct  WheelMetadata
 
struct  WheelRecord
 
struct  WheelEntryPoint
 
struct  Wheel
 
struct  WheelValue
 

Macros

#define WHEEL_MAXELEM   255
 
#define WHEEL_FROM_DIST   0
 
#define WHEEL_FROM_METADATA   1
 
#define METADATA_MULTILINE_PREFIX   " "
 
#define WHEEL_KEY_UNKNOWN   (-1)
 

Enumerations

enum  {
  WHEEL_META_METADATA_VERSION =0 , WHEEL_META_NAME , WHEEL_META_VERSION , WHEEL_META_AUTHOR ,
  WHEEL_META_AUTHOR_EMAIL , WHEEL_META_MAINTAINER , WHEEL_META_MAINTAINER_EMAIL , WHEEL_META_SUMMARY ,
  WHEEL_META_LICENSE , WHEEL_META_LICENSE_EXPRESSION , WHEEL_META_LICENSE_FILE , WHEEL_META_HOME_PAGE ,
  WHEEL_META_DOWNLOAD_URL , WHEEL_META_PROJECT_URL , WHEEL_META_CLASSIFIER , WHEEL_META_REQUIRES_PYTHON ,
  WHEEL_META_REQUIRES_EXTERNAL , WHEEL_META_IMPORT_NAME , WHEEL_META_IMPORT_NAMESPACE , WHEEL_META_REQUIRES_DIST ,
  WHEEL_META_PROVIDES , WHEEL_META_PROVIDES_DIST , WHEEL_META_PROVIDES_EXTRA , WHEEL_META_OBSOLETES ,
  WHEEL_META_OBSOLETES_DIST , WHEEL_META_PLATFORM , WHEEL_META_SUPPORTED_PLATFORM , WHEEL_META_KEYWORDS ,
  WHEEL_META_DYNAMIC , WHEEL_META_DESCRIPTION_CONTENT_TYPE , WHEEL_META_DESCRIPTION , WHEEL_META_END_ENUM
}
 
enum  {
  WHEEL_DIST_VERSION =0 , WHEEL_DIST_GENERATOR , WHEEL_DIST_ROOT_IS_PURELIB , WHEEL_DIST_TAG ,
  WHEEL_DIST_ZIP_SAFE , WHEEL_DIST_TOP_LEVEL , WHEEL_DIST_ENTRY_POINT , WHEEL_DIST_RECORD ,
  WHEEL_DIST_END_ENUM
}
 
enum  {
  WHEELVAL_STR = 0 , WHEELVAL_STRLIST , WHEELVAL_OBJ_EXTRA , WHEELVAL_OBJ_RECORD ,
  WHEELVAL_OBJ_ENTRY_POINT
}
 
enum  {
  WHEEL_PACKAGE_E_SUCCESS =0 , WHEEL_PACKAGE_E_FILENAME =-1 , WHEEL_PACKAGE_E_ALLOC =-2 , WHEEL_PACKAGE_E_GET =-3 ,
  WHEEL_PACKAGE_E_GET_METADATA =-4 , WHEEL_PACKAGE_E_GET_TOP_LEVEL =-5 , WHEEL_PACKAGE_E_GET_RECORDS =-6 , WHEEL_PACKAGE_E_GET_ENTRY_POINT =-7
}
 

Functions

int wheel_package (struct Wheel **pkg, const char *filename)
 
void wheel_package_free (struct Wheel **pkg)
 
struct WheelValue wheel_get_value_by_name (const struct Wheel *pkg, int from, const char *key)
 
struct WheelValue wheel_get_value_by_id (const struct Wheel *pkg, int from, ssize_t id)
 
int wheel_value_error (struct WheelValue const *val)
 
const char * wheel_get_key_by_id (int from, ssize_t id)
 
int wheel_get_file_contents (const char *wheelfile, const char *filename, char **contents)
 
int wheel_show_info (const struct Wheel *wheel)
 

Function Documentation

◆ wheel_get_file_contents()

int wheel_get_file_contents ( const char * wheelfile,
const char * filename,
char ** contents )

Get the contents of a file within a Python wheel

Parameters
wheelfilepath to Python wheel file
filenamepath to file inside of wheel file archive
contentspointer to store file contents
Returns
0 on success, -1 on error

◆ wheel_get_key_by_id()

const char * wheel_get_key_by_id ( int from,
ssize_t id )

Retreive the key name string for a given id

Parameters
fromWHEEL_FROM_DIST, WHEEL_FROM_META
idWHEEL_META_VERSION, WHEEL_DIST_VERSION (see wheel.h)
Returns
the key name, or NULL

◆ wheel_get_value_by_id()

struct WheelValue wheel_get_value_by_id ( const struct Wheel * pkg,
int from,
ssize_t id )

Get wheel data by internal identifier

Parameters
pkgpointer to an initialized Wheel
fromWHEEL_FROM_DIST, WHEEL_FROM_META
idWHEEL_META_VERSION, WHEEL_DIST_VERSION (see wheel.h)
Returns
a populated WheelValue (stack)
Here is the call graph for this function:

◆ wheel_get_value_by_name()

struct WheelValue wheel_get_value_by_name ( const struct Wheel * pkg,
int from,
const char * key )

Get wheel data by name

Parameters
pkgpointer to an initialized Wheel
fromWHEEL_FROM_DIST, WHEEL_FROM_META
keyname of key in DIST or META data
Returns
a populated WheelValue (stack)
Here is the call graph for this function:

◆ wheel_package()

int wheel_package ( struct Wheel ** pkg,
const char * filename )

Populate a Wheel structure using a Python wheel file as input.

Parameters
pkgpointer to a Wheel (may be initialized to NULL)
filenamepath to a Python wheel file
Returns
a WHEEL_PACKAGE_E_ error code
Here is the call graph for this function:

◆ wheel_package_free()

void wheel_package_free ( struct Wheel ** pkg)

Frees a Wheel structure

Parameters
pkgpointer to an initialized Wheel

◆ wheel_show_info()

int wheel_show_info ( const struct Wheel * wheel)

Display the values of a Wheel structure in human readable format

Parameters
wheel
Returns
0 on success, -1 on error
Here is the call graph for this function:

◆ wheel_value_error()

int wheel_value_error ( struct WheelValue const * val)

Returns the error code assocated with the WheelValue, if possible

Parameters
vala populated WheelValue
Returns
error code (see wheel.h)