最近学了一下JAVA,自然到了JDBC,先Oracle,再MySQL,感觉MySQL开源挺好,就拿来看一下。看了好多网上的介绍,作为一个菜鸟来说,好不容易找到了程序的入口,然后就一个一个CPP的分析吧,当作笔记了,当然,也不知道能看多少,看多少算多少吧嘿嘿。
/* Copyright (c) 2009 Sun Microsystems, Inc.
Use is subject to license terms.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 2 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
51 Franklin Street, Suite 500, Boston, MA 02110-1335 USA */
/*
main() for mysqld.
Calls mysqld_main() entry point exported by sql library.
*/
extern int mysqld_main(int argc, char **argv);
int main(int argc, char **argv)
{
return mysqld_main(argc, argv);
}
嘿嘿看到这一句就知道入口在哪了,程序也就知道怎么走的了。。。
Calls mysqld_main() entry point exported by sql library.
但是这一句想了半天也不明白是什么意思,是调用了SQL库中mysqld_main()接入点的意思么?SQL库是什么?好像就是mySQL-xxx/SQL这个文件夹吧。。。好了第一篇搞定了。。。什么也没有就找了个接入点,不过好的开始也算可以了,毕竟这篇代码都懂了,粗略看了一下后面的。。。我只能说,呵呵~