Révision 132

pobysoC-4.0/.settings/language.settings.xml (revision 132)
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<project>
3
	<configuration id="0.1688976386" name="Default">
4
		<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
5
			<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
6
			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
7
			<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
8
			<provider-reference id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" ref="shared-provider"/>
9
		</extension>
10
	</configuration>
11
</project>
0 12

  
pobysoC-4.0/.cproject (revision 132)
1 1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
2
<?fileVersion 4.0.0?>
3

  
4
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
3 5
	<storageModule moduleId="org.eclipse.cdt.core.settings">
4 6
		<cconfiguration id="0.1688976386">
5 7
			<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1688976386" moduleId="org.eclipse.cdt.core.settings" name="Default">
......
38 40
					</folderInfo>
39 41
				</configuration>
40 42
			</storageModule>
41
			<storageModule moduleId="scannerConfiguration">
42
				<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
43
				<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
44
					<buildOutputProvider>
45
						<openAction enabled="true" filePath=""/>
46
						<parser enabled="true"/>
47
					</buildOutputProvider>
48
					<scannerInfoProvider id="specsFile">
49
						<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
50
						<parser enabled="true"/>
51
					</scannerInfoProvider>
52
				</profile>
53
				<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
54
					<buildOutputProvider>
55
						<openAction enabled="true" filePath=""/>
56
						<parser enabled="true"/>
57
					</buildOutputProvider>
58
					<scannerInfoProvider id="makefileGenerator">
59
						<runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
60
						<parser enabled="true"/>
61
					</scannerInfoProvider>
62
				</profile>
63
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
64
					<buildOutputProvider>
65
						<openAction enabled="true" filePath=""/>
66
						<parser enabled="true"/>
67
					</buildOutputProvider>
68
					<scannerInfoProvider id="specsFile">
69
						<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
70
						<parser enabled="true"/>
71
					</scannerInfoProvider>
72
				</profile>
73
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
74
					<buildOutputProvider>
75
						<openAction enabled="true" filePath=""/>
76
						<parser enabled="true"/>
77
					</buildOutputProvider>
78
					<scannerInfoProvider id="specsFile">
79
						<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
80
						<parser enabled="true"/>
81
					</scannerInfoProvider>
82
				</profile>
83
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
84
					<buildOutputProvider>
85
						<openAction enabled="true" filePath=""/>
86
						<parser enabled="true"/>
87
					</buildOutputProvider>
88
					<scannerInfoProvider id="specsFile">
89
						<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
90
						<parser enabled="true"/>
91
					</scannerInfoProvider>
92
				</profile>
93
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
94
					<buildOutputProvider>
95
						<openAction enabled="true" filePath=""/>
96
						<parser enabled="true"/>
97
					</buildOutputProvider>
98
					<scannerInfoProvider id="specsFile">
99
						<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
100
						<parser enabled="true"/>
101
					</scannerInfoProvider>
102
				</profile>
103
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
104
					<buildOutputProvider>
105
						<openAction enabled="true" filePath=""/>
106
						<parser enabled="true"/>
107
					</buildOutputProvider>
108
					<scannerInfoProvider id="specsFile">
109
						<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
110
						<parser enabled="true"/>
111
					</scannerInfoProvider>
112
				</profile>
113
				<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
114
					<buildOutputProvider>
115
						<openAction enabled="true" filePath=""/>
116
						<parser enabled="true"/>
117
					</buildOutputProvider>
118
					<scannerInfoProvider id="specsFile">
119
						<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
120
						<parser enabled="true"/>
121
					</scannerInfoProvider>
122
				</profile>
123
				<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
124
					<buildOutputProvider>
125
						<openAction enabled="false" filePath=""/>
126
						<parser enabled="false"/>
127
					</buildOutputProvider>
128
					<scannerInfoProvider id="specsFile">
129
						<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
130
						<parser enabled="true"/>
131
					</scannerInfoProvider>
132
				</profile>
133
				<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
134
					<buildOutputProvider>
135
						<openAction enabled="false" filePath=""/>
136
						<parser enabled="false"/>
137
					</buildOutputProvider>
138
					<scannerInfoProvider id="specsFile">
139
						<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
140
						<parser enabled="true"/>
141
					</scannerInfoProvider>
142
				</profile>
143
				<scannerConfigBuildInfo instanceId="0.1688976386">
144
					<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
145
					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
146
						<buildOutputProvider>
