touched up code a bit

This commit is contained in:
2009-09-16 04:01:02 +00:00
parent 3707f4dca8
commit 773f5cec57
107 changed files with 2513 additions and 1966 deletions

View File

@ -1,19 +1,21 @@
/*
* $Id: awk01.c 236 2009-07-16 08:27:53Z hyunghwan.chung $
* $Id: awk01.c 287 2009-09-15 10:01:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/awk.h>

View File

@ -1,19 +1,21 @@
/*
* $Id: awk02.c 236 2009-07-16 08:27:53Z hyunghwan.chung $
* $Id: awk02.c 287 2009-09-15 10:01:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/awk.h>

View File

@ -1,19 +1,21 @@
/*
* $Id: awk03.c 195 2009-06-10 13:18:25Z hyunghwan.chung $
* $Id: awk03.c 287 2009-09-15 10:01:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/awk.h>

View File

@ -1,19 +1,21 @@
/*
* $Id: awk04.c 250 2009-08-10 03:29:59Z hyunghwan.chung $
* $Id: awk04.c 287 2009-09-15 10:01:02Z hyunghwan.chung $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/awk.h>

View File

@ -1,19 +1,21 @@
/*
* $Id: Awk.cpp 341 2008-08-20 10:58:19Z baconevi $
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/StdAwk.hpp>

View File

@ -1,19 +1,21 @@
/*
* $Id: Awk.cpp 341 2008-08-20 10:58:19Z baconevi $
* $Id$
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/StdAwk.hpp>

View File

@ -1,19 +1,21 @@
/*
* $Id: Awk.cpp 341 2008-08-20 10:58:19Z baconevi $
* $Id$
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/StdAwk.hpp>
@ -120,8 +122,8 @@ static int awk_main (int argc, qse_char_t* argv[])
// allow returning a map from a function and enable 'reset'
awk.setOption (
awk.getOption() |
QSE::StdAwk::OPT_MAPTOVAR |
QSE::StdAwk::OPT_RESET);
QSE_AWK_MAPTOVAR |
QSE_AWK_RESET);
if (ret >= 0) ret = run_awk (awk);
if (ret <= -1)

View File

@ -1,19 +1,21 @@
/*
* $Id: Awk.cpp 341 2008-08-20 10:58:19Z baconevi $
* $Id$
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/awk/StdAwk.hpp>
@ -70,7 +72,7 @@ public:
{
if (args[0].isIndexed())
{
run.setError (ERR_INVAL);
run.setError (QSE_AWK_EINVAL);
return -1;
}
@ -339,8 +341,8 @@ static int awk_main_2 (MyAwk& awk, int argc, qse_char_t* argv[])
cmdline_t cmdline;
int n;
awk.setOption (awk.getOption() | awk.OPT_INCLUDE |
awk.OPT_MAPTOVAR | awk.OPT_RWPIPE | awk.OPT_EXTRAOPS);
awk.setOption (awk.getOption() | QSE_AWK_INCLUDE |
QSE_AWK_MAPTOVAR | QSE_AWK_RWPIPE | QSE_AWK_EXTRAOPS);
// ARGV[0]
if (awk.addArgument (QSE_T("awk08")) <= -1)
@ -373,7 +375,7 @@ static int awk_main_2 (MyAwk& awk, int argc, qse_char_t* argv[])
print_error (awk);
return -1;
}
if (awk.setGlobal (awk.GBL_FS, fs) <= -1)
if (awk.setGlobal (QSE_AWK_GBL_FS, fs) <= -1)
{
print_error (awk);
return -1;

View File

@ -1,19 +1,21 @@
/**
* $Id$
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/sed/StdSed.hpp>

View File

@ -1,19 +1,21 @@
/**
* $Id$
*
Copyright 2006-2009 Chung, Hyung-Hwan.
Copyright 2006-2009 Chung, Hyung-Hwan.
This file is part of QSE.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
QSE is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
http://www.apache.org/licenses/LICENSE-2.0
QSE 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 Lesser General Public License for more details.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
You should have received a copy of the GNU Lesser General Public
License along with QSE. If not, see <http://www.gnu.org/licenses/>.
*/
#include <qse/sed/StdSed.hpp>