diff --git a/CREDITS b/CREDITS
new file mode 100644
index 0000000..d308ae6
--- /dev/null
+++ b/CREDITS
@@ -0,0 +1 @@
+vanilla@FreeBSD.org
diff --git a/Doxyfile b/Doxyfile
new file mode 100644
index 0000000..e0fc24e
--- /dev/null
+++ b/Doxyfile
@@ -0,0 +1,167 @@
+PROJECT_NAME = php qrencode
+PROJECT_NUMBER = 0.1
+OUTPUT_DIRECTORY = docs
+#CREATE_SUBDIRS = NO
+#OUTPUT_LANGUAGE = Chinese-Traditional
+USE_WINDOWS_ENCODING = NO
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = YES
+INLINE_INHERITED_MEMB = YES
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = YES
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP = NO
+INHERIT_DOCS = YES
+DISTRIBUTE_GROUP_DOC = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = YES
+OPTIMIZE_OUTPUT_JAVA = NO
+SUBGROUPING = YES
+EXTRACT_ALL = YES
+EXTRACT_PRIVATE = YES
+EXTRACT_STATIC = YES
+EXTRACT_LOCAL_CLASSES = NO
+EXTRACT_LOCAL_METHODS = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = YES
+CASE_SENSE_NAMES = YES
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = NO
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_BY_SCOPE_NAME = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = YES
+FILE_VERSION_FILTER =
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = YES
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = NO
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE =
+INPUT = ./
+FILE_PATTERNS = *.c
+RECURSIVE = NO
+EXCLUDE = php
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER = ./generatedocs.pl
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION = YES
+VERBATIM_HEADERS = YES
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_ALIGN_MEMBERS = NO
+GENERATE_HTMLHELP = NO
+CHM_FILE =
+HHC_LOCATION =
+GENERATE_CHI = NO
+BINARY_TOC = NO
+TOC_EXPAND = NO
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+TREEVIEW_WIDTH = 250
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4wide
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = NO
+USE_PDFLATEX = NO
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = YES
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+GENERATE_AUTOGEN_DEF = NO
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = NO
+EXPAND_ONLY_PREDEF = YES
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = "PHP_FUNCTION"
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/local/bin/perl
+CLASS_DIAGRAMS = YES
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = YES
+TEMPLATE_RELATIONS = YES
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MAX_DOT_GRAPH_WIDTH = 1024
+MAX_DOT_GRAPH_HEIGHT = 1024
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+SEARCHENGINE = NO
diff --git a/README b/README
new file mode 100644
index 0000000..2056027
--- /dev/null
+++ b/README
@@ -0,0 +1,21 @@
+php qrencode is the wrapper of libqrencode to generate qr code.
+
+only 2 function to generate qr code.
+
+
+$qr = qr_encode ('test for qrcode');
+qr_save ($qr, '1.png');
+
+
+or you can output direct to stdout.
+
+
+$qr = qr_encode ('test for qrcode');
+header ("Content-type: image/PNG");
+qr_save ($qr);
+
+
+resource = qr_encode (string $text, [ int $version, int $mode, int $casesensitive]);
+
+bool = qr_save (resource $qr, [ string $filename] );
+
diff --git a/config.m4 b/config.m4
new file mode 100644
index 0000000..a395829
--- /dev/null
+++ b/config.m4
@@ -0,0 +1,35 @@
+dnl $Id: config.m4,v 1.1 2007/03/29 08:58:11 vanilla Exp $
+dnl config.m4 for extension qrencode
+
+PHP_ARG_WITH(qrencode, for qrencode support,
+Make sure that the comment is aligned:
+[ --with-qrencode Include qrencode support])
+
+if test "$PHP_QRENCODE" != "no"; then
+ # --with-qrencode -> check with-path
+ SEARCH_PATH="/usr/local /usr" # you might want to change this
+ SEARCH_FOR="/include/qrencode.h" # you most likely want to change this
+ if test -r $PHP_QRENCODE/$SEARCH_FOR; then # path given as parameter
+ QRENCODE_DIR=$PHP_QRENCODE
+ else # search default path list
+ AC_MSG_CHECKING([for qrencode files in default path])
+ for i in $SEARCH_PATH ; do
+ if test -r $i/$SEARCH_FOR; then
+ QRENCODE_DIR=$i
+ AC_MSG_RESULT(found in $i)
+ fi
+ done
+ fi
+
+ if test -z "$QRENCODE_DIR"; then
+ AC_MSG_RESULT([not found])
+ AC_MSG_ERROR([Please reinstall the qrencode distribution])
+ fi
+
+ PHP_ADD_INCLUDE($QRENCODE_DIR/include)
+
+ PHP_SUBST(QRENCODE_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(png, $QRENCODE_DIR/lib, QRENCODE_SHARED_LIBADD)
+ PHP_ADD_LIBRARY_WITH_PATH(qrencode, $QRENCODE_DIR/lib, QRENCODE_SHARED_LIBADD)
+ PHP_NEW_EXTENSION(qrencode, qrencode.c, $ext_shared)
+fi
diff --git a/docs/html/annotated.html b/docs/html/annotated.html
new file mode 100644
index 0000000..c23c274
--- /dev/null
+++ b/docs/html/annotated.html
@@ -0,0 +1,27 @@
+
+
+phpqrencode: Class List
+
+
+
+
+
+
+phpqrencode Class List
Here are the classes, structs, unions and interfaces with brief descriptions:
+
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/classes.html b/docs/html/classes.html
new file mode 100644
index 0000000..fc4eb73
--- /dev/null
+++ b/docs/html/classes.html
@@ -0,0 +1,28 @@
+
+
+phpqrencode: Alphabetical List
+
+
+
+
+
+
+phpqrencode Class Index
+
+
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css
new file mode 100644
index 0000000..c7db1a8
--- /dev/null
+++ b/docs/html/doxygen.css
@@ -0,0 +1,358 @@
+BODY,H1,H2,H3,H4,H5,H6,P,CENTER,TD,TH,UL,DL,DIV {
+ font-family: Geneva, Arial, Helvetica, sans-serif;
+}
+BODY,TD {
+ font-size: 90%;
+}
+H1 {
+ text-align: center;
+ font-size: 160%;
+}
+H2 {
+ font-size: 120%;
+}
+H3 {
+ font-size: 100%;
+}
+CAPTION { font-weight: bold }
+DIV.qindex {
+ width: 100%;
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ line-height: 140%;
+}
+DIV.nav {
+ width: 100%;
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ padding: 2px;
+ line-height: 140%;
+}
+DIV.navtab {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+TD.navtab {
+ font-size: 70%;
+}
+A.qindex {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D;
+}
+A.qindex:visited {
+ text-decoration: none;
+ font-weight: bold;
+ color: #1A419D
+}
+A.qindex:hover {
+ text-decoration: none;
+ background-color: #ddddff;
+}
+A.qindexHL {
+ text-decoration: none;
+ font-weight: bold;
+ background-color: #6666cc;
+ color: #ffffff;
+ border: 1px double #9295C2;
+}
+A.qindexHL:hover {
+ text-decoration: none;
+ background-color: #6666cc;
+ color: #ffffff;
+}
+A.qindexHL:visited { text-decoration: none; background-color: #6666cc; color: #ffffff }
+A.el { text-decoration: none; font-weight: bold }
+A.elRef { font-weight: bold }
+A.code:link { text-decoration: none; font-weight: normal; color: #0000FF}
+A.code:visited { text-decoration: none; font-weight: normal; color: #0000FF}
+A.codeRef:link { font-weight: normal; color: #0000FF}
+A.codeRef:visited { font-weight: normal; color: #0000FF}
+A:hover { text-decoration: none; background-color: #f2f2ff }
+DL.el { margin-left: -1cm }
+.fragment {
+ font-family: monospace, fixed;
+ font-size: 95%;
+}
+PRE.fragment {
+ border: 1px solid #CCCCCC;
+ background-color: #f5f5f5;
+ margin-top: 4px;
+ margin-bottom: 4px;
+ margin-left: 2px;
+ margin-right: 8px;
+ padding-left: 6px;
+ padding-right: 6px;
+ padding-top: 4px;
+ padding-bottom: 4px;
+}
+DIV.ah { background-color: black; font-weight: bold; color: #ffffff; margin-bottom: 3px; margin-top: 3px }
+
+DIV.groupHeader {
+ margin-left: 16px;
+ margin-top: 12px;
+ margin-bottom: 6px;
+ font-weight: bold;
+}
+DIV.groupText { margin-left: 16px; font-style: italic; font-size: 90% }
+BODY {
+ background: white;
+ color: black;
+ margin-right: 20px;
+ margin-left: 20px;
+}
+TD.indexkey {
+ background-color: #e8eef2;
+ font-weight: bold;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
+}
+TD.indexvalue {
+ background-color: #e8eef2;
+ font-style: italic;
+ padding-right : 10px;
+ padding-top : 2px;
+ padding-left : 10px;
+ padding-bottom : 2px;
+ margin-left : 0px;
+ margin-right : 0px;
+ margin-top : 2px;
+ margin-bottom : 2px;
+ border: 1px solid #CCCCCC;
+}
+TR.memlist {
+ background-color: #f0f0f0;
+}
+P.formulaDsp { text-align: center; }
+IMG.formulaDsp { }
+IMG.formulaInl { vertical-align: middle; }
+SPAN.keyword { color: #008000 }
+SPAN.keywordtype { color: #604020 }
+SPAN.keywordflow { color: #e08000 }
+SPAN.comment { color: #800000 }
+SPAN.preprocessor { color: #806020 }
+SPAN.stringliteral { color: #002080 }
+SPAN.charliteral { color: #008080 }
+.mdescLeft {
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
+ font-style: italic;
+ background-color: #FAFAFA;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.mdescRight {
+ padding: 0px 8px 4px 8px;
+ font-size: 80%;
+ font-style: italic;
+ background-color: #FAFAFA;
+ border-top: 1px none #E0E0E0;
+ border-right: 1px none #E0E0E0;
+ border-bottom: 1px none #E0E0E0;
+ border-left: 1px none #E0E0E0;
+ margin: 0px;
+}
+.memItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplItemLeft {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: none;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplItemRight {
+ padding: 1px 8px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: none;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.memTemplParams {
+ padding: 1px 0px 0px 8px;
+ margin: 4px;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ border-top-color: #E0E0E0;
+ border-right-color: #E0E0E0;
+ border-bottom-color: #E0E0E0;
+ border-left-color: #E0E0E0;
+ border-top-style: solid;
+ border-right-style: none;
+ border-bottom-style: none;
+ border-left-style: none;
+ color: #606060;
+ background-color: #FAFAFA;
+ font-size: 80%;
+}
+.search { color: #003399;
+ font-weight: bold;
+}
+FORM.search {
+ margin-bottom: 0px;
+ margin-top: 0px;
+}
+INPUT.search { font-size: 75%;
+ color: #000080;
+ font-weight: normal;
+ background-color: #e8eef2;
+}
+TD.tiny { font-size: 75%;
+}
+a {
+ color: #1A41A8;
+}
+a:visited {
+ color: #2A3798;
+}
+.dirtab { padding: 4px;
+ border-collapse: collapse;
+ border: 1px solid #84b0c7;
+}
+TH.dirtab { background: #e8eef2;
+ font-weight: bold;
+}
+HR { height: 1px;
+ border: none;
+ border-top: 1px solid black;
+}
+
+/* Style for detailed member documentation */
+.memtemplate {
+ font-size: 80%;
+ color: #606060;
+ font-weight: normal;
+}
+.memnav {
+ background-color: #e8eef2;
+ border: 1px solid #84b0c7;
+ text-align: center;
+ margin: 2px;
+ margin-right: 15px;
+ padding: 2px;
+}
+.memitem {
+ padding: 4px;
+ background-color: #eef3f5;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #dedeee;
+ -moz-border-radius: 8px 8px 8px 8px;
+}
+.memname {
+ white-space: nowrap;
+ font-weight: bold;
+}
+.memdoc{
+ padding-left: 10px;
+}
+.memproto {
+ background-color: #d5e1e8;
+ width: 100%;
+ border-width: 1px;
+ border-style: solid;
+ border-color: #84b0c7;
+ font-weight: bold;
+ -moz-border-radius: 8px 8px 8px 8px;
+}
+.paramkey {
+ text-align: right;
+}
+.paramtype {
+ white-space: nowrap;
+}
+.paramname {
+ color: #602020;
+ font-style: italic;
+ white-space: nowrap;
+}
+/* End Styling for detailed member documentation */
+
+/* for the tree view */
+.ftvtree {
+ font-family: sans-serif;
+ margin:0.5em;
+}
+.directory { font-size: 9pt; font-weight: bold; }
+.directory h3 { margin: 0px; margin-top: 1em; font-size: 11pt; }
+.directory > h3 { margin-top: 0; }
+.directory p { margin: 0px; white-space: nowrap; }
+.directory div { display: none; margin: 0px; }
+.directory img { vertical-align: -30%; }
diff --git a/docs/html/doxygen.png b/docs/html/doxygen.png
new file mode 100644
index 0000000..f0a274b
Binary files /dev/null and b/docs/html/doxygen.png differ
diff --git a/docs/html/files.html b/docs/html/files.html
new file mode 100644
index 0000000..b662e8a
--- /dev/null
+++ b/docs/html/files.html
@@ -0,0 +1,25 @@
+
+
+phpqrencode: File Index
+
+
+
+
+
+
+phpqrencode File List
Here is a list of all files with brief descriptions:
+
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/ftv2blank.png b/docs/html/ftv2blank.png
new file mode 100644
index 0000000..493c3c0
Binary files /dev/null and b/docs/html/ftv2blank.png differ
diff --git a/docs/html/ftv2doc.png b/docs/html/ftv2doc.png
new file mode 100644
index 0000000..f72999f
Binary files /dev/null and b/docs/html/ftv2doc.png differ
diff --git a/docs/html/ftv2folderclosed.png b/docs/html/ftv2folderclosed.png
new file mode 100644
index 0000000..d6d0634
Binary files /dev/null and b/docs/html/ftv2folderclosed.png differ
diff --git a/docs/html/ftv2folderopen.png b/docs/html/ftv2folderopen.png
new file mode 100644
index 0000000..bbe2c91
Binary files /dev/null and b/docs/html/ftv2folderopen.png differ
diff --git a/docs/html/ftv2lastnode.png b/docs/html/ftv2lastnode.png
new file mode 100644
index 0000000..e7b9ba9
Binary files /dev/null and b/docs/html/ftv2lastnode.png differ
diff --git a/docs/html/ftv2link.png b/docs/html/ftv2link.png
new file mode 100644
index 0000000..14f3fed
Binary files /dev/null and b/docs/html/ftv2link.png differ
diff --git a/docs/html/ftv2mlastnode.png b/docs/html/ftv2mlastnode.png
new file mode 100644
index 0000000..09ceb6a
Binary files /dev/null and b/docs/html/ftv2mlastnode.png differ
diff --git a/docs/html/ftv2mnode.png b/docs/html/ftv2mnode.png
new file mode 100644
index 0000000..3254c05
Binary files /dev/null and b/docs/html/ftv2mnode.png differ
diff --git a/docs/html/ftv2node.png b/docs/html/ftv2node.png
new file mode 100644
index 0000000..c9f06a5
Binary files /dev/null and b/docs/html/ftv2node.png differ
diff --git a/docs/html/ftv2plastnode.png b/docs/html/ftv2plastnode.png
new file mode 100644
index 0000000..0b07e00
Binary files /dev/null and b/docs/html/ftv2plastnode.png differ
diff --git a/docs/html/ftv2pnode.png b/docs/html/ftv2pnode.png
new file mode 100644
index 0000000..2001b79
Binary files /dev/null and b/docs/html/ftv2pnode.png differ
diff --git a/docs/html/ftv2vertline.png b/docs/html/ftv2vertline.png
new file mode 100644
index 0000000..b330f3a
Binary files /dev/null and b/docs/html/ftv2vertline.png differ
diff --git a/docs/html/functions.html b/docs/html/functions.html
new file mode 100644
index 0000000..e0a93b3
--- /dev/null
+++ b/docs/html/functions.html
@@ -0,0 +1,36 @@
+
+
+phpqrencode: Class Members
+
+
+
+
+
+
+
+Here is a list of all class members with links to the classes they belong to:
+
+
+
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html
new file mode 100644
index 0000000..534f4ae
--- /dev/null
+++ b/docs/html/functions_vars.html
@@ -0,0 +1,36 @@
+
+
+phpqrencode: Class Members - Variables
+
+
+
+
+
+
+
+
+
+
+
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/globals.html b/docs/html/globals.html
new file mode 100644
index 0000000..48c2695
--- /dev/null
+++ b/docs/html/globals.html
@@ -0,0 +1,51 @@
+
+
+phpqrencode: Data Fields
+
+
+
+
+
+
+
+Here is a list of all functions, variables, defines, enums, and typedefs with links to the files they belong to:
+
+
+
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/globals_func.html b/docs/html/globals_func.html
new file mode 100644
index 0000000..bd94252
--- /dev/null
+++ b/docs/html/globals_func.html
@@ -0,0 +1,45 @@
+
+
+phpqrencode: Data Fields
+
+
+
+
+
+
+
+
+
+
+
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/globals_vars.html b/docs/html/globals_vars.html
new file mode 100644
index 0000000..999ef54
--- /dev/null
+++ b/docs/html/globals_vars.html
@@ -0,0 +1,39 @@
+
+
+phpqrencode: Data Fields
+
+
+
+
+
+
+
+
+
+
+
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/index.html b/docs/html/index.html
new file mode 100644
index 0000000..4bd3a95
--- /dev/null
+++ b/docs/html/index.html
@@ -0,0 +1,8 @@
+
+
+phpqrencode
+
+
diff --git a/docs/html/main.html b/docs/html/main.html
new file mode 100644
index 0000000..40e3605
--- /dev/null
+++ b/docs/html/main.html
@@ -0,0 +1,19 @@
+
+
+phpqrencode: Main Page
+
+
+
+
+
+phpqrencode Documentation
+
+
0.1
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/qrencode_8c.html b/docs/html/qrencode_8c.html
new file mode 100644
index 0000000..b3e1328
--- /dev/null
+++ b/docs/html/qrencode_8c.html
@@ -0,0 +1,299 @@
+
+
+phpqrencode: qrencode.c File Reference
+
+
+
+
+
+
+qrencode.c File Reference
Functions
+
+Variables
+
+
Detailed Description
+
Function Documentation
+
+
+
+
+
+ PHP_MINFO_FUNCTION |
+ ( |
+ qrencode |
+ |
+ ) |
+ |
+
+
+
+
+
+
+
+
+
+
+ PHP_MINIT_FUNCTION |
+ ( |
+ qrencode |
+ |
+ ) |
+ |
+
+
+
+
+
+
+
+
+
+
+ PHP_MSHUTDOWN_FUNCTION |
+ ( |
+ qrencode |
+ |
+ ) |
+ |
+
+
+
+
+
+
+
+
+
+
+ static void qr_dtor |
+ ( |
+ zend_rsrc_list_entry *rsrc |
+ TSRMLS_DC |
+ ) |
+ [static] |
+
+
+
+
+
+
+
+
+
+
+ resource qr_encode |
+ ( |
+ string |
+ text, |
+
+
+ |
+ |
+ int |
+ version, |
+
+
+ |
+ |
+ int |
+ level, |
+
+
+ |
+ |
+ int |
+ mode, |
+
+
+ |
+ |
+ int |
+ casesensitive | |
+
+
+ |
+ ) |
+ | | |
+
+
+
+
+
+
+main function to encode text to qr code.
+
+
- Parameters:
-
+
+ | text | the string want to encode. |
+ | version | qrcode version |
+ | level | level |
+ | mode | mode, could be QR_MODE_NUM, QR_MODE_AN, QR_MODE_8, QR_MODE_KANJI. |
+ | casesensitive | casesentive, if you want the 8 bit mode, must set this on. |
+
+
+
- Returns:
+
+
+
+
+
+
+
+
+ int qr_save |
+ ( |
+ resource |
+ link, |
+
+
+ |
+ |
+ string |
+ filename, |
+
+
+ |
+ |
+ int |
+ size, |
+
+
+ |
+ |
+ int |
+ margin | |
+
+
+ |
+ ) |
+ | | |
+
+
+
+
+
+
+save function for qrencode.
+
+
- Parameters:
-
+
+ | link | qrcode resource link. |
+ | filename | filename want to save, it could be empty, and will show the content directly. |
+ | size | size |
+ | margin | margin. |
+
+
+
- Returns:
+
+
+
+
Variable Documentation
+
+
+
+
+
+ int le_qr [static] |
+
+
+
+
+
+
+$file qrencode.c source file of php qrencode extension.
+
+
+
+
+
+
+
+
+
+
+Initial value:
{
+
+ PHP_FE(qr_save, NULL)
+ {NULL, NULL, NULL}
+}
+
+
+
+
+
+
+
+
+
+Initial value:
{
+
+
+
+ "qrencode",
+ qrencode_functions,
+ PHP_MINIT(qrencode),
+ PHP_MSHUTDOWN(qrencode),
+ NULL,
+ NULL,
+ PHP_MINFO(qrencode),
+
+
+
+ STANDARD_MODULE_PROPERTIES
+}
+
+
+
+
Generated on Thu Mar 29 16:37:47 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/structphp__qrcode-members.html b/docs/html/structphp__qrcode-members.html
new file mode 100644
index 0000000..d82af6d
--- /dev/null
+++ b/docs/html/structphp__qrcode-members.html
@@ -0,0 +1,26 @@
+
+
+phpqrencode: Member List
+
+
+
+
+
+
+php_qrcode Member List
This is the complete list of members for php_qrcode, including all inherited members.
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/structphp__qrcode.html b/docs/html/structphp__qrcode.html
new file mode 100644
index 0000000..172863e
--- /dev/null
+++ b/docs/html/structphp__qrcode.html
@@ -0,0 +1,46 @@
+
+
+phpqrencode: php_qrcode Struct Reference
+
+
+
+
+
+
+php_qrcode Struct Reference
List of all members.Public Attributes
+
+
Member Data Documentation
+
+
+
The documentation for this struct was generated from the following file:
+
Generated on Thu Mar 29 16:36:28 2007 for phpqrencode by
+
+
1.5.1
+
+
diff --git a/docs/html/tab_b.gif b/docs/html/tab_b.gif
new file mode 100644
index 0000000..0d62348
Binary files /dev/null and b/docs/html/tab_b.gif differ
diff --git a/docs/html/tab_l.gif b/docs/html/tab_l.gif
new file mode 100644
index 0000000..9b1e633
Binary files /dev/null and b/docs/html/tab_l.gif differ
diff --git a/docs/html/tab_r.gif b/docs/html/tab_r.gif
new file mode 100644
index 0000000..ce9dd9f
Binary files /dev/null and b/docs/html/tab_r.gif differ
diff --git a/docs/html/tabs.css b/docs/html/tabs.css
new file mode 100644
index 0000000..a61552a
--- /dev/null
+++ b/docs/html/tabs.css
@@ -0,0 +1,102 @@
+/* tabs styles, based on http://www.alistapart.com/articles/slidingdoors */
+
+DIV.tabs
+{
+ float : left;
+ width : 100%;
+ background : url("tab_b.gif") repeat-x bottom;
+ margin-bottom : 4px;
+}
+
+DIV.tabs UL
+{
+ margin : 0px;
+ padding-left : 10px;
+ list-style : none;
+}
+
+DIV.tabs LI, DIV.tabs FORM
+{
+ display : inline;
+ margin : 0px;
+ padding : 0px;
+}
+
+DIV.tabs FORM
+{
+ float : right;
+}
+
+DIV.tabs A
+{
+ float : left;
+ background : url("tab_r.gif") no-repeat right top;
+ border-bottom : 1px solid #84B0C7;
+ font-size : x-small;
+ font-weight : bold;
+ text-decoration : none;
+}
+
+DIV.tabs A:hover
+{
+ background-position: 100% -150px;
+}
+
+DIV.tabs A:link, DIV.tabs A:visited,
+DIV.tabs A:active, DIV.tabs A:hover
+{
+ color: #1A419D;
+}
+
+DIV.tabs SPAN
+{
+ float : left;
+ display : block;
+ background : url("tab_l.gif") no-repeat left top;
+ padding : 5px 9px;
+ white-space : nowrap;
+}
+
+DIV.tabs INPUT
+{
+ float : right;
+ display : inline;
+ font-size : 1em;
+}
+
+DIV.tabs TD
+{
+ font-size : x-small;
+ font-weight : bold;
+ text-decoration : none;
+}
+
+
+
+/* Commented Backslash Hack hides rule from IE5-Mac \*/
+DIV.tabs SPAN {float : none;}
+/* End IE5-Mac hack */
+
+DIV.tabs A:hover SPAN
+{
+ background-position: 0% -150px;
+}
+
+DIV.tabs LI#current A
+{
+ background-position: 100% -150px;
+ border-width : 0px;
+}
+
+DIV.tabs LI#current SPAN
+{
+ background-position: 0% -150px;
+ padding-bottom : 6px;
+}
+
+DIV.nav
+{
+ background : none;
+ border : none;
+ border-bottom : 1px solid #84B0C7;
+}
diff --git a/docs/html/tree.html b/docs/html/tree.html
new file mode 100644
index 0000000..d53e746
--- /dev/null
+++ b/docs/html/tree.html
@@ -0,0 +1,74 @@
+
+
+
+
+
+
+ TreeView
+
+
+
+
+
+
+
diff --git a/generatedocs.pl b/generatedocs.pl
new file mode 100755
index 0000000..d85ced4
--- /dev/null
+++ b/generatedocs.pl
@@ -0,0 +1,25 @@
+#!/usr/local/bin/perl -wp
+
+BEGIN
+{
+ print qq(
+/** \\file $ARGV[0]
+ */
+);
+ $/=" }}} */" if $ARGV[0] =~ /c$/;
+}
+
+while(/#include/) {
+ s/^#include.*$//gm;
+};
+
+if(/PHP_FUNCTION/) {
+ s/[\[\]]//g;
+ s/{{{ *(?:proto)? *(\w+).*?\((.*?)\)(.*?)PHP_FUNCTION\((.*?)\)/$3$1 $4($2)/sg;
+}
+
+s/REGISTER_LONG_CONSTANT\("(.*?)", (.*?),.*/define("$1", $2);/;
+
+END
+{
+}
diff --git a/php_qrencode.h b/php_qrencode.h
new file mode 100644
index 0000000..0a0c51d
--- /dev/null
+++ b/php_qrencode.h
@@ -0,0 +1,47 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2007 Vanilla (San Tai) Hsu |
+ +----------------------------------------------------------------------+
+ | This source file is subject to the BSD license, that is bundled with |
+ | this package in the file LICENSE |
+ +----------------------------------------------------------------------+
+ | Author: Vanilla (San Tai) Hsu (vanilla@FreeBSD.org> |
+ +----------------------------------------------------------------------+
+*/
+
+/*
+ * $Header: /home/ncvs/php_extension/qrencode/php_qrencode.h,v 1.1 2007/03/29 08:58:11 vanilla Exp $
+ */
+
+#ifndef PHP_QRENCODE_H
+#define PHP_QRENCODE_H
+
+extern zend_module_entry qrencode_module_entry;
+#define phpext_qrencode_ptr &qrencode_module_entry
+
+#ifdef PHP_WIN32
+#define PHP_QRENCODE_API __declspec(dllexport)
+#else
+#define PHP_QRENCODE_API
+#endif
+
+#ifdef ZTS
+#include "TSRM.h"
+#endif
+
+PHP_MINIT_FUNCTION(qrencode);
+PHP_MSHUTDOWN_FUNCTION(qrencode);
+PHP_MINFO_FUNCTION(qrencode);
+PHP_FUNCTION(qr_encode);
+PHP_FUNCTION(qr_save);
+
+#ifdef ZTS
+#define QRENCODE_G(v) TSRMG(qrencode_globals_id, zend_qrencode_globals *, v)
+#else
+#define QRENCODE_G(v) (qrencode_globals.v)
+#endif
+
+#endif /* PHP_QRENCODE_H */
+
diff --git a/qrencode.c b/qrencode.c
new file mode 100644
index 0000000..d61e127
--- /dev/null
+++ b/qrencode.c
@@ -0,0 +1,288 @@
+/*
+ +----------------------------------------------------------------------+
+ | PHP Version 5 |
+ +----------------------------------------------------------------------+
+ | Copyright (c) 2007 San Tai (vanilla) Hsu |
+ +----------------------------------------------------------------------+
+ | This source file is subject to the BSD license, that is bundled with |
+ | this package in the file LICENSE |
+ +----------------------------------------------------------------------+
+ | Author: San Tai (vanilla) Hsu (vanilla@FreeBSD.org> |
+ +----------------------------------------------------------------------+
+*/
+
+/*
+ * $Header: /home/ncvs/php_extension/qrencode/qrencode.c,v 1.2 2008/01/24 02:44:41 vanilla Exp $
+ */
+
+/**
+ * $file qrencode.c
+ * @brief source file of php qrencode extension.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "php.h"
+#include "php_ini.h"
+#include "ext/standard/info.h"
+#include "php_qrencode.h"
+#include "php_open_temporary_file.h"
+#include
+#include
+
+static int le_qr;
+
+typedef struct
+{
+ QRcode *c;
+} php_qrcode;
+
+static void qr_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC);
+
+zend_function_entry qrencode_functions[] = {
+ PHP_FE(qr_encode, NULL)
+ PHP_FE(qr_save, NULL)
+ {NULL, NULL, NULL}
+};
+
+zend_module_entry qrencode_module_entry = {
+#if ZEND_MODULE_API_NO >= 20010901
+ STANDARD_MODULE_HEADER,
+#endif
+ "qrencode",
+ qrencode_functions,
+ PHP_MINIT(qrencode),
+ PHP_MSHUTDOWN(qrencode),
+ NULL,
+ NULL,
+ PHP_MINFO(qrencode),
+#if ZEND_MODULE_API_NO >= 20010901
+ "$Revision: 1.2 $",
+#endif
+ STANDARD_MODULE_PROPERTIES
+};
+
+#ifdef COMPILE_DL_QRENCODE
+ZEND_GET_MODULE(qrencode)
+#endif
+
+PHP_MINIT_FUNCTION(qrencode)
+{
+ le_qr = zend_register_list_destructors_ex(qr_dtor, NULL, "qr", module_number);
+
+ REGISTER_LONG_CONSTANT ("QR_MODE_NUM", QR_MODE_NUM, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_MODE_AN", QR_MODE_AN, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_MODE_8", QR_MODE_8, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_MODE_KANJI", QR_MODE_KANJI, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_ECLEVEL_L", QR_ECLEVEL_L, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_ECLEVEL_M", QR_ECLEVEL_M, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_ECLEVEL_Q", QR_ECLEVEL_Q, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT ("QR_ECLEVEL_H", QR_ECLEVEL_H, CONST_CS | CONST_PERSISTENT);
+ return SUCCESS;
+}
+
+PHP_MSHUTDOWN_FUNCTION(qrencode)
+{
+ return SUCCESS;
+}
+
+PHP_MINFO_FUNCTION(qrencode)
+{
+ php_info_print_table_start();
+ php_info_print_table_header(2, "qrencode support", "enabled");
+ php_info_print_table_end();
+}
+
+/* {{{ resource qr_encode (string text, [int version, int level, int mode, int casesensitive]); */
+/**
+ * @brief main function to encode text to qr code.
+ * @param text the string want to encode.
+ * @param version qrcode version
+ * @param level level
+ * @param mode mode, could be QR_MODE_NUM, QR_MODE_AN, QR_MODE_8, QR_MODE_KANJI.
+ * @param casesensitive casesentive, if you want the 8 bit mode, must set this on.
+ * @return
+ */
+PHP_FUNCTION(qr_encode)
+{
+ php_qrcode *qr = NULL;
+ long version = 1, level = QR_ECLEVEL_L, mode = QR_MODE_8, casesensitive = 1;
+ const char *text;
+ int text_len;
+
+ if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "s|llll", &text, &text_len, &version, &level, &mode, &casesensitive) == FAILURE)
+ RETURN_FALSE;
+
+ qr = (php_qrcode *) emalloc (sizeof (php_qrcode));
+ qr->c = QRcode_encodeString(text, version, level, mode, casesensitive);
+
+ ZEND_REGISTER_RESOURCE (return_value, qr, le_qr);
+}
+/* }}} */
+
+/* {{{ int qr_save (resource link, [string filename, int size, int margin]); */
+/**
+ * @brief save function for qrencode.
+ * @param link qrcode resource link.
+ * @param filename filename want to save, it could be empty, and will show the content directly.
+ * @param size size
+ * @param margin margin.
+ * @return
+ */
+PHP_FUNCTION(qr_save)
+{
+ zval *link = NULL;
+ long size = 3, margin = 4;
+ const char *fn = NULL;
+ int fn_len, argc;
+ FILE *fp = NULL;
+ png_structp png_ptr;
+ png_infop info_ptr;
+ unsigned char *row, *p, *q;
+ int x, y, xx, yy, bit;
+ int realwidth;
+ char *path;
+ int b;
+ char buf[4096];
+
+ argc = ZEND_NUM_ARGS();
+
+ if (zend_parse_parameters( ZEND_NUM_ARGS() TSRMLS_CC, "r|sll", &link, &fn, &fn_len, &size, &margin) == FAILURE )
+ RETURN_FALSE;
+
+ if (link)
+ {
+ php_qrcode *qr = NULL;
+
+ ZEND_FETCH_RESOURCE2 (qr, php_qrcode *, &link, -1, "qr handle", le_qr, NULL);
+
+ if ((argc == 2) || (argc > 2 && fn != NULL))
+ {
+ fp = VCWD_FOPEN (fn, "wb");
+ if (!fp)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open '%s' for writing.", fn);
+ RETURN_FALSE;
+ }
+ }
+ else
+ {
+ fp = php_open_temporary_file (NULL, NULL, &path TSRMLS_CC);
+ if (!fp)
+ {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open temporary file for writing.");
+ RETURN_FALSE;
+ }
+ }
+
+ realwidth = (qr->c->width + margin * 2) * size;
+ row = (unsigned char *) emalloc ((realwidth + 7) / 8);
+
+ png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+ if(png_ptr == NULL)
+ {
+ fclose(fp);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to initialize PNG writer.");
+ RETURN_FALSE;
+ }
+
+ info_ptr = png_create_info_struct(png_ptr);
+ if(info_ptr == NULL)
+ {
+ fclose(fp);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to initialize PNG write.");
+ RETURN_FALSE;
+ }
+
+
+ if(setjmp(png_jmpbuf(png_ptr))) {
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ fclose(fp);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write PNG image.");
+ RETURN_FALSE;
+ }
+
+ png_init_io(png_ptr, fp);
+
+ png_set_IHDR(png_ptr, info_ptr, realwidth, realwidth, 1, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
+ png_write_info(png_ptr, info_ptr);
+
+ memset(row, 0xff, (realwidth + 7) / 8);
+ for(y = 0; y < margin * size; y++)
+ png_write_row(png_ptr, row);
+
+ p = qr->c->data;
+ for(y = 0; y < qr->c->width; y++)
+ {
+ bit = 7;
+ memset(row, 0xff, (realwidth + 7) / 8);
+ q = row;
+ q += margin * size / 8;
+ bit = 7 - (margin * size % 8);
+ for(x = 0; x < qr->c->width; x++)
+ {
+ for(xx = 0; xx < size; xx++)
+ {
+ *q ^= (*p & 1) << bit;
+ bit--;
+ if(bit < 0)
+ {
+ q++;
+ bit = 7;
+ }
+ }
+ p++;
+ }
+
+ for(yy=0; yy 2 && fn != NULL))
+ {
+ fflush (fp);
+ fclose (fp);
+ }
+ else
+ {
+ fseek (fp, 0, SEEK_SET);
+#if APACHE && defined(CHARSET_EBCDIC)
+ ap_bsetflag(php3_rqst->connection->client, B_EBCDIC2ASCII, 0);
+#endif
+ while ((b = fread (buf, 1, sizeof(buf), fp)) > 0)
+ php_write (buf, b TSRMLS_CC);
+
+ fclose (fp);
+ VCWD_UNLINK ((const char *)path);
+ efree (path);
+ }
+
+ RETURN_TRUE;
+ }
+ else
+ RETURN_FALSE;
+}
+/* }}} */
+
+static void qr_dtor (zend_rsrc_list_entry *rsrc TSRMLS_DC)
+{
+ php_qrcode *qr = (php_qrcode *) rsrc->ptr;
+
+ if (qr->c)
+ QRcode_free (qr->c);
+ efree (qr);
+}
+
+/*
+ * vim:ts=4:expandtab:sw=4
+ */