147
							<openAction enabled="true" filePath=""/>
148
							<parser enabled="true"/>
149
						</buildOutputProvider>
150
						<scannerInfoProvider id="specsFile">
151
							<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
152
							<parser enabled="true"/>
153
						</scannerInfoProvider>
154
					</profile>
155
					<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
156
						<buildOutputProvider>
157
							<openAction enabled="true" filePath=""/>
158
							<parser enabled="true"/>
159
						</buildOutputProvider>
160
						<scannerInfoProvider id="makefileGenerator">
161
							<runAction arguments="-E -P -v -dD" command="" useDefault="true"/>
162
							<parser enabled="true"/>
163
						</scannerInfoProvider>
164
					</profile>
165
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
166
						<buildOutputProvider>
167
							<openAction enabled="true" filePath=""/>
168
							<parser enabled="true"/>
169
						</buildOutputProvider>
170
						<scannerInfoProvider id="specsFile">
171
							<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
172
							<parser enabled="true"/>
173
						</scannerInfoProvider>
174
					</profile>
175
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
176
						<buildOutputProvider>
177
							<openAction enabled="true" filePath=""/>
178
							<parser enabled="true"/>
179
						</buildOutputProvider>
180
						<scannerInfoProvider id="specsFile">
181
							<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
182
							<parser enabled="true"/>
183
						</scannerInfoProvider>
184
					</profile>
185
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
186
						<buildOutputProvider>
187
							<openAction enabled="true" filePath=""/>
188
							<parser enabled="true"/>
189
						</buildOutputProvider>
190
						<scannerInfoProvider id="specsFile">
191
							<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
192
							<parser enabled="true"/>
193
						</scannerInfoProvider>
194
					</profile>
195
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
196
						<buildOutputProvider>
197
							<openAction enabled="true" filePath=""/>
198
							<parser enabled="true"/>
199
						</buildOutputProvider>
200
						<scannerInfoProvider id="specsFile">
201
							<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
202
							<parser enabled="true"/>
203
						</scannerInfoProvider>
204
					</profile>
205
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
206
						<buildOutputProvider>
207
							<openAction enabled="true" filePath=""/>
208
							<parser enabled="true"/>
209
						</buildOutputProvider>
210
						<scannerInfoProvider id="specsFile">
211
							<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
212
							<parser enabled="true"/>
213
						</scannerInfoProvider>
214
					</profile>
215
					<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
216
						<buildOutputProvider>
217
							<openAction enabled="true" filePath=""/>
218
							<parser enabled="true"/>
219
						</buildOutputProvider>
220
						<scannerInfoProvider id="specsFile">
221
							<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
222
							<parser enabled="true"/>
223
						</scannerInfoProvider>
224
					</profile>
225
					<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfile">
226
						<buildOutputProvider>
227
							<openAction enabled="false" filePath=""/>
228
							<parser enabled="false"/>
229
						</buildOutputProvider>
230
						<scannerInfoProvider id="specsFile">
231
							<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlc" useDefault="true"/>
232
							<parser enabled="true"/>
233
						</scannerInfoProvider>
234
					</profile>
235
					<profile id="org.eclipse.cdt.managedbuilder.xlc.core.XLCManagedMakePerProjectProfileCPP">
236
						<buildOutputProvider>
237
							<openAction enabled="false" filePath=""/>
238
							<parser enabled="false"/>
239
						</buildOutputProvider>
240
						<scannerInfoProvider id="specsFile">
241
							<runAction arguments="-E -v ${plugin_state_location}/${specs_file}" command="${XL_compilerRoot}/xlC" useDefault="true"/>
242
							<parser enabled="true"/>
243
						</scannerInfoProvider>
244
					</profile>
245
				</scannerConfigBuildInfo>
246
			</storageModule>
247 43
			<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
248 44
		</cconfiguration>
249 45
	</storageModule>
250 46
	<storageModule moduleId="cdtBuildSystem" version="4.0.0">
251 47
		<project id="pobysoC-4.0.null.959409715" name="pobysoC-4.0"/>
252 48
	</storageModule>
49
	<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
50
	<storageModule moduleId="scannerConfiguration">
51
		<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
52
		<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
53
			<buildOutputProvider>
54
				<openAction enabled="true" filePath=""/>
55
				<parser enabled="true"/>
56
			</buildOutputProvider>
57
			<scannerInfoProvider id="specsFile">
58
				<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
