File: php_uploadprogress.h

package info (click to toggle)
php-uploadprogress 1.0.3.1-4-g95d8a0f-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 156 kB
  • sloc: ansic: 427; php: 65; xml: 65; makefile: 1
file content (113 lines) | stat: -rw-r--r-- 3,505 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
/*
  +----------------------------------------------------------------------+
  | Uploadprogress extension                                             |
  +----------------------------------------------------------------------+
  | Copyright (c) 2006-2008 The PHP Group                                |
  +----------------------------------------------------------------------+
  | This source file is subject to version 3.01 of the PHP license,      |
  | that is bundled with this package in the file LICENSE, and is        |
  | available through the world-wide-web at the following url:           |
  | http://www.php.net/license/3_01.txt.                                 |
  | If you did not receive a copy of the PHP license and are unable to   |
  | obtain it through the world-wide-web, please send a note to          |
  | license@php.net so we can mail you a copy immediately.               |
  +----------------------------------------------------------------------+
  | Author: Christian Stocker (chregu@liip.ch)                           |
  |  Derived from: Doru Petrescu (pdoru-php-upm@kappa.ro)                |
  |                http://pdoru.from.ro/upload-progress-meter/           |
  +----------------------------------------------------------------------+
*/

/* $Id$ */

#ifndef PHP_UPLOADPROGRESS_H
#define PHP_UPLOADPROGRESS_H

#ifdef  __cplusplus
extern "C" {
#endif

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <php.h>

#ifdef HAVE_UPLOADPROGRESS

#include <php_ini.h>
#include <SAPI.h>
#include <ext/standard/info.h>
#include <ext/standard/php_string.h>

#ifdef  __cplusplus
} // extern "C"
#endif
#ifdef  __cplusplus
extern "C" {
#endif

extern zend_module_entry uploadprogress_module_entry;
#define phpext_uploadprogress_ptr &uploadprogress_module_entry

#define PHP_UPLOADPROGRESS_VERSION "1.0.3.1"

#ifdef PHP_WIN32
#define PHP_UPLOADPROGRESS_API __declspec(dllexport)
#else
#define PHP_UPLOADPROGRESS_API
#endif

typedef struct _uploadprogress_data {
    char * identifier;        /* full filename, or just the identifier, depending on method */
    char * identifier_tmp;        /* full filename, or just the identifier, depending on method */
	char * upload_id;         /* raw string of the UPLOAD_IDENTIFIER */
	char * data_filename;     /* full filename of temporary data file */
	char * fieldname;		  /* name of form field for current file being uploaded */
	char * filename;		  /* filename of the uploaded file */
    time_t time_start;
    time_t time_last;
    unsigned int  speed_average;
    unsigned int  speed_last;
    unsigned long bytes_uploaded;
    unsigned long bytes_total;
    unsigned int  files_uploaded;
    int  est_sec;
} uploadprogress_data;


static char * uploadprogress_mk_filename(char * identifier, char * template);

static void uploadprogress_file_php_get_info(char *, zval * );
static void uploadprogress_file_php_get_contents(char *, char *, long, zval *);

PHP_MINIT_FUNCTION(uploadprogress);
PHP_MSHUTDOWN_FUNCTION(uploadprogress);
PHP_RINIT_FUNCTION(uploadprogress);
PHP_RSHUTDOWN_FUNCTION(uploadprogress);
PHP_MINFO_FUNCTION(uploadprogress);

#ifdef ZTS
#include "TSRM.h"
#endif


PHP_FUNCTION(uploadprogress_get_info);
PHP_FUNCTION(uploadprogress_get_contents);
#ifdef  __cplusplus
} // extern "C"
#endif

#endif /* PHP_HAVE_UPLOADPROGRESS */

#endif /* PHP_UPLOADPROGRESS_H */


/*
 * Local variables:
 * tab-width: 4
 * c-basic-offset: 4
 * End:
 * vim600: noet sw=4 ts=4 fdm=marker
 * vim<600: noet sw=4 ts=4
 */