59
				<parser enabled="true"/>
60
			</scannerInfoProvider>
61
		</profile>
62
		<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
63
			<buildOutputProvider>
64
				<openAction enabled="true" filePath=""/>
65
				<parser enabled="true"/>
66
			</buildOutputProvider>
67
			<scannerInfoProvider id="specsFile">
68
				<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
69
				<parser enabled="true"/>
70
			</scannerInfoProvider>
71
		</profile>
72
		<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
73
			<buildOutputProvider>
74
				<openAction enabled="true" filePath=""/>
75
				<parser enabled="true"/>
76
			</buildOutputProvider>
77
			<scannerInfoProvider id="specsFile">
78
				<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
79
				<parser enabled="true"/>
80
			</scannerInfoProvider>
81
		</profile>
82
		<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
83
			<buildOutputProvider>
84
				<openAction enabled="true" filePath=""/>
85
				<parser enabled="true"/>
86
			</buildOutputProvider>
87
			<scannerInfoProvider id="specsFile">
88
				<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
89
				<parser enabled="true"/>
90
			</scannerInfoProvider>
91
		</profile>
92
		<scannerConfigBuildInfo instanceId="0.1688976386">
93
			<autodiscovery enabled="false" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile"/>
94
			<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
95
				<buildOutputProvider>
96
					<openAction enabled="true" filePath=""/>
97
					<parser enabled="true"/>
98
				</buildOutputProvider>
99
				<scannerInfoProvider id="specsFile">
100
					<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
101
					<parser enabled="true"/>
102
				</scannerInfoProvider>
103
			</profile>
104
			<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
105
				<buildOutputProvider>
106
					<openAction enabled="true" filePath=""/>
107
					<parser enabled="true"/>
108
				</buildOutputProvider>
109
				<scannerInfoProvider id="specsFile">
110
					<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
111
					<parser enabled="true"/>
112
				</scannerInfoProvider>
113
			</profile>
114
			<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
115
				<buildOutputProvider>
116
					<openAction enabled="true" filePath=""/>
117
					<parser enabled="true"/>
118
				</buildOutputProvider>
119
				<scannerInfoProvider id="specsFile">
120
					<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
121
					<parser enabled="true"/>
122
				</scannerInfoProvider>
123
			</profile>
124
			<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
125
				<buildOutputProvider>
126
					<openAction enabled="true" filePath=""/>
127
					<parser enabled="true"/>
128
				</buildOutputProvider>
129
				<scannerInfoProvider id="specsFile">
130
					<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
131
					<parser enabled="true"/>
132
				</scannerInfoProvider>
133
			</profile>
134
		</scannerConfigBuildInfo>
135
	</storageModule>
136
	<storageModule moduleId="refreshScope"/>
253 137
</cproject>
pobysoC-4.0/src/pobyso.h (revision 132)
20 20
#ifndef POBYSO_h
21 21

  
22 22
/* Typedefs to make code more readable. */
23

  
23 24
typedef sollya_obj_t pobyso_error_t;
24 25
typedef sollya_obj_t pobyso_func_exp_t;
26
typedef sollya_obj_t pobyso_on_off_t;
25 27
typedef sollya_obj_t pobyso_precision_t;
26 28
typedef sollya_obj_t pobyso_range_t;
29
typedef sollya_obj_t pobyso_sollya_verbosity_t;
27 30

  
28
typedef sollya_obj_t sollya_verbosity_t;
31
#define POBYSO_ABSOLUTE (1)
32
#define POBYSO_RELATIVE (2)
29 33

  
30
#define POBYSO_ABSOLUTE 1
31
#define POBYSO_RELATIVE 2
34
#define POBYSO_OFF (0)
35
#define POBYSO_ON (1)
32 36

  
33 37
/* Mimic the default behavior of interactive Sollya. */
34 38
#define POBYSO_DEFAULT_POINTS 501
......
64 68
void
65 69
pobyso_autoprint_v(sollya_obj_t soObj, va_list va);
66 70

  
71

  
72

  
67 73
/**
68 74
 * Parse a string to create a Sollya object.
69 75
 * A very thin wrapper around the sollya_lib_parse_string() function.
......
116 122
pobyso_func_exp_t
117 123
pobyso_remez_arbitrary_base(pobyso_func_exp_t);
118 124

  
125
/**
126
 * Set the canonical mode.
127
 */
119 128

  
129
int
130
pobyso_set_canonical_on(void);
120 131

  
121 132
/**
122 133
 * Set the verbosity mode off (level 0).
123
 * The current level of vebositiy is returned.
134
 * The current level of verbosity is returned.
124 135
 */
125
sollya_verbosity_t
136
pobyso_sollya_verbosity_t
126 137
pobyso_set_verbosity_off(void);
127 138

  
128 139
/**
129 140
 * Set the verbosity level to newVerbosityLevel.
130
 * @param newVerbosityLevel must be a Sollay object corresponding to an
141
 * @param newVerbosityLevel must be a Sollya object corresponding to an
131 142
 *        integer constant.
132 143
 */
133
sollya_verbosity_t
134
pobyso_set_verbosity_to(sollya_obj_t newVerbosityLevel);
144
pobyso_sollya_verbosity_t
145
pobyso_set_verbosity_to(pobyso_sollya_verbosity_t newVerbosityLevel);
135 146

  
147
/**
148
 * Set the verbosity level to intVerbosityLevel.
149
 * @param newVerbosityLevel is an positive or null int.
150
*/
151
pobyso_sollya_verbosity_t
152
pobyso_set_verbosity_to_int(int intVerbosityLevel);
153

  
136 154
#if 0
137 155
/**
138 156
 * Create the canonical (non sparse) base of monomials for a given degree.
pobysoC-4.0/src/test-pobyso-01.c (revision 132)
2 2
int main()
3 3
{
4 4
    printf("Hello World!\n");
5
    return (0);
5
    return 0;
6 6
}
7 7

  
pobysoC-4.0/src/test-pobyso-02.c (revision 132)
1
/** @file test-pobyso-02.c
2
 * Name & purpose
3
 *
4
 * @author
5
 * @date
6
 *
7
 */
8
/******************************************************************************/
9
/* Headers, applying the "particular to general" convention.*/
10

  
11
#include "pobyso.h"
12

  
13
/* includes of local headers */
14

  
15
/* includes of project headers */
16

  
17
/* includes of system headers */
18

  
19
/* Other declarations */
20

  
21
/* Internal prototypes */
22

  
23
/* Types, constants and macros definitions */
24

  
25
/* Global variables */
26

  
27
/* Functions */
28

  
29
int
30
main(int argc, char** argv)
31
{
32
  pobyso_func_exp_t f;
33
  sollya_lib_init();
34
  pobyso_set_canonical_on();
35
  f = pobyso_parse_string(argv[1]);
36
  if (pobyso_is_function(f))
37
  {
38
    pobyso_autoprint(f);
39
    pobyso_set_canonical_on();
40
    pobyso_autoprint(sollya_lib_canonical(f));
41
  }
42
  else
43
  {
44
    fprintf(stderr,
45
        "%s can't be converted into a functional expression.\n",
46
        argv[1]);
47
  }
48
  sollya_lib_clear_obj(f);
49
  sollya_lib_close();
50
  return 0;
51
} /* End main */
0 52

  
pobysoC-4.0/src/pobyso.c (revision 132)
42 42
  va_end(va);
43 43
} /* End pobyso_autoprint. */
44 44

  
45
/* @see pobyso.h#pobyso_parse*/
46
pobyso_func_exp_t
47
pobyso_parse(const char* expression)
48
{
49
  int expressionLength, i;
50
  char *expressionWithSemiCo;
51
  sollya_obj_t expressionStringSa;
52
  sollya_obj_t expressionSa;
53 45

  
54
  /* Arguments check. */
55
  if (expression == NULL)
56
  {
57
    pobyso_error_message("pobyso_parse",
58
                        "NULL_POINTER_ARGUMENT",
59
                        "The expression is a NULL pointer");
60
    return(sollya_lib_error());
61
  }
62
  expressionLength = strlen(expression);
63
  if (expressionLength == 0)
64
  {
65
    pobyso_error_message("pobyso_parse",
66
                        "EMPTY_STRING_ARGUMENT",
67
                        "The expression is an empty string");
68
    return(sollya_lib_error());
69
  }
70
  /* Search from the last char of the expression until, whichever happens
71
   * first:
72
   * a ";" is found;
73
   * a char  != ';' is found the the ";" is appended.
74
   * If the head of the string is reached before any of these two events happens
75
   * return an error.
76
   */
77
  for (i = expressionLength - 1 ; i >= 0 ; i--)
78
  {
79
    if (expression[i] == ';') /* Nothing special to do:
80
                                 try to parse the string*/
81
    {
82
      /* This ugly cast comes from a deficient definition in Sollya:
83
         sollya_lib_string does not take a const char * argument. */
84
      expressionStringSa = sollya_lib_string((char*)expression);
85
      expressionSa = sollya_lib_parse(expressionStringSa);
86
      sollya_lib_free(expressionStringSa);
87
      return(expressionSa);
88
    }
89
    else
90
    {
91
      if (expression[i] == ' ' || expression[i] == '\t') /* A blank,
92
                                                           just continue. */
93
      {
94
        continue;
95
      }
96
      else /* a character != ';' and from a blank: create the ';'ed string. */
97
      {
98
        /* Create a new string for the expression, add the ";" and
99
         * and call sollya_lib_parse_string. */
100
        expressionWithSemiCo = calloc(i + 3, sizeof(char));
101
        if (expressionWithSemiCo == NULL)
102
        {
103
          pobyso_error_message("pobyso_parse",
104
                                "MEMORY_ALLOCATION_ERROR",
105
                                "Could not allocate the expression string");
106
          return(sollya_lib_error());
107
        }
108
        strncpy(expressionWithSemiCo, expression, i + 1);
109
        expressionWithSemiCo[i + 1] = ';';
110
        expressionWithSemiCo[i + 2] = '\0';
111
        expressionStringSa = sollya_lib_string(expressionWithSemiCo);
112
        expressionSa = sollya_lib_parse(expressionStringSa);
113
        free(expressionWithSemiCo);
114
        sollya_lib_free(expressionStringSa);
115
        return(expressionSa);
116
      } /* End character != ';' and from a blank. */
117
    /* Create a new string for the expression, add the ";" and
118
     * and call sollya_lib_parse_string. */
119
    } /* End else. */
120
  } /* End for. */
121
  /* We get here, it is because we did not find any char == anything different
122
   * from ' ' or '\t': the string is empty.
123
   */
124
  pobyso_error_message("pobyso_parse_string",
125
                       "ONLY_BLANK_ARGUMENT",
126
                        "The expression is only made of blanks");
127
  return(sollya_lib_error());
128

  
129
} /* pobyso_parse_string */
130

  
131 46
/* @see pobyso.h#pobyso_parse_string*/
132 47
pobyso_func_exp_t
133 48
pobyso_parse_string(const char* expression)
......
150 65
    pobyso_error_message("pobyso_parse_string",
151 66
                        "EMPTY_STRING_ARGUMENT",
152 67
                        "The expression is an empty string");
153
    return(sollya_lib_error());
68
    return sollya_lib_error();
154 69
  }
155 70
  /* Search from the last char of the expression until, whichever happens
156 71
   * first:
......
165 80
                                 try to parse the string*/
166 81
    {
167 82
      expressionSa = sollya_lib_parse_string(expression);
168
      return(expressionSa);
83
      return expressionSa;
169 84
    }
170 85
    else
171 86
    {
......
184 99
          pobyso_error_message("pobyso_parse_string",
185 100
                                "MEMORY_ALLOCATION_ERROR",
186 101
                                "Could not allocate the expression string");
187
          return(sollya_lib_error());
102
          return sollya_lib_error();
188 103
        }
189
        strncpy(expressionWithSemiCo, expression, i + 1);
104
        strncpy(expressionWithSemiCo, expression, i+1);
190 105
        expressionWithSemiCo[i + 1] = ';';
191 106
        expressionWithSemiCo[i + 2] = '\0';
192 107
        expressionSa = sollya_lib_parse_string(expressionWithSemiCo);
193 108
        free(expressionWithSemiCo);
194
        return(expressionSa);
109
        return expressionSa;
195 110
      } /* End character != ';' and from a blank. */
196 111
    /* Create a new string for the expression, add the ";" and
197 112
     * and call sollya_lib_parse_string. */
......
207 122

  
208 123
} /* pobyso_parse_string */
209 124

  
210
sollya_verbosity_t
125
pobyso_func_exp_t
126
pobyso_remez_canonical_monomials_base(pobyso_func_exp_t function,
127
                                      long int degree,
128
                                      pobyso_range_t interval,
129
                                      pobyso_func_exp_t weight,
130
                                      double quality,
131
                                      pobyso_range_t bounds)
132
{
133
  sollya_obj_t  degreeSa = NULL;
134
  sollya_obj_t qualitySa = NULL;
135

  
136
  degreeSa = sollya_lib_constant_from_int(degree);
137
  qualitySa = sollya_lib_constant_from_double(quality);
138

  
139
  return NULL;
140
} /* End pobyso_remez_canonical_monomials_base. */
141

  
142
int
143
pobyso_set_canonical_on()
144
{
145
  pobyso_on_off_t currentCanonicalModeSo;
146
  int currentCanonicalMode;
147
  pobyso_on_off_t on;
148

  
149
  on = sollya_lib_on();
150
  currentCanonicalModeSo = sollya_lib_get_canonical();
151
  if (sollya_lib_is_on(currentCanonicalModeSo))
152
  {
153
    currentCanonicalMode = POBYSO_ON;
154
  }
155
  else
156
  {
157
    currentCanonicalMode = POBYSO_OFF;
158
  }
159
  sollya_lib_set_canonical(on);
160
  sollya_lib_clear_obj(on);
161
  sollya_lib_clear_obj(currentCanonicalModeSo);
162
  return currentCanonicalMode;
163
} /* End pobyso_set_canonical_on. */
164

  
165
pobyso_sollya_verbosity_t
211 166
pobyso_set_verbosity_off()
212 167
{
213 168
  sollya_obj_t verbosityLevelZero;
......
220 175
  return(currentVerbosityLevel);
221 176
} /* End of pobyso_set_verbosity_off. */
222 177

  
223
sollya_verbosity_t
224
pobyso_set_verbosity_to(sollya_obj_t newVerbosityLevel)
178
pobyso_sollya_verbosity_t
179
pobyso_set_verbosity_to(pobyso_sollya_verbosity_t newVerbosityLevel)
225 180
{
226 181
  sollya_obj_t currentVerbosityLevel = NULL;
227 182
  if (newVerbosityLevel == NULL)
228 183
  {
229 184
    pobyso_error_message("pobyso_set_verbosity_to",
230 185
                        "NULL_POINTER_ARGUMENT",
231
                        "The new verbosity level is a NULL pointer");
186
                        "The new verbosity level is a null pointer");
232 187
    return(sollya_lib_error());
233 188
  }
234 189
  currentVerbosityLevel = sollya_lib_get_verbosity();
......
236 191
  return(currentVerbosityLevel);
237 192
} /* End of pobyso_set_verbosity_to. */
238 193

  
194
pobyso_sollya_verbosity_t
195
pobyso_set_verbosity_to_int(int intVerbosityLevel)
196
{
197
  sollya_obj_t currentVerbosityLevel = NULL;
198
  sollya_obj_t newVerbosityLevel     = NULL;
199
  if (intVerbosityLevel < 0)
200
  {
201
    pobyso_error_message("pobyso_set_verbosity_to",
202
                        "INVALID_VALUE",
203
                        "The new verbosity level is a negative number");
204
    return(sollya_lib_error());
205
  }
206
  newVerbosityLevel = sollya_lib_constant_from_int(intVerbosityLevel);
207
  currentVerbosityLevel = sollya_lib_get_verbosity();
208
  sollya_lib_set_verbosity(newVerbosityLevel);
209
  return(currentVerbosityLevel);
210
} /* End of pobyso_set_verbosity_to_int. */
211

  
239 212
/* Attic from the sollya_lib < 4. */
240 213
#if 0
241 214
chain*
pobysoC-4.0/src/Makefile (revision 132)
1 1
CC           = gcc
2 2
CFLAGS       = -Wall -g 
3 3
#CFLAGS       = -Wall -g -I /warehouse/storres/root/include
4
LDLIB        = -Wl, -lmpfr -lgmp -lm -lfplll -lsollya
4
LDLIB        = -lmpfr -lgmp -lm -lfplll -lsollya
5 5

  
6 6
OBJS         = pobyso.o
7 7
INCS         = pobyso.h 
......
12 12
TEST_SOURCES = $(TEST_DIR)/$(TEST_DRIVER).c \
13 13
               # Add the suites definition sources
14 14

  
15
ALL_TARGETS = test-pobyso-01
15
ALL_TARGETS = test-pobyso-01 test-pobyso-02
16 16

  
17 17
SCRATCH_PRG := $(patsubst %.c,%,$(wildcard *.c))
18 18
SCRATCH_ALL := $(SCRATCH_PRG)

Formats disponibles : Unified diff